Kubernetes - basic hands-on
First, let’s get some basic understanding:
Kubernetes is an open-source container-orchestration system for automating computer application deployment, scaling, and management. It was originally designed by Google and is now maintained by the Cloud Native Computing Foundation.
Here the simple idea of words we are going to use,
containers : lightweight docker images running in(docker images are lightweight because it has no kernel)
lets say the container is down, that means there is no management for the service(if that docker container has a service), then that is why Kubernetes comes to the picture
Pod : we can have one or multiple containers in a pod. If the pod is running on a network and it is called pod network
Master : Who is managing the cluster
Worker nodes : where the actual containers are running
you will see the nodes in the Kubernetes cluster using following command:
kubectl get nodes
Let’s create a pod using a test.yml file, here a nginx docker image is going to be used
vi test.yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
spec:
containers:
- name: c1
image: nginx
after, execute the command to create the pod using kubectl command
kubectl create -f pod.yaml
To list the pods created,
kubectl get pods
if you need more detailed list , use following command
kubectl get pods -o wide
Then you will see the ip address and etc.
To see detailed information about a specific pod, use following command. Every pod can have a one container or multiple containers;
kubectl describe pod nginx-pod
Then you will get the details of the nginx pod you created in the terminal.
Let’s see how we can access this application
Accessing any pod which is in pod network using service is the best way.
To be continued....
keep on continue this lesson " )
ReplyDelete