Latest Article

As explained in the last tutorial, We can deploy the application in kubernetes by creating deployment, services and pods using kubectl commands or using YAML configuration files. Already we have explained how to create kubernetes deployment, service and pods using kubectl command. In this tutorial, we will explain you how to create Kubernetes Deployment, Pods and Service using yaml configuration files.

In the previous posts, already we have explained the below topics. Refer those links to understand this topic from basics.

What is Kubernetes - Learn Kubernetes from Basics
How to Install Kubernetes Cluster with Docker on Linux
Create Kubernetes Deployment, Services & Pods Using Kubectl
What is Docker - Get Started from Basics - Docker Tutorial
What is Container, What is Docker on Container - Get Started
How to Install Docker on CentOS 7 / RHEL 7
Docker Images Explained with Examples - Docker Tutorial
How to Run Docker Containers - Explained with Examples

Using YAML helps us to create more complex structures and apply it immediately on the fly. YAML files can be added to version control system to track the file changes. You can create number of yaml files for each application deployments, services, pods and so on.

Create Kubernetes YAML for Deployment, Service & Pods

Let's use the same example what we have used in the earlier tutorial i.e., to create a deployment for httpd web server, It should run a single container within a pod using a docker image "httpd" and it should listen on port 80. Then finally create a service yaml file to expose the port externally so that users will be able to access it.

Kubernetes - Create Deployment YAML file
Create a normal file with yaml extension and add some properties as below. Already, I have created a basic deployment file with below objects to create a pod with single apache webserver container using httpd image.
[root@kubernetes-master ~]# cat httpd-basic-deployment.yaml
kind: Deployment
apiVersion: apps/v1beta1
metadata:
  name: my-httpd
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: webservers
    spec:
      containers:
      - name: my-httpd-container1
        image: httpd
        ports:
        - containerPort: 80
We must start with,
kind - It specfies that, what are you going to achieve with this file (deployment, pod, service, secret, jobs, replication controller, replicaset).
apiVersion - It specifies the api version for the kind. "apps/v1beta1" is the apiVersion for "Deployment" kind. To know more about these apiVersion and kind details, refer this link here.
metadata - Information about the kind specified. Here, we defined only "name" key and its value, so your deployment name will be created as "my-httpd".
spec - Actual specification starts from here with number of replicas, template to be used for entire pods and so on.
replicas - Number of replicas will be created and distributed across the available worker nodes.
template - Template to be used for entire pods. Templates are simply definitions of objects to be replicated
metadata - This metadata only for pods. It can be used to filter or identify by the name given within labels when you have lot of pods.
spec - This specification used for containers including the name of the container, name of the image, ports to be exposed, storage volumes and etc,.

Apply the YAML for kubernetes deployment.
Use "kubectl apply" command to apply the yaml configuration file.
[root@kubernetes-master ~]# kubectl apply -f httpd-basic-deployment.yml
deployment.apps/my-httpd created
[root@kubernetes-master ~]#
Check the status of the deployment and pods to ensure the pod is created using yaml file.
[root@kubernetes-master ~]# kubectl get deploy -o wide
NAME       DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE       CONTAINERS            IMAGES    SELECTOR
my-httpd   1         1         1            1           2m        my-httpd-container1   httpd     app=webservers
Above command "kubectl get deploy" output shows some information about our deployment that, it is created with name "my-httpd", name of the containers (my-httpd-container1), name of the images (httpd) and selector which was used with labels (app=webservers).

Let's check the pod status,
[root@kubernetes-master ~]# kubectl get pod -o wide
NAME                        READY     STATUS    RESTARTS   AGE       IP            NODE                                  NOMINATED NODE
my-httpd-7bb768779c-m4k56   1/1       Running   0          3m        172.16.1.18   kubernetes-client1.learnitguide.net   <none>
[root@kubernetes-master ~]#
Above command "kubectl get pod" output shows that, one pod is running in worker node "kubernetes-client1.learnitguide.net" with IP address "172.16.1.18".

