标签:ocs ice busybox replica dev cep exp back nec
apiVersion: apps/v1 kind: Deployment metadata: name: my-deployment spec: selector: matchLabels: app: metrics department: sales replicas: 3 template: metadata: labels: app: metrics department: sales spec: containers: - name: hello image: "gcr.io/google-samples/hello-app:2.0"
将此清单复制到名为 my-deployment.yaml
的文件,然后创建该 Deployment:
kubectl apply -f my-deployment.yaml
root@ubuntu:~/k8s_server# mv nsexec.c my-deployment.yaml root@ubuntu:~/k8s_server# kubectl apply -f my-deployment.yaml deployment.apps/my-deployment created root@ubuntu:~/k8s_server# kubectl get pods NAME READY STATUS RESTARTS AGE kata-busybox 1/1 Running 0 207d kata-nginx 1/1 Running 0 205d my-deployment-68bdbbb5cc-2d2k6 0/1 ContainerCreating 0 7s my-deployment-68bdbbb5cc-7fkwp 0/1 ContainerCreating 0 7s my-deployment-68bdbbb5cc-lk5vr 0/1 ContainerCreating 0 7s root@ubuntu:~/k8s_server#
root@ubuntu:~/k8s_server# kubectl get pods NAME READY STATUS RESTARTS AGE kata-busybox 1/1 Running 0 207d kata-nginx 1/1 Running 0 205d my-deployment-68bdbbb5cc-2d2k6 0/1 ImagePullBackOff 0 16m my-deployment-68bdbbb5cc-7fkwp 0/1 ImagePullBackOff 0 16m my-deployment-68bdbbb5cc-lk5vr 0/1 ImagePullBackOff 0 16m root@ubuntu:~/k8s_server# kubectl delete pod my-deployment-68bdbbb5cc-2d2k6 my-deployment-68bdbbb5cc-7fkwp my-deployment-68bdbbb5cc-lk5vr pod "my-deployment-68bdbbb5cc-2d2k6" deleted pod "my-deployment-68bdbbb5cc-7fkwp" deleted pod "my-deployment-68bdbbb5cc-lk5vr" deleted
标签:ocs ice busybox replica dev cep exp back nec
原文地址:https://www.cnblogs.com/dream397/p/14759829.html