Configmap as single file

From UVOO Tech Wiki
Jump to navigation Jump to search

Example of NGINX

apiVersion: v1
kind: ConfigMap
metadata:
  name: nginx-config
  ...
data:
  nginx.conf: |
    ...some raw config string...
---

apiVersion: apps/v1
kind: Deployment

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