Now Login into worker node "kubernetes-client1.learnitguide.net" and use the command "curl" to check the webserver is working locally.
[root@kubernetes-master ~]# ssh kubernetes-client1.learnitguide.net
root@kubernetes-client1.learnitguide.net's password:
Last login: Wed Aug 15 13:16:16 2018 from 192.168.2.99
[root@kubernetes-client1 ~]# curl 172.16.1.18:80
<html><body><h1>It works!</h1></body></html>
[root@kubernetes-client1 ~]# exit
logout
Connection to kubernetes-client1.learnitguide.net closed.
[root@kubernetes-master ~]#
As expected, we are able to access the webserver locally. Let's create a service yaml file, so that it will expose the port "80" to the outside world and mapped the port to the container port (target port).

Kubernetes - Create Service YAML file
[ads-post]
Service is an endpoint that exposes the ports to the outside world and mapped the port to the container port (target port). Already, I have created a basic service yaml file with below objects to expose the port.
[root@kubernetes-master ~]# cat httpd-basic-service.yaml
kind: Service
apiVersion: v1
metadata:
  name: my-httpd-service
spec:
  selector:
    app: webservers
  type: LoadBalancer
  ports:
    - name: my-apache-port
      port: 8080
      targetPort: 80

We must start with,
kind - It specfies that, what are you going to achieve with this file (deployment, pod, service, secret, jobs, replication controller, replicaset).
apiVersion - It specifies the api version for the kind. "v1" is the apiVersion for "Service" kind. To know more about these apiVersion and kind details, refer this link here.
metadata - Information about the kind specified. Here, we defined only "name" key and its value, so your service name will be created as "my-httpd-service".
spec - Actual specification starts from here with selector name, type of the service and ports to be exposed with name, port and target port.
selector - We must specify the correct label name here what we have used while creating the deployment. else, it wont work properly.
type - Type of the service (ClusterIP, NodePort, LoadBalancer) - To know more about these type of service, refer this link here.
ports - Specify the name of the service port, port number and target port.

Apply the YAML file for kubernetes service.
Use "kubectl apply" command to apply the yaml configuration file.
[root@kubernetes-master ~]# kubectl apply -f httpd-basic-service.yml
service/my-httpd-service created
Check the status of service to ensure the service is created correctly as per the yaml file.
[root@kubernetes-master ~]# kubectl get svc -o wide
NAME               TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE       SELECTOR
kubernetes         ClusterIP      10.96.0.1        <none>        443/TCP          2d        <none>
my-httpd-service   LoadBalancer   10.105.115.116   <pending>     8080:30374/TCP   1m        app=webservers
Above command "kubectl get svc" output shows that, service "my-httpd-service" is created with LoadBalancer type, random port number (30374) and assigned to given selector. We know already that, the pod is running on worker node "kubernetes-client1.learnitguide.net". So we we will be able to access this using the URL "http://kubernetes-client1.learnitguide.net:30374" from other system if you are in the same network.
[root@kubernetes-master ~]# curl http://kubernetes-client1.learnitguide.net:30374
<html><body><h1>It works!</h1></body></html>
[root@kubernetes-master ~]#
That's it, Hope you have got an idea how to create deployments, services and pods in kubernetes cluster using yaml files. Going forward we will play more with kubernetes tool. Keep practicing and have fun. Leave your comments if any.

Also refer other articles,

What is Kubernetes - Learn Kubernetes from Basics
How to Install Kubernetes Cluster with Docker on Linux
Create Kubernetes Deployment, Services & Pods Using Kubectl
What is Docker - Get Started from Basics - Docker Tutorial
What is Container, What is Docker on Container - Get Started
How to Install Docker on CentOS 7 / RHEL 7
Docker Images Explained with Examples - Docker Tutorial
How to Run Docker Containers - Explained with Examples

