我學習Kubernetes和對面的一個問題來了,想檢查是否有人碰到它,kubernetes隱藏副本集?
[email protected]:~/rc$ kubectl get rs ### don’t see any replica set
[email protected]:~/rc$
[email protected]:~/rc$
[email protected]:~/rc$ kubectl get pod
NAME READY STATUS RESTARTS AGE
bigwebstuff-673k9 1/1 Running 0 7m
bigwebstuff-cs7i3 1/1 Running 0 7m
bigwebstuff-egbqd 1/1 Running 0 7m
[email protected]:~/rc$
[email protected]:~/rc$
[email protected]:~/rc$ kubectl delete pod bigwebstuff-673k9 bigwebstuff-cs7i3 #### delete pods
pod "bigwebstuff-673k9" deleted
pod "bigwebstuff-cs7i3" deleted
[email protected]:~/rc$
[email protected]:~/rc$ kubectl get pod #### the deleted pods regenerated
NAME READY STATUS RESTARTS AGE
bigwebstuff-910m9 1/1 Running 0 6s
bigwebstuff-egbqd 1/1 Running 0 8m
bigwebstuff-fksf6 1/1 Running 0 6s
你看到被刪除的豆莢再生,雖然我不能找到副本集,就好像隱藏的複製集合存在於某處。
3個豆莢從rc.yaml文件啓動如下,
[email protected]:~/rc$ cat webrc.yaml
apiVersion: v1
kind: ReplicationController
metadata:
name: bigwebstuff
labels:
name: bigwebstuff
spec:
replicas: 3
selector:
run: testweb
template:
metadata:
labels:
run: testweb
spec:
containers:
- name: podweb
image: nginx
ports:
- containerPort: 80
但它並沒有顯示我用山藥文件來創建莢後。
有關如何找到隱藏副本集的任何想法?或者爲什麼豆莢再生?