[Mock3_3] Multi-POD

유유·2023년 1월 31일
0

CKA

목록 보기
3/19

docs >> https://kubernetes.io/ko/docs/concepts/workloads/pods/

Create a pod called multi-pod with two containers.Container 1, name: alpha, image: nginxContainer 2: name: beta, image: busybox, command: sleep 4800Environment Variables:container 1:name: alphaContainer 2:name: beta

Pod Name: multi-pod

Container 1: alpha

Container 2: beta

Container beta commands set correctly?

Container 1 Environment Value Set

Container 2 Environment Value Set

https://kubernetes.io/ko/docs/concepts/workloads/pods/

  • pod 만들기
kubectl run multi-pod alpha --image=nginx --dry-run=client -o yaml > multi.yaml
  • multi.yaml
apiVersion: v1
kind: Pod
metadata:
  labels:
    run: multi-pod
  name: multi-pod
spec:
  containers:
    image: nginx
    name: alpha
  containers:
  - command: ["sleep 4800"]
    image: busybox
    name: beta
---

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: null
  labels:
    run: multi-pod
  name: multi-pod
spec:
  containers:
  - image: nginx
    name: alpha
    env:
    - name: name
      value: alpha
  - image: busybox
    name: beta
    command: ["sleep","4800"]
    env:
    - name: name
      value: beta

확인

k describe pod multi-pod
profile
하이

0개의 댓글