Support Us: Share with your friends and groups.

Stay connected with us on social networking sites, Thank you.
YouTube | Facebook | Twitter | Pinterest | Rss
Incoming searches: Incoming searches: create kubernetes yaml, kubernetes create deployment yaml, kubernetes create service yaml, kubernetes create pods yaml, create kubernetes deployments, kubernetes deployments, create kubernetes services, kubernetes service, create kubernetes pods, kubernetes pod, kubernetes deployment tutorial, kubernetes deployment yaml, kubernetes deployment vs service, kubernetes deployment service, kubernetes deployment pods, kubernetes deployment examples, how to create kubernetes deployment, create kubernetes deployment yaml, kubernetes create service for deployment, kubernetes service yaml, kubernetes service expose, kubernetes pods example, deployment kubernetes, best kubernetes tutorial, best kubernetes course

We can deploy the application in kubernetes by creating deployment, services and pods using kubectl command or using yaml configuration files. In this tutorial, I will explain you how to create Kubernetes Deployment, Pods and Service using Kubectl.

In the previous posts, already we have explained the below topics. Refer those links to understand this topic from basics.

What is Kubernetes - Learn Kubernetes from Basics
How to Install Kubernetes Cluster with Docker on Linux
Create Kubernetes YAML for Deployment, Service & Pods
What is Docker - Get Started from Basics - Docker Tutorial
What is Container, What is Docker on Container - Get Started
How to Install Docker on CentOS 7 / RHEL 7
Docker Images Explained with Examples - Docker Tutorial
How to Run Docker Containers - Explained with Examples

Let's get started.

Create Kubernetes Deployment, Services & Pods Using Kubectl

What is Deployment in Kubernetes?
Deployment is a controller which manages the pods and It ensures the desired number of pods are always running.

What is Pod in Kubernetes?
Pod is a group of one or more containers for an application which runs on worker (minion) nodes.

For example, Let's create a deployment controller for httpd web server, It would run a single container within a pod using a docker image "httpd" and it will listen on port 80.

Our Lab Setup:
kubernetes cluster configuration
How to Create Deployment and Pods?
Once you have Working Kubernetes Cluster environment, Use "kubectl" command to create a Kubernetes Deployment. Else, Refer this article how to install kubernetes cluster on Linux.
[root@kubernetes-master ~]# kubectl run my-httpd --image=httpd --replicas=1 --port=80
deployment.apps/my-httpd created
Where, "kubectl run" is the command to run the deployment.
"my-httpd" - Used to define the name of the deployment controller
"--image=httpd" - Used to specify which image to be used for the container.
"--replicas=1" - Used to specify number of pods(replication) to be running.
"--port=80" - Used to specify the pods to listen on port 80 locally.

Check the status of deployment
Use "kubectl get deployment" command to display the status of deployments created.
[root@kubernetes-master ~]# kubectl get deployment
NAME       DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
my-httpd   1         1         1            1           30m

Above command gives us the status of deployment with,
NAME - Name of the deployment,
DESIRED - Number of Desired Pods,
CURRENT - Number of Current Pods,
UP-TO-DATE - Number of Pods are up-to-date,
AVAILABLE - Number of Pods are available
AGE - How long the pods are running.
[ads-post]
Also you can use above command with "-o wide" option to get additional details,
CONTAINERS - List of containers associated to this pods
IMAGES - List of Images used in this pods
SELECTOR - Name of the selectors.
[root@kubernetes-master ~]# kubectl get deployment -o wide
NAME           DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE       CONTAINERS     IMAGES            SELECTOR
my-httpd       1         1         1            1           32m       my-httpd       httpd             run=my-httpd
Check the status of Pods
Use "kubectl get pod" command to display the status of pods.
[root@kubernetes-master ~]# kubectl get pod
NAME                            READY     STATUS    RESTARTS   AGE
my-httpd-85fc77d457-cr8jl       1/1       Running   0          37m
Above command gives us the status of pods with,
NAME - Name of the pod,
READY - How many pods are ready out of total pods.
STATUS - Status of pods
RESTARTS - How many times it has restarted
AGE - How long the pods are running.

