root@master:/k8s/configmap# cat info.yml
apiVersion: v1
kind: ConfigMap
metadata:
name: info
namespace: default
data:
db_host: 211.183.3.30
username: root
apiVersion: v1
kind: Pod
metadata:
name: my-pod-env
spec:
containers:
- name: my-container
image: nginx
env:
- name: USERNAME
valueFrom:
configMapKeyRef:
name: info
key: username
- name: DATABASE
valueFrom:
configMapKeyRef:
name: info
key: db_host
apiVersion: v1 kind: Secret metadata: name: sec type: Opaque stringData: password: test123 |
apiVersion: v1 kind: Pod metadata: name: pod-sec spec: containers: - name: sec-con image: nginx envFrom: - secretRef: name: sec |
'AWS Cloud School' 카테고리의 다른 글
[07.05] k8s HPA, 마스터노드 삼중화 (1) | 2024.10.09 |
---|---|
[07.04] Kubernetes RBAC, Dynamic Provisioner, livenessprobe & readinessprobe, StatefulSet, DaemonSet (0) | 2024.07.04 |
[06.27] Kubernetes PV, PVC (0) | 2024.06.27 |
[06.25-26] Kubernetes Deployment, Service, 배포방법 2가지(NodePort, LoadBalancer), Ingress Controller (0) | 2024.06.26 |
[06.24] Kubernetes 기초(로컬 클러스터 구성) (0) | 2024.06.24 |