Launching First Kubernetes Cluster with Nginx running

Launching First Kubernetes Cluster with Nginx running

·

1 min read

Kubeadm Installation

  • To install Kubeadm you can check this blog https://hashnode.com/post/clhytg25j000009mjbslkh601

  • Create the Nginx Pod

    1. By default, the kubectl run command creates a deployment and a replica set along with the pod. If you only want to create a pod without creating a deployment or replica set, you can use the --restart=Never flag.

    2. But if you pass --restart=Always, if your pod is deleted or having an issue, then a new pod will be replaced immediately.

        kubectl run nginx --image=nginx --restart=Never
      

    3. Now we can see the docker container in the worker node

        sudo docker ps
      

    4. To check if the pods are running or not

        kubectl get pods
      

    5. Get the details of the pod

        kubectl get pods -o wide
      

    6. To delete a pod in

        # kubectl delete pod  <pod-name>
        kubectl delete pod nginx
      

Thank You.