Again use "-o wide" option to get additional details,
IP - IP address of the pod assigned from the CIDR range been set already during the kubernetes setup, this IP address can be used to access the pod.
NODE - Name of the node on which pod is running.
NOMINATED - Name of the Reserved node.
[root@kubernetes-master ~]# kubectl get pod -o wide
NAME                            READY     STATUS    RESTARTS   AGE       IP           NODE                                  NOMINATED NODE
my-httpd-85fc77d457-cr8jl       1/1       Running   0          51m       172.16.1.2   kubernetes-client1.learnitguide.net   <none>
From above output, our "my-httpd" pod is running on worker node "kubernetes-client1.learnitguide.net" and it has got IP Address "172.16.1.2". So we would be able to access the httpd web server through this IP Address "172.16.1.2" only from the worker node "kubernetes-client1.learnitguide.net".

Let's Login into the Worker node "kubernetes-client1.learnitguide.net" and use "curl" command to check the pods are working fine and accessible.
[root@kubernetes-client1 ~]# curl 172.16.1.5:80
<html><body><h1>It works!</h1></body></html>
[root@kubernetes-client1 ~]#
As expected, it's working from the worker node. Lets create a service to expose the ports externally. so that, any users can access the pods from other systems.

What is Service in Kubernetes?
Service is an endpoint that exposes the ports to the outside world and mapped the port to the container port (target port).

Creating Kubernetes Service
Let's Create a Service to expose the deployment "my-httpd" to port 8080 and connects to the containers on port 80, this would assign a random port number. Using that port, we can access this pods externally.
[root@kubernetes-master ~]# kubectl expose deployment my-httpd --port=8080 --target-port=80 --type=LoadBalancer
Check the status of Service to find the random port number.
[root@kubernetes-master ~]# kubectl get svc
NAME         TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
kubernetes   ClusterIP      10.96.0.1        <none>        443/TCP          5h
my-httpd     LoadBalancer   10.110.252.204   <pending>     8080:31255/TCP   1m
Newly created service has got port number "31255" for "my-httpd" deployment and we know this pod is running on worker node "kubernetes-client1.learnitguide.net". Now we we will be able to access this using the URL "http://kubernetes-client1.learnitguide.net:31255". from other system if you are in the same network.
[root@lab-server ~]# curl http://kubernetes-client1.learnitguide.net:31255
<html><body><h1>It works!</h1></body></html>
[root@lab-server ~]# 
Confused with lot of ports? Simple!

kubernetes-client1.learnitguide.net:31255 --> kubernetes-client1.learnitguide.net:8080 --> 172.16.1.5:80.

This is what the purpose of service, It exposes the ports to the outside world with some random port and mapped the port to the target port, finally it redirects to the actual container port...

That's it, Hope you have got an idea how to create deployments, services and pods in kubernetes cluster.  Going forward we will play more with kubernetes tool. Keep practicing and have fun. Leave your comments if any.

Also refer other articles,

What is Kubernetes - Learn Kubernetes from Basics
How to Install Kubernetes Cluster with Docker on Linux
Create Kubernetes YAML for Deployment, Service & Pods
What is Docker - Get Started from Basics - Docker Tutorial
What is Container, What is Docker on Container - Get Started
How to Install Docker on CentOS 7 / RHEL 7
Docker Images Explained with Examples - Docker Tutorial
How to Run Docker Containers - Explained with Examples

Support Us: Share with your friends and groups.

