티스토리 뷰
문제
|
문제 풀이
# 1. Context 변경
kubectl config use-context k8s
# 2.네임 스페이스 확인(미존재시 생성)
kubectl get namespaces ckad
kubectl create namespace ckad
# 3. ConfigMap 생성
kubectl create configmap web-config --from-literal=connection_string=localhost:80 --from-literal external_url=cncf.io --namespace ckad
kubectl get configmaps web-config -n ckad -o yaml
# 4. web-pod yaml 파일 생성
kubectl run web-pod --image=nginx:1.19.8-alpine -o yaml --dry-run=client > web-pod.yaml
vim web-pod.yaml
....
apiVersion: v1
kind: Pod
metadata:
labels:
run: web-pod
name: web-pod
namespace: ckad
spec:
containers:
- image: nginx:1.19.8-alpine
name: web-pod
envFrom:
- configMapRef:
name: web-config
# 5. web-pod 생성 및 env 확인
kubectl apply -f web-pod.yaml
kubectl exec -it -n ckad web-pod -- env
ConfigMaps
A ConfigMap is an API object used to store non-confidential data in key-value pairs. Pods can consume ConfigMaps as environment variables, command-line arguments, or as configuration files in a volume. A ConfigMap allows you to decouple environment-specifi
kubernetes.io
'공부자료 > CKA(K8S)' 카테고리의 다른 글
| [CKA] 따배씨 - 18. Ingress 구성 (0) | 2026.01.03 |
|---|---|
| [CKA] 따배씨 - 17. Secret 운영 (0) | 2026.01.03 |
| [CKA] 따배씨 - 15. NodePort 서비스 생성 (0) | 2026.01.02 |
| [CKA] 따배씨 - 14. init 컨테이너를 포함한 Pod 운영 (0) | 2026.01.02 |
| [CKA]따배씨 - 13. CPU 사용량이 높은 Pod 검색 (0) | 2026.01.02 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- zabbix
- OOM
- 따배씨
- Nifi Service
- openjdk1.8
- nifi.flowcontroller.autoResumeState
- flink
- exporter
- MAT
- k8s
- bigdata #data_mesh
- Item Prototypes
- CKA
- 설정에러
- Apache Nifi
- hdfs
- Discovery Rule
- spark driver
- Nifi Architecture
- flow.xml.gz
- java8
- nifi
- namenode
- 실시간처리
- Dataflow
- 빅데이터
- error
- Apache
- Bigdata
- lld
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 |
글 보관함