我要评分
获取效率
正确性
完整性
易理解

Creating a Deployment

  1. 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:
    1
    kubectl 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.

  2. Run the following command to view the status of all pods in the ns-mysql-test namespace:
    1
    watch 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.