Stay connected with us on social networking sites, Thank you.
YouTube | Facebook | Twitter | Pinterest | Rss
Incoming searches: create kubernetes deployments, kubernetes deployments, create kubernetes services, kubernetes service, create kubernetes pods, kubernetes pod, kubernetes deployment tutorial, kubernetes deployment yaml, kubernetes deployment vs service, kubernetes deployment service, kubernetes deployment pods, kubernetes deployment examples, how to create kubernetes deployment, create kubernetes deployment yaml, kubernetes create service for deployment, kubernetes service yaml, kubernetes service expose, kubernetes pods example, deployment kubernetes, best kubernetes tutorial, best kubernetes course

This tutorial provides you the step by step procedure for installing and configuring kubernetes multinode cluster with Docker on Linux (RHEL7 / CentOS7) using Kubeadm and Kubectl.

But there is also a another way of setting up Kubernetes cluster with Minikube. This post will not cover the minikube installation for now. Because, Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for beginners who wants to practice Kubernetes, that will not really help on production environment.

In the previous posts, already we have explained the below topics. Refer those links to understand this topic from basics.

What is Kubernetes - Learn Kubernetes from Basics
Create Kubernetes Deployment, Services & Pods Using Kubectl
Create Kubernetes YAML for Deployment, Service & Pods
What is Docker - Get Started from Basics - Docker Tutorial
What is Container, What is Docker on Container - Get Started
How to Install Docker on CentOS 7 / RHEL 7
Docker Images Explained with Examples - Docker Tutorial
How to Run Docker Containers - Explained with Examples

Install & Configure Kubernetes Cluster with Docker on Linux

Let's get started.

Our Lab Setup:
kubernetes cluster configuration
Prerequisites:
1. Make sure kubernetes master and worker nodes are reachable between each other.
2. Make an entry of each host in /etc/hosts file for name resolution on all kubernetes nodes as below or configure it on DNS if you have DNS server.
cat /etc/hosts
192.168.2.1 kubernetes-master.learnitguide.net kubernetes-master
192.168.2.2 kubernetes-client1.learnitguide.net kubernetes-client1
192.168.2.3 kubernetes-client2.learnitguide.net kubernetes-client2
3. Kubernetes doesn't support "Swap". Disable Swap on all nodes.
swapoff -a
4. Internet must be enabled on all nodes, because required packages for kubernetes cluster will be downloaded from official repository.

Steps involved to create kubernetes cluster,

On All Nodes:
1. Enable Kubernetes repository on master and all worker nodes
2. Install the required packages on master and all worker nodes
3. Start and Enable docker and kubelet services on master and all worker nodes
4. Allow Network Ports in firewall on master and all worker nodes

On Master Node:
5. Initializing and setting up the kubernetes cluster on Master node
6. Copy /etc/kubernetes/admin.conf and Change Ownership only on Master node
7. Install Network add-on to enable the communication between the pods only on Master node

On Worker Nodes:
8. Join all worker nodes with kubernetes master node

1. Enable Kubernetes repository on master and all worker nodes
cat /etc/yum.repos.d/kubernetes.repo
Output:
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
        https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
2. Install the required packages on master and all worker nodes
Install "docker" and "kubeadm" packages using yum command.
yum -y install docker kubeadm
3. Start and Enable docker and kubelet services on master and all worker nodes
systemctl start docker && systemctl enable docker
systemctl start kubelet && systemctl enable kubelet
4. Allow Network Ports in firewall on master and all worker nodes
firewall-cmd --permanent --add-port=6443/tcp
firewall-cmd --permanent --add-port=10250/tcp
firewall-cmd --reload
Kubernetes service's endpoints are being set with port 6443 and Kubelet listens on port 10250

Also Set "1" to bridge firewall rules,
echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables
If you get an error as "No such file or directory", then load the module "br_netfilter" and try the command again.
modprobe br_netfilter
echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables
5. Initializing and setting up the kubernetes cluster on Master node
Use "kubeadm" command to initialize the kubernetes cluster along with "apiserver-advertise-address" and "--pod-network-cidr" options. It is used to specify the IP address for kubernetes cluster communication and range of networks for the pods.
[ads-post]
[root@kubernetes-master ~]# kubeadm init --apiserver-advertise-address 192.168.2.1 --pod-network-cidr=172.16.0.0/16
Output:
[init] using Kubernetes version: v1.11.2
[preflight] running pre-flight checks
        [WARNING Firewalld]: firewalld is active, please ensure ports [6443 10250] are open or your cluster may not function correctly
