MENU

Fun & Interesting

Kubernetes For Beginners - Intro to Advanced. - Full Course

Video Not Working? Fix It Now

- **Section 1: Intro** - **Prerequisites ?** Yes, docker and docker-compose. Docker knowledge is a must; but docker-compose can really help. - **What is Kubernetes / K8S ?** - is a container orchestration tool. - Tools to **manage, scale, and maintain** containerized applications are called orchestrators. - **How is it different from docker & docker-compose ?** - Simple, docker-compose/docker is aimed for host deployment. Whereas, K8S is meant for multi-node; real world deployment. - K8S is an internally having master and worker nodes; Supports RBAC, DRA, HA, replicas, Load balancing. - Scaled Production settings vs Internal deployment. - **K8S architecture ?** All you need to know now is: 1. There is K8S server and K8S client. 2. K8S server spins up docker instances on demand and maintains state of all worker nodes. (Ensures everything is working as expected.) 3. K8S client is also called kubectl. Kubectl client allows us to interact with the K8S server/Cluster. That’s it. ![image.png](https://prod-files-secure.s3.us-west-2.amazonaws.com/8a441bc3-8617-427c-ae79-f06747942dca/0de427b5-bd24-4ed2-a571-013ad3f7d9ae/image.png) - **Additional fun facts to fill the page:** 1. Open sourced; 2. Maintained by Google. K [ubernetes] s = K8S. 3. Much, much better than docker-compose deployment. Even though there is an overhead !! - **Section 2: Installation** There are many implementations of K8S : The full blown K8S service: EKS, GKE, Azure Kube Services, K3S, K3D, RKE2, Kind, Minikube. - **Docker** https://docs.docker.com/engine/install/ - **K3D - K3S on docker - The server piece** https://k3d.io/v5.7.3/#installation - **Kubectl - The client piece** https://kubernetes.io/docs/tasks/tools/ - **Section 3: Pods** - **What are Pods ?** - Pods ~ Containers - But Pods can contain multiple containers. Generally, the additional sidecar/init container are used for logging and initialization. Eg: Fluentbit container with Service container for logging. - Conceptually, it is same and serves the same function. - **How to create one Pod ?** Here is an example of converting docker command to pods.yaml file docker run -p 80:80 nginx:latest - **Further reads** https://kubernetes.io/docs/concepts/workloads/pods/ kubectl get [resource] kubectl delete [resource] [resourcename] kubectl describe [resource] [resourcename] kubectl logs [resourcename] kubectl exec [resourcename] kubectl apply -f filename.yml - **End of Day 1; Next sesssion deployments (Auto-healing);** - Day 2 - **Deployments** - Provides mechanisms for auto-healing; state management. - Maintains replicaSets (It’s a type of resource) and maintains the expected state. - Deployment can contain multiple pods. - deployment.yaml. - Imp. config parameters. - **Service (svc) / Loadbalancer** SVC acts as load balancer to the deployments SVC is used to add network to the deployed pods. abstraction to help you expose groups of Pods over a network. - Service types Kubernetes offers three primary service types: - **ClusterIP - POD to POD - internal communication** - **NodePort - localhost access** LoadBalancer - Advanced - Entreprise grade - **ConfigMap** A ConfigMap is an API object used to store **non-confidential** data in key-value pairs. [Pods](https://kubernetes.io/docs/concepts/workloads/pods/) can consume ConfigMaps as environment variables. A ConfigMap allows you to decouple environment-specific configuration from your [container images](https://kubernetes.io/docs/reference/glossary/?all=true#term-image), so that your applications are easily portable - **Secrets** A Secret is an object that contains a small amount of sensitive data such as a password, a token, or a key. For storing passwords and other sensitive data, consider using the kubernetes.io/tls type for Secrets.

Comment