k8s contd
Kube-proxy
- kube-proxy is responsible for cluster level networking, while CNI is responsible for low level networking on Pod, kube-proxy which is present on each node helps in Service level abstractions such as node-port, node to pod, pod to pod, pod to service connections.
- kube-proxy manages ipTables and makes routing possible.
k8s Deployments
- Refer Here for official docs
- strategy: Refer Here
- recreate
- rollingUpdates
Trail 1:
- Demonstrate deployment with some example
- Refer Here for the manifest
- Apply the manifest


- Lets review some additional commands

-
Now lets make some changes in the manifest Refer Here for changes
-
Now lets assume you didnt like the release and want to go back to previous version (revision=1)
Trail 2
- Write a deployment spec for jenkins with rolling updates
- surge: 40 %
- unavailable: 40%
- replicas = 10
- Refer Here for manifests
Probes in Pods
- Refer Here for offical docs
- K8s gives the following probes
- liveness probe: This determines whether the application in container is started correctly. If this check fails, k8s will try to restart the container according to restartPolicy.
- readiness probe: This determines whether the container is ready to serve requests. if this check fails, the service will not forward the requests to the pod
- startup probe: This is added for slow starting applications, till startup probe is completed, liveness probes will not be executed.
- Types of checks Refer Here
- exec
- grpc
- httpGet
- tcpSocket
- Lets write a Pod spec with basic checks
- liveness check postive and negative Refer Here

- liveness check postive and negative Refer Here
- Refer Here for the manifest with positive and negative readiness probes


Exercises
- Try to write a pod manifest for any application with web interface
- spring petclinic
- nop
- apache
- httpd
- tomcat
- Ensure your manifests always have
- resources
- probes
- ports
- Now try making a replicaset, deployment and expose using service.
