If you have a Kubernetes-ready Ubuntu Server, you’re all set to dive into the world of container orchestration. Let’s get started with the essential steps:

  1. Deploying the Master Node:

    • If you’re creating a new Kubernetes cluster, you’ll need to initialize at least one Kubernetes master node. Run the following commands on the VM or bare-metal server you wish to use as the master:
      kubeadm init --pod-network-cidr=10.100.20.0/24
      
    • Make note of the output; it contains information on how to join worker nodes to the cluster. Optionally, you can administer the cluster remotely with kubectl.
    • Create a password for the kadmin user and create a Kubernetes config file for the user:
      sudo passwd kadmin
      su -s /bin/bash - kadmin
      mkdir -p $HOME/.kube
      sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
      sudo chown $(id -u):$(id -g) $HOME/.kube/config
      exit
      
    • Create the network as the root user:
      kubectl apply -f [^1^][5]
      
  2. Joining a Worker Node to the Cluster:

    • Now that you have your Kubernetes master created, it’s time to join a worker node to the master and create your cluster.
    • Replace $token$ip:port, and $cert-hash in the command below with the information provided from the output of kubeadm init when you created your master node:
      kubeadm join $ip:port --token $token --discovery-token-ca-cert-hash $cert-hash
      
    • You can run kubectl get nodes on the Kubernetes master node (if configured for the kadmin user) or any workstation with the kubectl context pointed to this cluster to monitor the progress of node(s) joining your cluster.

Remember, Kubernetes is a powerful tool for managing containerized applications. Enjoy exploring and orchestrating your workloads! 

Was this answer helpful? 0 Users Found This Useful (0 Votes)

Powered by WHMCompleteSolution