nignx-configmap

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
        name: ngnx
    spec:
      containers:
      - name: nginx
        image: nginx:1.7.9
        ports:
        - containerPort: 80
        volumeMounts:
        - name: config-volume
          mountPath: /etc/nginx/conf.d/default1.conf
          subPath: default1.conf
        - name: config-volume
          mountPath: /etc/nginx/conf.d/defualt2.conf
          subPath: default2.conf
        - name: config-volume2
          mountPath: /etc/nginx/conf.d/conf.d/default3.conf
          subPath: default3.conf
      volumes:
      - name: config-volume
        configMap:
          name: nginx-configmap1
          items:
          - key: default1.conf
            path: default1.conf
          - key: default2.conf
            path: default2.conf
      - name: config-volume2
        configMap:
          name: nginx-configmap2
          items:
          - key: default1.conf
            path: default3.conf

相关推荐