I0811 21:10:04.905996   12195 kernel_validator.go:81] Validating kernel version
I0811 21:10:04.906058   12195 kernel_validator.go:96] Validating kernel config
[preflight/images] Pulling images required for setting up a Kubernetes cluster
[preflight/images] This might take a minute or two, depending on the speed of your internet connection
[preflight/images] You can also perform this action in beforehand using 'kubeadm config images pull'
[kubelet] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[kubelet] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[preflight] Activating the kubelet service
[certificates] Generated ca certificate and key.
.........................................................................
suppressed few messages
-------------------------------------------------------
[bootstraptoken] creating the "cluster-info" ConfigMap in the "kube-public" namespace
[addons] Applied essential addon: CoreDNS
[addons] Applied essential addon: kube-proxy
Your Kubernetes master has initialized successfully!
To start using your cluster, you need to run the following as a regular user:
  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/
You can now join any number of machines by running the following on each node
as root:
  kubeadm join 192.168.2.1:6443 --token pxavv6.zwqgdlivwfgbaaud --discovery-token-ca-cert-hash sha256:0cd1e77fd1514a6ec60e3c67c678c0d88ac80b18ff8184271ecef1ccdc01ee55
[root@kubernetes-master ~]#
Kubernetes cluster initialization is completed, Copy the join token highlighted in yellow color from the "kubeadm init" command output and store it somewhere, it is required while joining the worker nodes.

6. Copy /etc/kubernetes/admin.conf and Change Ownership only on Master node
Once kubernetes cluster is initialized, copy "/etc/kubernetes/admin.conf" and change ownership. You could see this same instructions in the output of "kubeadm init" command.
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
7. Install Network add-on to enable the communication between the pods only on Master node
We have lot of network add-on available to enable the network communication  with different functionality, Here I have used flannel network provider. Flannel is an overlay network provider that can be used with Kubernetes. You can refer more add-on from here.
[root@kubernetes-master ~]# kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
Output:
clusterrole.rbac.authorization.k8s.io/flannel created
clusterrolebinding.rbac.authorization.k8s.io/flannel created
serviceaccount/flannel created
configmap/kube-flannel-cfg created
daemonset.extensions/kube-flannel-ds-amd64 created
daemonset.extensions/kube-flannel-ds-arm64 created
daemonset.extensions/kube-flannel-ds-arm created
daemonset.extensions/kube-flannel-ds-ppc64le created
daemonset.extensions/kube-flannel-ds-s390x created
Use "kubectl get nodes" command to ensure the kubernetes master node status is ready. Wait for few minutes until the status of the kubernetes master turn ready state.
[root@kubernetes-master ~]# kubectl get nodes
NAME                STATUS    ROLES     AGE       VERSION
kubernetes-master   Ready     master    14m       v1.11.1
[root@kubernetes-master ~]#
8. Join all worker nodes with kubernetes master node
Now, Use the join token to join all the worker nodes with kubernetes master node as below.
kubeadm join 192.168.2.1:6443 --token pxavv6.zwqgdlivwfgbaaud --discovery-token-ca-cert-hash sha256:0cd1e77fd1514a6ec60e3c67c678c0d88ac80b18ff8184271ecef1ccdc01ee55
Output:
[preflight] running pre-flight checks
        [WARNING RequiredIPVSKernelModulesAvailable]: the IPVS proxier will not be used, because the following required kernel modules are not loaded: [ip_vs_wrr ip_vs_sh ip_vs ip_vs_rr] or no builtin kernel ipvs support: map[nf_conntrack_ipv4:{} ip_vs:{} ip_vs_rr:{} ip_vs_wrr:{} ip_vs_sh:{}]
