본문 바로가기
Private & Public Cloud/kubernetes

Configmap 만드는 몇가지 방법

by 낭만프로그래머. 2019. 12. 6.

1. kubectl create configmap <map-name> <data-source>

만들고 확인

kubectl get configmaps game-config -o yaml

 

2. kubectl create configmap game-config-2 --from-file=configure-pod-container/configmap/game.properties

Caution: When passing --from-env-file multiple times to create a ConfigMap from multiple data sources, only the last env-file is used.

 

3. kubectl create configmap game-config-3 --from-file=<my-key-name>=<path-to-file>

4. kubectl create configmap special-config --from-literal=special.how=very --from-literal=special.type=charm

- 화일작업없이 inline command 같이 실행이 되서 만들어진다.

5. kubectl create -f https://kubernetes.io/examples/configmap/configmaps.yaml

- 외부접근하여 생성

 

 

참고사이트

https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/

 

Configure a Pod to Use a ConfigMap

 

kubernetes.io