Kubernetes configMap - only one file

后端 未结 3 584
星月不相逢
星月不相逢 2021-02-05 08:00

I have a configMap created from file:

kubectl create configmap ssportal-apache-conf --from-file=ssportal.conf=ssportal.conf

and th

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-05 08:06

    This works for me too. Useful in case you have more than one file inside the configmap.

                volumeMounts:
                - name: test
                  mountPath: /etc/apache2/conf-enabled/test.conf
                  subPath: test.conf
          volumes:
            - name: test
              configMap:
                name: test
                - key: test.conf
                  path: test.conf
    

提交回复
热议问题