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
'Private & Public Cloud > kubernetes' 카테고리의 다른 글
K8S dashboard (0) | 2021.03.07 |
---|---|
m1 kubernetes 설치하고 dashboard 접속하기 (0) | 2021.02.27 |
kubernetes 환경에서 helm 에 사용자 정의변수 사용하기 (0) | 2019.12.09 |