k8s Notes
k8s Notes
Installing Kubernetes
4.Openshift
2003 - Google -- Omega and Borg --- run their application by using light weight
container method
V1.18
V1.22
V1.23.1
V1.23.2
V1.
V1.22.1
V1.22.2
V1.22.3
-----------------------------------------------------------------------------------
----------------------------
Day -2 ,Kubernetes Architecture
Different Installation Method
Kubernetes commands
4. Native cloud
AWS - EKS (Elastic Kubernetes services)
Azure - AKS (Azure Kubernetes services)
Google - GKE (Google Kubernetes Engine)
5. Platform as service
Redhat -Openshift ( Docker and Kubernetes + Frontend GUI,Libraries )
6. katacode - 25 mins
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
export KUBECONFIG=/etc/kubernetes/admin.conf
Then you can join any number of worker nodes by running the following on each as
root:
FOr enabling the network ,there are many network addons available
Weave
Fannel
Crasito
-----------------------------------------------------------------------------------
------------------
Day-3 notes
kubeadm
Docker
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
export KUBECONFIG=/etc/kubernetes/admin.conf
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/
Then you can join any number of worker nodes by running the following on each as
root:
Run 'kubectl get nodes' on the control-plane to see this node join the cluster.
Day-4
Kubernetes Tokens
KUbernetes Objects
Introduction of pods
Namespaces
Kubernetes
V1.18.2---> V1.18.6
-----------------------------------
Day-5
Kubernetes Objects:
Kubernetes objects are persistent entities of your kubernetes system,entites is
nothing but it represent your state of the cluster
Every Kubernetes object has a specification (spec) and it has object status,
The specification is all about what we want and it is regarded as desired state and
the stauts is nothing
but the actual state of kubernetes
we specify object spec in the format of .yaml file (manifest file) and we the
status of the kubernets object after we apply the spec
Kubernetes API:
The core of the kubernetes control plane is the API server,this API -server exposes
http API's that lets
enduser and different parts of your cluster ,external componetns communicate each
others
kubernetes stors the serialized states of the objects by writing them to the etcd
database
To express the desired state ,we would be creating the specification of the
kubernetes resources
* pod
*container
*ephermel containers
* Replication Controllers
* Replica sets
* Deployments
* statefuset
* Daemon sets
* Job
* CronJob
* Horizontal pod Auto scaler
#### Kubectl
Kubectl is command line utlity for interacting and performing various operation on
Kubernetes
2.Declartive method
.yaml ,apply ,delete
The API Servers manages communication in kubernetes ( for the developer it look
like it a API gateway)
To achieve the communication,the API server implement RESTFULL API over http and
https to perform
CRUD operations to populate and modify k8s API objects (pods,service,deployments)
-----------------------------------------------------------------------------------
----------------------------
Kubernetes Day-6
Introduction of pod
Namespaces
Taint node
Label
-----------------------------------------------------------------------------------
Day -7
Namespaces
Taint
Labels
Namespaces-- Kubernetes supports multiple virtual cluster backed with the same
physical cluster ,this virtual cluster is called as namespace
Taints: node-role.kubernetes.io/master:NoSchedule
--------------------------------------------------
Day-8
Kubernetes Labels
Kubernetes ResourceQuota and LimitRange
/etc/kubernetes/manifests/kube-apiserver.yaml
---- PodNodeSelector
--enable-admission-plugins=NodeRestriction,PodNodeSelector
-------------------------------------------------------------------------
Day-9 (50%)
ResourceQuota ,LimitRange
Controllers
services -- cluserip,nodeport ,loadbalanceer - 5 sessions
wednesday - 10PM
1 trouble shooting ,
4 session - CKA
Limitrange - pods
Pod Controllers
Replication controller can only montior only 1 label as selector ,it cannot
monitoring multiple labels
It only monotor the Equality based Selector - only 1 label it can monitor
Replicaset will not support any rolling update of the application running inside
the pod
what is the difference between replication controller and deployment?
In Replication controller- there is downtime of the application ,where in
deployment there is no downtime
-----------------------------------------------------------------------------------
----------------------
Kubernetes Day - 11
root@master:~# vi rc.yml
apiVersion: v1
kind: ReplicationController
metadata:
name: mycloud
spec:
replicas: 3
selector:
team: dev
template:
metadata:
name: mycloud
labels:
team: dev
spec:
containers:
- name: mycloud
image: nginx:1.7.1
ports:
- containerPort: 80
root@master:~# vi web.yaml
apiVersion: v1
kind: Pod
metadata:
name: web-server
spec:
containers:
- name: web-server
image: nginx
-----------------------------------------------------------------------------------
-----------------------------
init container
Multi container pod
Kubernetes Volumes
Troubleshooting
AWS EKS
Kubernetes HELM,ISITIO,SERVICEMESH
-------------------------------------------------------------------------------
Kubernetes Day - 14 session
------------------------------------------------
Kubernetes Day - 15
1.Daemon set
2. scheduling Topologies
4.Static pods
8. Kubernetes Volumes
12.Troubleshooting
13.Intregration of Kubernetes with Jenkins
13. CKA
-----------------------------------------------------------------------------------
-------------
Kubernetes Day - 16
1.Kubernetes Volumes
export KUBECONFIG=/etc/kubernetes/admin.conf
Then you can join any number of worker nodes by running the following on each as
root:
-------------------------------------------------
Kubernetes Day - 17
Secrets stores the sensitive information like key/value pairs or it stores some
password or even you want encrpt the tls certificates or sometime
even you want encrypt files
mysql
value: redhat
Troubeshooting of Kubernetes
Terraform - only weekend i will take , in weekday - any day call u to continue with
left out topics of kubernetes
----------------------------------------------------------------------
Kubernetes Day-18
Probe is health check,that can be configured to check the health of the container
running in the pod.
A probe may return the following results
1.success
2.failure
3.unknown
Types of Probes:
1.Liveness Probe:
This probe is used to determine if the particular container is running or
not ,if a container fails the liveness probe,then controller
will try to restart the pod in the same node,it is all based on Restart Policy
-- , the default restart policy is Always
2.Readiness Probe:
This Probe is used to determine wheather a particular container is ready to
receieve the request or not ,if this fails then
kubernetes controller will ensure the pod doesn't recieve any request
2.HTTP Request probes: In this probe ,the conttoller will send GET Http request to
the given address to either port or hostname to perform the probe on the container,
we can set the follwoing fields to configure the http probe
* port number
*path
* hostname
*http header
* TCP socket probe
Restart Policy:
1.Always: Always restart the pod whenever it terminates
2.On Failure:
3.Never
rajeshsingh.com/home
rajeshsingh.com/inventories
Ubuntu
Redhat
Centos
Helm is basically used to manage all the manifest files or Yaml files - APplication
very easyily ..