Home > Archives > Relication示例

Relication示例

Publish:

# my-replication-controller.yaml
apiVersion: v1
kind: ReplicationController
metadata:
  name: my-replication-controller
spec:
  replicas: 3
  selector:
    app: hello-pod-v1
  template:
    metadata:
      labels:
        app: hello-pod-v1
    spec:
      containers:
      - name: my-pod
        image: baoguoding/demo
        ports:
        - containerPort: 3000

kubectl create -f my-replication-controller.yaml
kubectl get rc
kubectl describe rc my-replication-controller
kubectl get pods
kubectl describe pod my-replication-controller-d8tlt
kubectl delete pod my-replication-controller-d8tlt
kubectl scale --replicas=4 -f my-replication-controller.yaml
kubectl get rc
kubectl delete rc my-replication-controller --cascade=false
kubectl delete pods <pod> --grace-period=0 --force

参考

声明: 本文采用 BY-NC-SA 授权。转载请注明转自: Ding Bao Guo