Kubernetes Class Document
Kubernetes Class Document
lo
Kubernetes
x.
le
ip
.a
w By Praveen Singampalli
w
Instagram/Telegram/twitter –
SINGAM4DEVOPS
w
lo
x.
A Kubernetes cluster
consists of a set of worker
le
machines, called nodes,
that run containerized
applications. Every cluster
ip
has at least one worker
node.
.a
The worker node(s) host
the Pods that are the
components of the w
application workload.
The control pane manages
the worker nodes and the
w
Pods in the cluster.
w
lo
x.
• Master Node Components:
1. API Server 2. Controller Manager 3. ETCD 4. Scheduler
le
1) API Server:
It is the front-end for the Kubernetes control plane.
ip
2) Controller Manager: This is a component on the master that runs controllers.
• Node Controller: Responsible for noticing and responding when nodes go down.
.a
• Replication Controller: Responsible for maintaining the correct number of pods for every replication
controller object in the system.
w
• Endpoints Controller: Populates the Endpoints object (that is, it joins Services and Pods).
• Service Account and Token Controllers: Create default accounts and API access tokens for new namespaces.
w
3) ETCD: Consistent and highly-available key value store used as Kubernetes' backing store for all cluster data.
4) kube-scheduler - Control plane component that watches for newly created Pods with no assigned node, and
selects a node for them to run on.
w
l
lo
x.
Node components run on every node, maintaining running pods and providing the Kubernetes
runtime environment
1) Kubelet - An agent that runs on each node in the cluster. It makes sure that containers are
le
running in a Pod.
The kubelet takes a set of PodSpecs that are provided through various mechanisms and ensures
ip
that the containers described in those PodSpecs are running and healthy. The kubelet doesn't
manage containers which were not created by Kubernetes.
2)kube-proxy - kube-proxy is a network proxy that runs on each node in your cluster,
.a
implementing part of the Kubernetes Service concept. Kube-proxy maintains network rules on
nodes. These network rules allow network communication to your Pods from network sessions
inside or outside of your cluster.
w
3)Container runtime - The container runtime is the software that is responsible for running
containers.
w
w
l
lo
x.
apiversion
le
Kind
ip
Metadata
Spec
.a
File name : nginx-deployment.yaml
w
w
w
l
lo
x.
Kubernetes ServiceTypes allow you to specify what kind of Service
you want. The default is ClusterIP.
le
Type values and their behaviors are:
ClusterIP: Exposes the Service on a cluster-internal IP. Choosing this
value makes the Service only reachable from within the cluster. This
ip
is the default ServiceType.(To talk to other nodes in the cluster)
NodePort: Exposes the Service on each Node's IP at a static port
.a
(the NodePort). A ClusterIP Service, to which the NodePort Service
routes, is automatically created. You'll be able to contact
the NodePort Service, from outside the cluster, by
w
requesting <NodeIP>:<NodePort>. (The entrpoint for node)
w
w
le
balancer. NodePort and ClusterIP S
ervices, to which the external load
balancer routes, are automatically
ip
created.
• Externalname: Maps the Service
to the contents of
.a
the externalName field
(e.g. foo.bar.example.com), by
returning a CNAME record with its
w
value. No proxying of any kind is
set up.
w
w
x.
le
1) Kubectl create deploy my-nginx –image=nginx –dry-run=client –o
yaml > mynginx.yaml
ip
2) Kubectl get pods
3) Kubectl get namespace
.a
4) Kubectl create ns mydev
5) Kubectl create –f pod.yaml
6)
w
Kubectl describe svc nginx
w
7) Kubectl exec -it pod1 bash
w
l
lo
1) What is the architecture of kubernetes
2) What does control manager, etcd, scheduler, API server do
x.
3) What is a manifest file and what are the components of it
4) What is node affinity, pod afiinity , taint toleration
5) What is node port, cluster ip
le
6) What is persitant volumes and why we use it
7) Describe what is pod and what is pod lifecycle
8) What are the components on master and worked node
ip
9) What is ingress controller
10) What are types of services in kuberntes
11) How one pod talks with other pod
.a
12) How the pod healthcheck is done(describe rediness, livesness)
13) How the monitoring is done(integration on Prometheus and grafana)
w
14) What is deamonset, replicaset, horizontal pod autoscaler
15) Write a manifest file of your own choice
16) What is namespace and why we use it
w
17) What are helm charts and uses
w