2017-02-06 5 views

答えて

10

あなたはConfigMapオブジェクトを作成し、あなたがそれらを必要とするファイルとして値をマウントすることができます(の重複に注意してください

spec: 
    containers: 
    - name: nginx 
     image: nginx 
     volumeMounts: 
     - name: nginx-config 
      mountPath: /etc/nginx/nginx.conf 
      subPath: nginx.conf 
     - name: nginx-config 
      mountPath: /etc/nginx/other.conf 
      subPath: other.conf 
    volumes: 
    - name: nginx-config 
     configMap: 
     name: nginx-config 

apiVersion: v1 
kind: ConfigMap 
metadata: 
    name: nginx-config 
data: 
    nginx.conf: | 
    your config 
    comes here 
    like this 
    other.conf: | 
    second file 
    contents 

そして、あなたポッドの仕様でファイル名はmountPathで、正確に同じサブパスを使用します;バインドマウントファイルと同じです)

ConfigMapの詳細については、 を参照してください。

関連する問題