you can solve this problem with following methods:
 1. Run 'modprobe -- ' to load missing kernel modules;
2. Provide the missing builtin kernel ipvs support
I0811 21:22:23.219089    2523 kernel_validator.go:81] Validating kernel version
I0811 21:22:23.219199    2523 kernel_validator.go:96] Validating kernel config
[discovery] Trying to connect to API Server "192.168.2.1:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://192.168.2.1:6443"
[discovery] Requesting info from "https://192.168.2.1:6443" again to validate TLS against the pinned public key
[discovery] Cluster info signature and contents are valid and TLS certificate validates against pinned roots, will use API Server "192.168.2.1:6443"
[discovery] Successfully established connection with API Server "192.168.2.1:6443"
[kubelet] Downloading configuration for the kubelet from the "kubelet-config-1.11" ConfigMap in the kube-system namespace
[kubelet] Writing kubelet configuration to file "/var/lib/kubelet/config.yaml"
[kubelet] Writing kubelet environment file with flags to file "/var/lib/kubelet/kubeadm-flags.env"
[preflight] Activating the kubelet service
[tlsbootstrap] Waiting for the kubelet to perform the TLS Bootstrap...
[patchnode] Uploading the CRI Socket information "/var/run/dockershim.sock" to the Node API object "kubernetes-client1" as an annotation
This node has joined the cluster:
* Certificate signing request was sent to master and a response
  was received.
* The Kubelet was informed of the new secure connection details.
Run 'kubectl get nodes' on the master to see this node join the cluster.
Once worker nodes are joined with kubernetes master, then verify the list of nodes within the kubernetes cluster. Wait for few minutes until the status of the kubernetes nodes turn ready state.
[root@kubernetes-master ~]# kubectl get nodes
NAME                 STATUS    ROLES     AGE       VERSION
kubernetes-client1   Ready     <none>    56s       v1.11.2
kubernetes-client2   Ready     <none>    48s       v1.11.2
kubernetes-master    Ready     master    50m       v1.11.1
[root@kubernetes-master ~]#
Thats it, We have successfully configured the kubernetes cluster. Our Kubernetes master and worker nodes are ready to deploy the application.

Going forward we will play more with kubernetes tool. Keep practicing and have fun. Leave your comments if any.

Also refer other articles,

What is Kubernetes - Learn Kubernetes from Basics
Create Kubernetes Deployment, Services & Pods Using Kubectl
Create Kubernetes YAML for Deployment, Service & Pods
What is Docker - Get Started from Basics - Docker Tutorial
What is Container, What is Docker on Container - Get Started
How to Install Docker on CentOS 7 / RHEL 7
Docker Images Explained with Examples - Docker Tutorial
How to Run Docker Containers - Explained with Examples

Support Us: Share with your friends and groups.

Stay connected with us on social networking sites, Thank you.
YouTube | Facebook | Twitter | Pinterest | Rss
Incoming searches: Kubernetes, Configure Kubernetes Cluster, install Kubernetes, configure Kubernetes, install Kubernetes cluster, create Kubernetes cluster, setup Kubernetes, Kubernetes cluster install, Kubernetes setup, Kubernetes cluster creation, Kubernetes docker, Kubernetes tutorial, Kubernetes wiki, create Kubernetes using minikube, Kubernetes cluster manually, Kubernetes cluster without minikube, full Kubernetes cluster, Kubernetes cluster architecture, Kubernetes cluster tutorial, Kubernetes cluster wiki, install Kubernetes cluster on linux, install Kubernetes cluster on centos, install Kubernetes cluster on rhel, install Kubernetes cluster on rhel 7, install Kubernetes cluster kubeadm, setup kubernetes cluster, multinode kubernetes cluster setup

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget