ื—ืœืง 1 โ€” ื™ืฆื™ืจืช Pod ืฉืชื•ืื ืœ-Selector ืฉืœ ื”-ReplicaSet

ื ืขื‘ื•ืจ ืœ-IDE ื•ื ื™ืฆื•ืจ ืงื•ื‘ืฅ ื—ื“ืฉ:

touch nginx-pod.yaml

ื ื’ื“ื™ืจ Pod ืจื’ื™ืœ (ืœื ReplicaSet):

apiVersion: v1
kind: Pod
metadata:
  name: solo-nginx
  labels:
    app: nginx
spec:
  containers:
    - name: nginx
      image: nginx:1.27.0
      ports:
        - containerPort: 80

ืฉื™ืžื• ืœื‘ ๐Ÿ‘€

ื”-label app: nginx ื–ื”ื” ืœื–ื” ืฉืžื•ื’ื“ืจ ื‘-ReplicaSet.

ื ืฉืžื•ืจ ืืช ื”ืงื•ื‘ืฅ.


ื—ืœืง 2 โ€” ื™ืฆื™ืจืช ื”-Pod ื”ื—ื“ืฉ

ื‘ื˜ืจืžื™ื ืœ ื ืฉืื™ืจ:

kubectl get pods --watch

ื•ื‘ื˜ืจืžื™ื ืœ ื ื•ืกืฃ:

kubectl get rs --watch

ื›ืขืช ื ื™ืฆื•ืจ ืืช ื”-Pod:

kubectl apply -f nginx-pod.yaml

ืžื” ืงื•ืจื” ืขื›ืฉื™ื•?

ืžื™ื“ ื ืจืื”: