Creating a Deployment
- At the first deployment, you need to use the mysql_deployment.yaml file to create deployment resources. Run the following command on the primary node:
1kubectl create -f ./mysql_deployment.yaml
namespace/ns-mysql-test created subnet.kubeovn.io/ns-mysql-test created pod/mysql-1 created pod/mysql-2 created pod/mysql-3 created service/mysql-1-service created service/mysql-2-service created service/mysql-3-service created
If no error is reported, the resources are successfully created.
- Run the following command to view the status of all pods in the ns-mysql-test namespace:
1watch kubectl get pod -n ns-mysql-test -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES mysql-1 1/1 Running 0 3m32s 10.99.0.15 node-test-1 <none> <none> mysql-2 1/1 Running 0 3m32s 10.99.0.16 node-test-2 <none> <none> mysql-3 1/1 Running 0 3m32s 10.99.0.17 node-test-3 <none> <none>
After the watch command is executed, the pod information is updated periodically. If the pod status stays at Running for a period of time, the pod is normal. Press Ctrl+C to exit the watch command.
Parent topic: Maintaining the Deployment Using the YAML File