ssh k8smaster:
kubectl get nodes
```sh
[root@k8sm1 wal]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8sm1 Ready control-plane 187d v1.28.2
k8sn1 Ready <none> 187d v1.28.2
k8sn2 Ready <none> 187d v1.28.2
```
From above we can say two nodes are ready for deployment:
There is 2 ways to deploy
1. Imperrative way:
1. It is a way to deploy using command line:
1. kubectl create deployment nginx --image=nginx --replicas=3
2. It will automatically deploy nginx and replication will be 3
2. Deceletative way:
1. Using Yaml/Json manifest file
Lets deploy a container using CMD
kubectlgetpodkubectlcreatedeploymentnginx--image=nginx--replicas=3 [root@k8sm1 wal]# kubectl get podNAMEREADYSTATUSRESTARTSAGEnginx-7854ff8877-djvzz1/1Running014snginx-7854ff8877-jbr5v1/1Running014snginx-7854ff8877-pnjvv1/1Running014s [root@k8sm1 wal]# kubectlgetdeployments.appskubectllogspods{pods_name}kubectlexec-itnginx-7854ff8877-pnjvvbash//ifyouneedtogoinsidecontainerkubectldeletedeployments.appsnginx