master a513f8790915 cached
369 files
1.4 MB
340.6k tokens
2 symbols
1 requests
Download .txt
Showing preview only (1,589K chars total). Download the full file or copy to clipboard to get everything.
Repository: kodekloudhub/certified-kubernetes-administrator-course
Branch: master
Commit: a513f8790915
Files: 369
Total size: 1.4 MB

Directory structure:
gitextract_rwswyqhk/

├── .gitignore
├── README.md
├── apple-silicon/
│   └── README.md
├── docs/
│   ├── 01-Introduction/
│   │   ├── 01-Course-Introduction.md
│   │   └── 02-Certification.md
│   ├── 02-Core-Concepts/
│   │   ├── 01-Core-Concepts-Section-Introduction.md
│   │   ├── 02-Cluster-Architecture.md
│   │   ├── 03-Docker-vs-ContainerD.md
│   │   ├── 04-ETCD-For-Beginners.md
│   │   ├── 05-ETCD-in-Kubernetes.md
│   │   ├── 06-Kube-API-Server.md
│   │   ├── 07-Kube-Controller-Manager.md
│   │   ├── 08-Kube-Scheduler.md
│   │   ├── 09-Kubelet.md
│   │   ├── 10-Kube-Proxy.md
│   │   ├── 11-Pods.md
│   │   ├── 12-Practice-Test-Introduction.md
│   │   ├── 13-Practice-Test-PODs.md
│   │   ├── 14-ReplicaSets.md
│   │   ├── 15-Practice-Tests-ReplicaSet.md
│   │   ├── 16-Deployments.md
│   │   ├── 17-Practice-Tests-Deployments.md
│   │   ├── 18-Namespaces.md
│   │   ├── 19-Practice-Test-Namespaces.md
│   │   ├── 20-Services.md
│   │   ├── 21-Services-ClusterIP.md
│   │   ├── 22-Practice-Test-Services.md
│   │   ├── 23-Imperative-Commands-with-kubectl.md
│   │   ├── 24-Practice-Test-Imperative-Commands.md
│   │   └── 25-Attachments.md
│   ├── 03-Scheduling/
│   │   ├── 01-Scheduling-Section-Introduction.md
│   │   ├── 02-Manual-Scheduling.md
│   │   ├── 03-Practice-Test-Manual-Scheduling.md
│   │   ├── 04-Labels-and-Selectors.md
│   │   ├── 05-Practice-Test-Labels-and-Selectors.md
│   │   ├── 06-Taints-and-Tolerations.md
│   │   ├── 07-Practice-Test-Taints-and-Tolerations.md
│   │   ├── 08-Node-Selectors.md
│   │   ├── 09-Node-Affinity.md
│   │   ├── 10-Practice-Test-Node-Affinity.md
│   │   ├── 11.Taints-and-Tolerations-vs-Node-Affinity.md
│   │   ├── 12-Resource-Limits.md
│   │   ├── 13-Practice-Test-Resource-Limits.md
│   │   ├── 14-DaemonSets.md
│   │   ├── 15-Practice-Test-DaemonSets.md
│   │   ├── 16-Static-Pods.md
│   │   ├── 17-Practice-Test-StaticPods.md
│   │   ├── 18-Multiple-Schedulers.md
│   │   ├── 19-Practice-Test-Multiple-Schedulers.md
│   │   ├── 20-Configuring-Kubernetes-Schedulers.md
│   │   └── 21-Download-Presentation-Deck.md
│   ├── 04-Logging-and-Monitoring/
│   │   ├── 01-Logging-and-Monitoring-Section-Introduction.md
│   │   ├── 02-Monitor-Cluster-Components.md
│   │   ├── 03-Practice-Test-Monitor-Cluster-Components.md
│   │   ├── 04-Managing-Application-Logs.md
│   │   ├── 05-Download-Presentation-Deck.md
│   │   └── 06-Practice-Test-Managing-Application-Logs.md
│   ├── 05-Application-Lifecycle-Management/
│   │   ├── 01-Application-Lifecycle-Management--Section-Introduction.md
│   │   ├── 02-RollingUpdates-and-Rollback.md
│   │   ├── 03-Practice-Test-RollingUpdates-Rollback.md
│   │   ├── 04-Commands-and-Arguments-in-Docker.md
│   │   ├── 05-Commands-and-Arguments-in-Kubernetes.md
│   │   ├── 06-Practice-Test-Commands-and-Arguments.md
│   │   ├── 07.Configure-Environment-Variables-in-Applications.md
│   │   ├── 08-Configure-ConfigMaps-in-Applications.md
│   │   ├── 09-Practice-Test-Env-Variables.md
│   │   ├── 10.Secrets.md
│   │   ├── 11.Practice-Test-Secrets.md
│   │   ├── 12.Multi-Containers-PODs.md
│   │   ├── 13-Practice-Test-Multi-Container-Pods.md
│   │   ├── 14-Multi-Container-Pods-Design-Patterns.md
│   │   ├── 15.Init-Containers.md
│   │   ├── 16-Practice-Test-Init-Containers.md
│   │   ├── 17.Self-Healing-Applications.md
│   │   └── 18.Download-Presentation-Deck.md
│   ├── 06-Cluster-Maintenance/
│   │   ├── 01-Cluster-Maintenance-Section-Introduction.md
│   │   ├── 02-OS-Upgrades.md
│   │   ├── 03-Practice-Test-OS-Upgrades.md
│   │   ├── 04-Kubernetes-Software-Versions.md
│   │   ├── 05-Cluster-Upgrade-Introduction.md
│   │   ├── 06-Practice-Test-Cluster-Upgrade-Process.md
│   │   ├── 07-Backup-and-Restore-Methods.md
│   │   ├── 08-Working-With-ETCDCTL.md
│   │   ├── 09-Practice-Test-Backup-and-Restore-Methods.md
│   │   ├── 10-Practice-Test-Backup-and-Restore-Methods-2.md
│   │   └── 11-Download-Presentation-Deck.md
│   ├── 07-Security/
│   │   ├── 01-Security-Section-Introduction.md
│   │   ├── 02-Kubernetes-Security-Primitives.md
│   │   ├── 03-Authentication.md
│   │   ├── 04-TLS-Certificates.md
│   │   ├── 05-TLS-Basics.md
│   │   ├── 06-TLS-in-Kubernetes.md
│   │   ├── 07-TLS-in-Kubernetes-Certificate-Creation.md
│   │   ├── 08-View-Certificate-Details.md
│   │   ├── 09-Certificate-Health-Check-Spreadsheet.md
│   │   ├── 10-Practice-Test-View-Certificate-Details.md
│   │   ├── 11-Certificate-API.md
│   │   ├── 12-Practice-Test-Certificates-API.md
│   │   ├── 13-kubeconfig.md
│   │   ├── 14-Practice-Test-KubeConfig.md
│   │   ├── 15-API-Groups.md
│   │   ├── 16-Authorization.md
│   │   ├── 17-RBAC.md
│   │   ├── 18-Practice-Test-RBAC.md
│   │   ├── 19-Cluster-Roles.md
│   │   ├── 20-Practice-Test-Cluster-Roles.md
│   │   ├── 21-Service-Account.md
│   │   ├── 22-Practice-Test-Service-Accounts.md
│   │   ├── 23-Image-Security.md
│   │   ├── 24-Practice-Test-Image-Security.md
│   │   ├── 25-Security-Context.md
│   │   ├── 26-Practice-Test-Security-Context.md
│   │   ├── 27-Network-Policies.md
│   │   ├── 28-Practice-Test-Network-Policies.md
│   │   ├── 29-kubectx-and-kubens-commands.md
│   │   └── 30-Download-Presentation-Deck.md
│   ├── 08-Storage/
│   │   ├── 01-Storage-Section-Introduction.md
│   │   ├── 02-Introduction-to-Docker-Storage.md
│   │   ├── 03-Storage-in-Docker.md
│   │   ├── 04-Volume-Driver-Plugins-in-Docker.md
│   │   ├── 05-Container.Storage-Interface.md
│   │   ├── 06-Volumes.md
│   │   ├── 07-Persistent-Volumes.md
│   │   ├── 08-Persistent-Volume-Claims.md
│   │   ├── 09-Using-PVC-in-PODs.md
│   │   ├── 10-Practice-Test-Persistent-Volume-Claims.md
│   │   ├── 11-Download-Presentation-Deck.md
│   │   ├── 12-Storage-Class.md
│   │   └── 13-Practice-Test-Storage-Class.md
│   ├── 09-Networking/
│   │   ├── 01-Networking-Introduction.md
│   │   ├── 02-Pre-requisite-Switching-Routing-Gateways.md
│   │   ├── 03-Pre-requisite-DNS.md
│   │   ├── 04-Pre-requisite-CoreDNS.md
│   │   ├── 05-Pre-requisite-Network-Namespace.md
│   │   ├── 06-Pre-requisite-Docker-Networking.md
│   │   ├── 07-Pre-requisite-CNI.md
│   │   ├── 08-Cluster-Networking.md
│   │   ├── 09-Practice-Test-Explore-Env.md
│   │   ├── 10-Pod-Networking.md
│   │   ├── 11-CNI-in-Kubernetes.md
│   │   ├── 12-CNI-weave.md
│   │   ├── 13-Practice-Test-CNI-weave.md
│   │   ├── 14-Practice-Test-Deploy-Network-Solution.md
│   │   ├── 15-ipam-weave.md
│   │   ├── 16-Practice-Test-Networking-weave.md
│   │   ├── 17-Service-Networking.md
│   │   ├── 18-Practice-Test-Service-Networking.md
│   │   ├── 19-DNS-in-kubernetes.md
│   │   ├── 20-CoreDNS-in-Kubernetes.md
│   │   ├── 21-Practice-Test-CoreDNS-in-Kubernetes.md
│   │   ├── 22-Ingress.md
│   │   ├── 23-Ingress-Annotations-and-rewrite-target.md
│   │   ├── 24-Practice-Test-CKA-Ingress-Net-1.md
│   │   ├── 25-Practice-Test-CKA-Ingress-Net-2.md
│   │   └── 26-Dowload-Presentation-Deck.md
│   ├── 10-Design-and-Install-Kubernetes-Cluster/
│   │   ├── 01-Designing-a-Kubernetes-Cluster.md
│   │   ├── 02-Choosing-Kubernetes-Infrastructure.md
│   │   ├── 03-Configure-High-Availability.md
│   │   ├── 04-ETCD-in-HA.md
│   │   ├── 05-Important-update-kubernetes-the-hard-way.md
│   │   └── 06-Download-Presentation-Deck.md
│   ├── 11-Install-Kubernetes-the-kubeadm-way/
│   │   ├── 01-Introduction-to-Deployment-with-kubeadm.md
│   │   ├── 02-Resources.md
│   │   ├── 03-Provision-VMs-with-Vagrant.md
│   │   ├── 04-Demo-Deployment-with-Kubeadm.md
│   │   └── 05-Practice-Test-Deploy-Kubernetes-Cluster-using-Kubeadm.md
│   ├── 12-Troubleshooting/
│   │   ├── 01-Troubelshooting-Section-Introduction.md
│   │   ├── 02-Application-Failure.md
│   │   ├── 03-Solution-Application-Failure.md
│   │   ├── 04-Control-Plane-Failure.md
│   │   ├── 05-Practice-Test-Control-Plane-Failure.md
│   │   ├── 06-Solution-Control-Plane-Failure.md
│   │   ├── 07-Worker-Node-Failure.md
│   │   ├── 08-Practice-Test-Worker-Node-Failure.md
│   │   ├── 09-Solution-Worker-Node-Failure.md
│   │   └── 10-Practice-Test-Troubleshoot-Network.md
│   ├── 13-Other-Topics/
│   │   ├── 01-Labs-JSON-PATH.md
│   │   ├── 02-Pre-Requisites-JSON-PATH.md
│   │   ├── 03-Advance-Kubectl-Commands.md
│   │   └── 04-Practice-Test-Advance-Kubectl-Commands.md
│   ├── 14-Lightning-Labs/
│   │   ├── 01-Lightning-Labs-Introduction.md
│   │   └── 02-Lightning-Lab-1.md
│   ├── 15-Mock-Exams/
│   │   ├── 01-Introduction.md
│   │   ├── 02-Mock-Exam-1.md
│   │   ├── 03-Mock-Exam-2.md
│   │   ├── 04-CKA-MockExam-2-Solution.md
│   │   ├── 05-Mock-Exam-3.md
│   │   └── 06-CKA-MockExam-3-Solution.md
│   ├── 16-Ultimate-Mocks/
│   │   ├── 02-Troubleshooting/
│   │   │   ├── README.md
│   │   │   └── docs/
│   │   │       ├── 11-C1-orange-pvc-cka13-trb.md
│   │   │       └── 19-C1-netpol-cyan-pod-cka28-trb.md
│   │   ├── 04-Storage/
│   │   │   ├── README.md
│   │   │   └── docs/
│   │   │       └── 10-CI-olive-pvc-cka10-str.md
│   │   ├── 05-Services-Networking/
│   │   │   ├── README.md
│   │   │   └── docs/
│   │   │       └── 03-C3-External-Webserver.md
│   │   ├── 09-general/
│   │   │   ├── README.md
│   │   │   └── docs/
│   │   │       └── 01-cluster-state-questions.md
│   │   └── README.md
│   └── 17-tips-and-tricks/
│       ├── README.md
│       └── docs/
│           ├── 01-server-for-testing-network-policies.md
│           └── 02-client--for-testing-network-things.md
├── images/
│   └── Readme.md
├── kubeadm-clusters/
│   ├── README.md
│   ├── apple-silicon/
│   │   ├── README.md
│   │   ├── delete-virtual-machines.sh
│   │   ├── deploy-virtual-machines.sh
│   │   ├── docs/
│   │   │   ├── 01-prerequisites.md
│   │   │   ├── 02-compute-resources.md
│   │   │   └── 03-connectivity.md
│   │   └── scripts/
│   │       ├── 01-setup-hosts.sh
│   │       ├── 02-setup-kernel.sh
│   │       ├── 03-setup-nodes.sh
│   │       ├── 04-kube-components.sh
│   │       ├── 05-deploy-controlplane.sh
│   │       ├── 06-deploy-workers.sh
│   │       └── tmux.conf
│   ├── aws/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── docs/
│   │   │   ├── 01-prerequisites.md
│   │   │   ├── 02-compute-resources.md
│   │   │   └── 03-connectivity.md
│   │   ├── kubeadm-aws.drawio
│   │   └── terraform/
│   │       ├── controlplane.sh
│   │       ├── data.tf
│   │       ├── ec2.tf
│   │       ├── main.tf
│   │       ├── security_groups.tf
│   │       └── variables.tf
│   ├── aws-ha/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── docs/
│   │   │   ├── 01-prerequisites.md
│   │   │   ├── 02-compute-resources.md
│   │   │   ├── 03-connectivity.md
│   │   │   ├── 04-loadbalancer.md
│   │   │   ├── 05-node-setup.md
│   │   │   ├── 06-controlplane.md
│   │   │   ├── 07-workers.md
│   │   │   └── 08-test.md
│   │   ├── kubeadm-aws-ha.drawio
│   │   └── terraform/
│   │       ├── controlplane.sh
│   │       ├── data.tf
│   │       ├── ec2.tf
│   │       ├── lb.sh
│   │       ├── main.tf
│   │       ├── security_groups.tf
│   │       └── variables.tf
│   ├── generic/
│   │   ├── 04-node-setup.md
│   │   ├── 05-controlplane.md
│   │   ├── 06-workers.md
│   │   ├── 07-test.md
│   │   └── README.md
│   └── virtualbox/
│       ├── .gitignore
│       ├── README.md
│       ├── Vagrantfile
│       ├── docs/
│       │   ├── 01-prerequisites.md
│       │   ├── 02-compute-resources.md
│       │   └── 03-connectivity.md
│       ├── mac/
│       │   └── mac-bridge.sh
│       ├── tools/
│       │   └── lab-script-generator.py
│       └── ubuntu/
│           ├── cert_verify.sh
│           ├── setup-kernel.sh
│           ├── ssh.sh
│           ├── tmux.conf
│           ├── update-dns.sh
│           ├── vagrant/
│           │   ├── controlplane.sh
│           │   ├── install-guest-additions.sh
│           │   ├── node-setup.sh
│           │   └── setup-hosts.sh
│           └── vimrc
├── managed-clusters/
│   ├── README.md
│   ├── aks/
│   │   ├── console/
│   │   │   ├── README.md
│   │   │   └── docs/
│   │   │       ├── 01-sign-in.md
│   │   │       ├── 02-create-service.md
│   │   │       ├── 03-create-cluster.md
│   │   │       ├── 04-creation-form.md
│   │   │       ├── 05-node-pools.md
│   │   │       ├── 06-networking.md
│   │   │       ├── 07-monitoring.md
│   │   │       ├── 08-review-and-create.md
│   │   │       └── 09-connect.md
│   │   ├── terraform/
│   │   │   ├── README.md
│   │   │   ├── docs/
│   │   │   │   ├── 01-sign-in.md
│   │   │   │   ├── 02-cloudshell.md
│   │   │   │   ├── 03-install-terraform.md
│   │   │   │   └── 04-deploy-cluster.md
│   │   │   ├── environment.sh
│   │   │   └── main.tf
│   │   └── terraform_local/
│   │       ├── README.md
│   │       ├── docs/
│   │       │   ├── 01-sign-in.md
│   │       │   ├── 02-install-softwares.md
│   │       │   ├── 03-setting-variable.md
│   │       │   └── 04-deploy-cluster.md
│   │       ├── environment.ps1
│   │       ├── environment.sh
│   │       └── main.tf
│   ├── eks/
│   │   └── console/
│   │       ├── README.md
│   │       └── docs/
│   │           ├── 01-sign-in.md
│   │           ├── 02-create-service-role.md
│   │           ├── 03-configure-cluster.md
│   │           ├── 04-networking.md
│   │           ├── 05-create-cluster.md
│   │           ├── 06-nodes.md
│   │           ├── 07-join-nodes.md
│   │           └── 08-node-port.md
│   └── gke/
│       ├── console/
│       │   ├── README.md
│       │   └── docs/
│       │       ├── 01-sign-in.md
│       │       ├── 02-create-cluster.md
│       │       ├── 03-node-setup.md
│       │       └── 04-connect.md
│       └── terraform/
│           ├── README.md
│           ├── docs/
│           │   ├── 01-sign-in.md
│           │   ├── 02-install-terraform.md
│           │   └── 03-deploy-cluster.md
│           └── main.tf
├── metrics-staging-scripts/
│   ├── high_cpu_node.sh
│   ├── high_cpu_pod.sh
│   ├── high_cpu_pod_1.yaml
│   ├── high_memory_node.sh
│   ├── high_memory_pod.sh
│   └── high_memory_pod.yaml
└── resources/
    ├── app-wl03.yaml
    ├── beta-logger.yaml
    ├── beta-namespace.yaml
    ├── calico/
    │   └── calico.yaml
    ├── custom-cni/
    │   ├── canal.yaml
    │   └── flannel.yaml
    ├── elastic-app-cka02-arch.yaml
    ├── essports-wl02.yaml
    ├── frontend-wl04.yaml
    ├── high_cpu_node.sh
    ├── high_cpu_pod.sh
    ├── high_cpu_pod.yaml
    ├── high_cpu_pod_1.yaml
    ├── high_memory_node.sh
    ├── high_memory_pod.sh
    ├── high_memory_pod.yaml
    ├── high_memory_pod_1.yaml
    ├── nginx-wl06.yaml
    ├── ns10-apd.yaml
    ├── staging-scripts/
    │   ├── alpha-ns-apd-13.yaml
    │   ├── check-connection.sh
    │   ├── circle-apd15.yaml
    │   ├── create_user_certs.sh
    │   ├── deploy.yaml
    │   ├── foundary-apd6.yaml
    │   ├── get-highest-pod.sh
    │   ├── ingress-application-ckad.yaml
    │   ├── ingress-controller-ckad.yaml
    │   ├── ingress-resource-ckad.yaml
    │   ├── ingress-staging-cka04-svcn.sh
    │   ├── install-webserver-cka03-svcn.sh
    │   ├── news-apd.yaml
    │   ├── results-apd.yaml
    │   ├── svc03-install-webserver.sh
    │   ├── svn-01.yaml
    │   ├── svn-template-01.yaml
    │   ├── test-v-apd14.yaml
    │   ├── update-ns-kubelet-cka01-svcn.sh
    │   ├── webapp-apd05.yaml
    │   └── webapp-wear.yaml
    ├── statging-cka16-trb-1.yaml
    ├── statging-cka16-trb-2.yaml
    ├── stating-cluster2-cka26.yaml
    ├── trace-wl08.yaml
    ├── weave/
    │   └── weave-daemonset-k8s.yaml
    ├── webapp-color-wl10.yaml
    ├── webapp-pod-wl05.yaml
    ├── webapp-wear-cka09-svcn.yaml
    └── webapp-wl07.yaml

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
.vscode/
.infracost/
.vagrant/
.DS_Store


================================================
FILE: README.md
================================================
# Certified Kubernetes Administrator (CKA) Course

These are notes from the [Certified Kubernetes Administrator Course](https://kodekloud.com/courses/certified-kubernetes-administrator-cka/) hosted on KodeKloud.

# Sections

- [01-Introduction](docs/01-Introduction)

  - [01-Course-Introduction](docs/01-Introduction/01-Course-Introduction.md)
  - [02-Certification](docs/01-Introduction/02-Certification.md)


- [02-Core-Concepts](docs/02-Core-Concepts)

  - [01-Core-Concepts-Section-Introduction](docs/02-Core-Concepts/01-Core-Concepts-Section-Introduction.md)
  - [02-Cluster-Architecture](docs/02-Core-Concepts/02-Cluster-Architecture.md)
  - [03-Docker-vs-ContainerD](docs/02-Core-Concepts/03-Docker-vs-ContainerD.md)
  - [04-ETCD-For-Beginners](docs/02-Core-Concepts/04-ETCD-For-Beginners.md)
  - [05-ETCD-in-Kubernetes](docs/02-Core-Concepts/05-ETCD-in-Kubernetes.md)
  - [06-Kube-API-Server](docs/02-Core-Concepts/06-Kube-API-Server.md)
  - [07-Kube-Controller-Manager](docs/02-Core-Concepts/07-Kube-Controller-Manager.md)
  - [08-Kube-Scheduler](docs/02-Core-Concepts/08-Kube-Scheduler.md)
  - [09-Kubelet](docs/02-Core-Concepts/09-Kubelet.md)
  - [10-Kube-Proxy](docs/02-Core-Concepts/10-Kube-Proxy.md)
  - [11-Pods](docs/02-Core-Concepts/11-Pods.md)
  - [12-Practice-Test-Introduction](docs/02-Core-Concepts/12-Practice-Test-Introduction.md)
  - [13-Practice-Test-PODs](docs/02-Core-Concepts/13-Practice-Test-PODs.md)
  - [14-ReplicaSets](docs/02-Core-Concepts/14-ReplicaSets.md)
  - [15-Practice-Tests-ReplicaSet](docs/02-Core-Concepts/15-Practice-Tests-ReplicaSet.md)
  - [16-Deployments](docs/02-Core-Concepts/16-Deployments.md)
  - [17-Practice-Tests-Deployments](docs/02-Core-Concepts/17-Practice-Tests-Deployments.md)
  - [18-Namespaces](docs/02-Core-Concepts/18-Namespaces.md)
  - [19-Practice-Test-Namespaces](docs/02-Core-Concepts/19-Practice-Test-Namespaces.md)
  - [20-Services](docs/02-Core-Concepts/20-Services.md)
  - [21-Services-ClusterIP](docs/02-Core-Concepts/21-Services-ClusterIP.md)
  - [22-Practice-Test-Services](docs/02-Core-Concepts/22-Practice-Test-Services.md)
  - [23-Imperative-Commands-with-kubectl](docs/02-Core-Concepts/23-Imperative-Commands-with-kubectl.md)
  - [24-Practice-Test-Imperative-Commands](docs/02-Core-Concepts/24-Practice-Test-Imperative-Commands.md)
  - [25-Attachments](docs/02-Core-Concepts/25-Attachments.md)

- [03-Scheduling](docs/03-Scheduling)

  - [01-Scheduling-Section-Introduction](docs/03-Scheduling/01-Scheduling-Section-Introduction.md)
  - [02-Manual-Scheduling](docs/03-Scheduling/02-Manual-Scheduling.md)
  - [03-Practice-Test-Manual-Scheduling](docs/03-Scheduling/03-Practice-Test-Manual-Scheduling.md)
  - [04-Labels-and-Selectors](docs/03-Scheduling/04-Labels-and-Selectors.md)
  - [05-Practice-Test-Labels-and-Selectors](docs/03-Scheduling/05-Practice-Test-Labels-and-Selectors.md)
  - [06-Taints-and-Tolerations](docs/03-Scheduling/06-Taints-and-Tolerations.md)
  - [07-Practice-Test-Taints-and-Tolerations](docs/03-Scheduling/07-Practice-Test-Taints-and-Tolerations.md)
  - [08-Node-Selectors](docs/03-Scheduling/08-Node-Selectors.md)
  - [09-Node-Affinity](docs/03-Scheduling/09-Node-Affinity.md)
  - [10-Practice-Test-Node-Affinity](docs/03-Scheduling/10-Practice-Test-Node-Affinity.md)
  - [11.Taints-and-Tolerations-vs-Node-Affinity](docs/03-Scheduling/11.Taints-and-Tolerations-vs-Node-Affinity.md)
  - [12-Resource-Limits](docs/03-Scheduling/12-Resource-Limits.md)
  - [13-Practice-Test-Resource-Limits](docs/03-Scheduling/13-Practice-Test-Resource-Limits.md)
  - [14-DaemonSets](docs/03-Scheduling/14-DaemonSets.md)
  - [15-Practice-Test-DaemonSets](docs/03-Scheduling/15-Practice-Test-DaemonSets.md)
  - [16-Static-Pods](docs/03-Scheduling/16-Static-Pods.md)
  - [17-Practice-Test-StaticPods](docs/03-Scheduling/17-Practice-Test-StaticPods.md)
  - [18-Multiple-Schedulers](docs/03-Scheduling/18-Multiple-Schedulers.md)
  - [19-Practice-Test-Multiple-Schedulers](docs/03-Scheduling/19-Practice-Test-Multiple-Schedulers.md)
  - [20-Configuring-Kubernetes-Schedulers](docs/03-Scheduling/20-Configuring-Kubernetes-Schedulers.md)
  - [21-Download-Presentation-Deck](docs/03-Scheduling/21-Download-Presentation-Deck.md)


- [04-Logging-and-Monitoring](docs/04-Logging-and-Monitoring)

  - [01-Logging-and-Monitoring-Section-Introduction](docs/04-Logging-and-Monitoring/01-Logging-and-Monitoring-Section-Introduction.md)
  - [02-Monitor-Cluster-Components](docs/04-Logging-and-Monitoring/02-Monitor-Cluster-Components.md)
  - [03-Practice-Test-Monitor-Cluster-Components](docs/04-Logging-and-Monitoring/03-Practice-Test-Monitor-Cluster-Components.md)
  - [04-Managing-Application-Logs](docs/04-Logging-and-Monitoring/04-Managing-Application-Logs.md)
  - [05-Download-Presentation-Deck](docs/04-Logging-and-Monitoring/05-Download-Presentation-Deck.md)
  - [06-Practice-Test-Managing-Application-Logs](docs/04-Logging-and-Monitoring/06-Practice-Test-Managing-Application-Logs.md)


- [05-Application-Lifecycle-Management](docs/05-Application-Lifecycle-Management)

  - [01-Application-Lifecycle-Management--Section-Introduction](docs/05-Application-Lifecycle-Management/01-Application-Lifecycle-Management--Section-Introduction.md)
  - [02-RollingUpdates-and-Rollback](docs/05-Application-Lifecycle-Management/02-RollingUpdates-and-Rollback.md)
  - [03-Practice-Test-RollingUpdates-Rollback](docs/05-Application-Lifecycle-Management/03-Practice-Test-RollingUpdates-Rollback.md)
  - [04-Commands-and-Arguments-in-Docker](docs/05-Application-Lifecycle-Management/04-Commands-and-Arguments-in-Docker.md)
  - [05-Commands-and-Arguments-in-Kubernetes](docs/05-Application-Lifecycle-Management/05-Commands-and-Arguments-in-Kubernetes.md)
  - [06-Practice-Test-Commands-and-Arguments](docs/05-Application-Lifecycle-Management/06-Practice-Test-Commands-and-Arguments.md)
  - [07.Configure-Environment-Variables-in-Applications](docs/05-Application-Lifecycle-Management/07.Configure-Environment-Variables-in-Applications.md)
  - [08-Configure-ConfigMaps-in-Applications](docs/05-Application-Lifecycle-Management/08-Configure-ConfigMaps-in-Applications.md)
  - [09-Practice-Test-Env-Variables](docs/05-Application-Lifecycle-Management/09-Practice-Test-Env-Variables.md)
  - [10.Secrets](docs/05-Application-Lifecycle-Management/10.Secrets.md)
  - [11.Practice-Test-Secrets](docs/05-Application-Lifecycle-Management/11.Practice-Test-Secrets.md)
  - [12.Multi-Containers-PODs](docs/05-Application-Lifecycle-Management/12.Multi-Containers-PODs.md)
  - [13-Practice-Test-Multi-Container-Pods](docs/05-Application-Lifecycle-Management/13-Practice-Test-Multi-Container-Pods.md)
  - [14-Multi-Container-Pods-Design-Patterns](docs/05-Application-Lifecycle-Management/14-Multi-Container-Pods-Design-Patterns.md)
  - [15.Init-Containers](docs/05-Application-Lifecycle-Management/15.Init-Containers.md)
  - [16-Practice-Test-Init-Containers](docs/05-Application-Lifecycle-Management/16-Practice-Test-Init-Containers.md)
  - [17.Self-Healing-Applications](docs/05-Application-Lifecycle-Management/17.Self-Healing-Applications.md)
  - [18.Download-Presentation-Deck](docs/05-Application-Lifecycle-Management/18.Download-Presentation-Deck.md)


- [06-Cluster-Maintenance](docs/06-Cluster-Maintenance)

  - [01-Cluster-Maintenance-Section-Introduction](docs/06-Cluster-Maintenance/01-Cluster-Maintenance-Section-Introduction.md)
  - [02-OS-Upgrades](docs/06-Cluster-Maintenance/02-OS-Upgrades.md)
  - [03-Practice-Test-OS-Upgrades](docs/06-Cluster-Maintenance/03-Practice-Test-OS-Upgrades.md)
  - [04-Kubernetes-Software-Versions](docs/06-Cluster-Maintenance/04-Kubernetes-Software-Versions.md)
  - [05-Cluster-Upgrade-Introduction](docs/06-Cluster-Maintenance/05-Cluster-Upgrade-Introduction.md)
  - [06-Practice-Test-Cluster-Upgrade-Process](docs/06-Cluster-Maintenance/06-Practice-Test-Cluster-Upgrade-Process.md)
  - [07-Backup-and-Restore-Methods](docs/06-Cluster-Maintenance/07-Backup-and-Restore-Methods.md)
  - [08-Working-With-ETCDCTL](docs/06-Cluster-Maintenance/08-Working-With-ETCDCTL.md)
  - [09-Practice-Test-Backup-and-Restore-Methods](docs/06-Cluster-Maintenance/09-Practice-Test-Backup-and-Restore-Methods.md)
  - [10-Practice-Test-Backup-and-Restore-Methods 2](docs/06-Cluster-Maintenance/10-Practice-Test-Backup-and-Restore-Methods-2.md)
  - [11-Download-Presentation-Deck](docs/06-Cluster-Maintenance/11-Download-Presentation-Deck.md)


- [07-Security](docs/07-Security)

  - [01-Security-Section-Introduction](docs/07-Security/01-Security-Section-Introduction.md)
  - [02-Kubernetes-Security-Primitives](docs/07-Security/02-Kubernetes-Security-Primitives.md)
  - [03-Authentication](docs/07-Security/03-Authentication.md)
  - [04-TLS-Certificates](docs/07-Security/04-TLS-Certificates.md)
  - [05-TLS-Basics](docs/07-Security/05-TLS-Basics.md)
  - [06-TLS-in-Kubernetes](docs/07-Security/06-TLS-in-Kubernetes.md)
  - [07-TLS-in-Kubernetes-Certificate-Creation](docs/07-Security/07-TLS-in-Kubernetes-Certificate-Creation.md)
  - [08-View-Certificate-Details](docs/07-Security/08-View-Certificate-Details.md)
  - [09-Certificate-Health-Check-Spreadsheet](docs/07-Security/09-Certificate-Health-Check-Spreadsheet.md)
  - [10-Practice-Test-View-Certificate-Details](docs/07-Security/10-Practice-Test-View-Certificate-Details.md)
  - [11-Certificate-API](docs/07-Security/11-Certificate-API.md)
  - [12-Practice-Test-Certificates-API](docs/07-Security/12-Practice-Test-Certificates-API.md)
  - [13-kubeconfig](docs/07-Security/13-kubeconfig.md)
  - [14-Practice-Test-KubeConfig](docs/07-Security/14-Practice-Test-KubeConfig.md)
  - [15-API-Groups](docs/07-Security/15-API-Groups.md)
  - [16-Authorization](docs/07-Security/16-Authorization.md)
  - [17-RBAC](docs/07-Security/17-RBAC.md)
  - [18-Practice-Test-RBAC](docs/07-Security/18-Practice-Test-RBAC.md)
  - [19-Cluster-Roles](docs/07-Security/19-Cluster-Roles.md)
  - [20-Practice-Test-Cluster-Roles](docs/07-Security/20-Practice-Test-Cluster-Roles.md)
  - [23-Image-Security](docs/07-Security/23-Image-Security.md)
  - [24-Practice-Test-Image-Security](docs/07-Security/24-Practice-Test-Image-Security.md)
  - [25-Security-Context](docs/07-Security/25-Security-Context.md)
  - [26-Practice-Test-Security-Context](docs/07-Security/26-Practice-Test-Security-Context.md)
  - [27-Network-Policies](docs/07-Security/27-Network-Policies.md)
  - [28-Practice-Test-Network-Policies](docs/07-Security/28-Practice-Test-Network-Policies.md)
  - [29-kubectx-and-kubens-commands](docs/07-Security/29-kubectx-and-kubens-commands.md)
  - [30-Download-Presentation-Deck](docs/07-Security/30-Download-Presentation-Deck.md)


- [08-Storage](docs/08-Storage)

  - [01-Storage-Section-Introduction](docs/08-Storage/01-Storage-Section-Introduction.md)
  - [02-Introduction-to-Docker-Storage](docs/08-Storage/02-Introduction-to-Docker-Storage.md)
  - [03-Storage-in-Docker](docs/08-Storage/03-Storage-in-Docker.md)
  - [04-Volume-Driver-Plugins-in-Docker](docs/08-Storage/04-Volume-Driver-Plugins-in-Docker.md)
  - [05-Container.Storage-Interface](docs/08-Storage/05-Container.Storage-Interface.md)
  - [06-Volumes](docs/08-Storage/06-Volumes.md)
  - [07-Persistent-Volumes](docs/08-Storage/07-Persistent-Volumes.md)
  - [08-Persistent-Volume-Claims](docs/08-Storage/08-Persistent-Volume-Claims.md)
  - [09-Using-PVC-in-PODs](docs/08-Storage/09-Using-PVC-in-PODs.md)
  - [10-Practice-Test-Persistent-Volume-Claims](docs/08-Storage/10-Practice-Test-Persistent-Volume-Claims.md)
  - [11-Download-Presentation-Deck](docs/08-Storage/11-Download-Presentation-Deck.md)
  - [12-Storage-Class](docs/08-Storage/12-Storage-Class.md)
  - [13-Practice-Test-Storage-Class](docs/08-Storage/13-Practice-Test-Storage-Class.md)


- [09-Networking](docs/09-Networking)

  - [01-Networking-Introduction](docs/09-Networking/01-Networking-Introduction.md)
  - [02-Pre-requisite-Switching-Routing-Gateways](docs/09-Networking/02-Pre-requisite-Switching-Routing-Gateways.md)
  - [03-Pre-requisite-DNS](docs/09-Networking/03-Pre-requisite-DNS.md)
  - [04-Pre-requisite-CoreDNS](docs/09-Networking/04-Pre-requisite-CoreDNS.md)
  - [05-Pre-requisite-Network-Namespace](docs/09-Networking/05-Pre-requisite-Network-Namespace.md)
  - [06-Pre-requisite-Docker-Networking](docs/09-Networking/06-Pre-requisite-Docker-Networking.md)
  - [07-Pre-requisite-CNI](docs/09-Networking/07-Pre-requisite-CNI.md)
  - [08-Cluster-Networking](docs/09-Networking/08-Cluster-Networking.md)
  - [09-Practice-Test-Explore-Env](docs/09-Networking/09-Practice-Test-Explore-Env.md)
  - [10-Pod-Networking](docs/09-Networking/10-Pod-Networking.md)
  - [11-CNI-in-Kubernetes](docs/09-Networking/11-CNI-in-Kubernetes.md)
  - [12-CNI-weave](docs/09-Networking/12-CNI-weave.md)
  - [13-Practice-Test-CNI-weave](docs/09-Networking/13-Practice-Test-CNI-weave.md)
  - [14-Practice-Test-Deploy-Network-Solution](docs/09-Networking/14-Practice-Test-Deploy-Network-Solution.md)
  - [15-ipam-weave](docs/09-Networking/15-ipam-weave.md)
  - [16-Practice-Test-Networking-weave](docs/09-Networking/16-Practice-Test-Networking-weave.md)
  - [17-Service-Networking](docs/09-Networking/17-Service-Networking.md)
  - [18-Practice-Test-Service-Networking](docs/09-Networking/18-Practice-Test-Service-Networking.md)
  - [19-DNS-in-kubernetes](docs/09-Networking/19-DNS-in-kubernetes.md)
  - [20-CoreDNS-in-Kubernetes](docs/09-Networking/20-CoreDNS-in-Kubernetes.md)
  - [21-Practice-Test-CoreDNS-in-Kubernetes](docs/09-Networking/21-Practice-Test-CoreDNS-in-Kubernetes.md)
  - [22-Ingress](docs/09-Networking/22-Ingress.md)
  - [23-Ingress-Annotations-and-rewrite-target](docs/09-Networking/23-Ingress-Annotations-and-rewrite-target.md)
  - [24-Practice-Test-CKA-Ingress-Net-1](docs/09-Networking/24-Practice-Test-CKA-Ingress-Net-1.md)
  - [25-Practice-Test-CKA-Ingress-Net-2](docs/09-Networking/25-Practice-Test-CKA-Ingress-Net-2.md)
  - [26-Dowload-Presentation-Deck](docs/09-Networking/26-Dowload-Presentation-Deck.md)


- [10-Design-and-Install-Kubernetes-Cluster](docs/10-Design-and-Install-Kubernetes-Cluster)

  - [01-Designing-a-Kubernetes-Cluster](docs/10-Design-and-Install-Kubernetes-Cluster/01-Designing-a-Kubernetes-Cluster.md)
  - [02-Choosing-Kubernetes-Infrastructure](docs/10-Design-and-Install-Kubernetes-Cluster/02-Choosing-Kubernetes-Infrastructure.md)
  - [03-Configure-High-Availability](docs/10-Design-and-Install-Kubernetes-Cluster/03-Configure-High-Availability.md)
  - [04-ETCD-in-HA](docs/10-Design-and-Install-Kubernetes-Cluster/04-ETCD-in-HA.md)
  - [05-Important-update-k8s-hard-way](docs/10-Design-and-Install-Kubernetes-Cluster/05-Important-update-kubernetes-the-hard-way.md)
  - [06-Download-Presentation-Deck](docs/10-Design-and-Install-Kubernetes-Cluster/06-Download-Presentation-Deck.md)

- [11-Install-Kubernetes-the-kubeadm-way](docs/11-Install-Kubernetes-the-kubeadm-way)

  - [01-Introduction-to-Deployment-with-kubeadm](docs/11-Install-Kubernetes-the-kubeadm-way/01-Introduction-to-Deployment-with-kubeadm.md)
  - [02-Resources](docs/11-Install-Kubernetes-the-kubeadm-way/02-Resources.md)
  - [03-Provision-VMs-with-Vagrant](docs/11-Install-Kubernetes-the-kubeadm-way/03-Provision-VMs-with-Vagrant.md)
  - [04-Demo-Deployment-with-Kubeadm](docs/11-Install-Kubernetes-the-kubeadm-way/04-Demo-Deployment-with-Kubeadm.md)
  - [05-Practice-Test-Deploy-Kubernetes-Cluster-using-Kubeadm](docs/11-Install-Kubernetes-the-kubeadm-way/05-Practice-Test-Deploy-Kubernetes-Cluster-using-Kubeadm.md)
  - [BONUS 1 - Various kubeadm cluster configurations](./kubeadm-clusters) - Including for Apple M1/M2!
  - [BONUS 2 - Installing Managed Clusters in Cloud Playgrounds](./managed-clusters/)


- [12-Troubleshooting](docs/12-Troubleshooting)

  - [01-Troubelshooting-Section-Introduction](docs/12-Troubleshooting/01-Troubelshooting-Section-Introduction.md)
  - [02-Application-Failure](docs/12-Troubleshooting/02-Application-Failure.md)
  - [03-Solution-Application-Failure](docs/12-Troubleshooting/03-Solution-Application-Failure.md)
  - [04-Control-Plane-Failure](docs/12-Troubleshooting/04-Control-Plane-Failure.md)
  - [05-Practice-Test-Control-Plane-Failure](docs/12-Troubleshooting/05-Practice-Test-Control-Plane-Failure.md)
  - [06-Solution-Control-Plane-Failure](docs/12-Troubleshooting/06-Solution-Control-Plane-Failure.md)
  - [07-Worker-Node-Failure](docs/12-Troubleshooting/07-Worker-Node-Failure.md)
  - [08-Practice-Test-Worker-Node-Failure](docs/12-Troubleshooting/08-Practice-Test-Worker-Node-Failure.md)
  - [09-Solution-Worker-Node-Failure](docs/12-Troubleshooting/09-Solution-Worker-Node-Failure.md)
  - [10-Practice-Test-Troubleshoot-Network](docs/12-Troubleshooting/10-Practice-Test-Troubleshoot-Network.md)

- [13-Other-Topics](docs/13-Other-Topics)

  - [01-Labs-JSON-PATH](docs/13-Other-Topics/01-Labs-JSON-PATH.md)
  - [02-Pre-Requisites-JSON-PATH](docs/13-Other-Topics/02-Pre-Requisites-JSON-PATH.md)
  - [03-Advance-Kubectl-Commands](docs/13-Other-Topics/03-Advance-Kubectl-Commands.md)
  - [04-Practice-Test-Advance-Kubectl-Commands](docs/13-Other-Topics/04-Practice-Test-Advance-Kubectl-Commands.md)


- [14-Lightning-Labs](docs/14-Lightning-Labs)

  - [01-Lightning-Labs-Introduction](docs/14-Lightning-Labs/01-Lightning-Labs-Introduction.md)
  - [02-Lightning-Lab-1](docs/14-Lightning-Labs/02-Lightning-Lab-1.md)


- [15-Mock-Exams](docs/15-Mock-Exams)

  - [01-Introduction](docs/15-Mock-Exams/01-Introduction.md)
  - [02-Mock-Exam-1](docs/15-Mock-Exams/02-Mock-Exam-1.md)
  - [03-Mock-Exam-2](docs/15-Mock-Exams/03-Mock-Exam-2.md)
  - [04-CKA-MockExam-2-Solution](docs/15-Mock-Exams/04-CKA-MockExam-2-Solution.md)
  - [05-Mock-Exam-3](docs/15-Mock-Exams/05-Mock-Exam-3.md)
  - [06-CKA-MockExam-3-Solution](docs/15-Mock-Exams/06-CKA-MockExam-3-Solution.md)

- [16-Ultimate-Mocks](docs/16-Ultimate-Mocks/)

- [17-Tips-and-Tricks](docs/17-tips-and-tricks/)
  - [01-Server for testing network policies](docs/17-tips-and-tricks/docs/01-server-for-testing-network-policies.md)
  - [02-Client-for-testing-network-things](docs/17-tips-and-tricks/docs/02-client--for-testing-network-things.md)



================================================
FILE: apple-silicon/README.md
================================================
# Installing Kubernetes the kubeadm way on Apple Silicon

Moved to [here](../kubeadm-clusters/apple-silicon/).


================================================
FILE: docs/01-Introduction/01-Course-Introduction.md
================================================
# Course Introduction

  - Take me to the [Video Tutorial](https://kodekloud.com/topic/course-introduction-5/)

#### This course focuses on Administration part of the kubernetes. 

## Course Structure

   - Lectures
   - Demos
   - Quizzes
   - Practice Questions
   - Q & A Section
   
## Pre-Requisites
 
   - Docker
   - Basics of kubernetes
     - PODS, Deployments, Services ...
   - YAML
   - Setting up a basic lab environment with VirtualBox
   
#### If you are a beginner we highly recommend Kubernetes for the Absolute Beginners Hands-On course

   - Take me to the [Kubernetes for the Absolute Beginners Hands-On Course](https://kodekloud.com/courses/kubernetes-for-the-absolute-beginners-hands-on/)
   
## Course Objectives

The objectives of this course are aligned to match the **`Certified Kubernetes Administration Exam (CKA)`**

- Core Concepts
  - Cluster Architecture
  - API Primitives
  - Services & Other Network Primitives
- Scheduling
  - Labels & Selectors
  - Daemon Sets
  - Resource Limits
  - Multiple Schedulers
  - Manual Scheduling
  - Scheduler Events
  - Configure Kubernetes Scheduler
- Logging & Monitoring
  - Monitor Cluster Components
  - Monitor Cluster Components Logs
  - Monitor Applications
  - Application Logs
- Application Lifecycle Management
  - Rolling Updates and Rollbacks in Deployments
  - Configuring Applications
  - Scale Applications
  - Self-Healing Applications
- Cluster Maintenance
  - Cluster Upgrade Process
  - Operating System Upgrades
  - Backup and Restore Methodologies
 - Security
   - Authentication & Authorization
   - Kubernetes Security
   - Network Policies
   - TLS Certificates for Cluster Components
   - Image Security
   - Network Policies
   - Security Contexts
   - Secure Persistent Key Value Store
- Storage
  - Persistent Volumes
  - Access Modes for Volumes
  - Persistent Volume Claims
  - Kubernetes Storage Object
  - Configure Applications with Persistent Storage
- Networking
  - Pre-Requisites - Network, Switching, Routing, Tools 
  - Pre-Requisites - Network Namespaces
  - Pre-Requisites - Networking in Docker
  - Networking Configuration on Cluster Nodes
  - Service Networking
  - POD Networking Concepts
  - Network Loadbalancer
  - Ingress
  - Cluster DNS
  - CNI
- Installation, Configuration & Validation
  - Design a Kubernetes Cluster
  - Install Kubernetes Master and Nodes
  - Secure Cluster Communication
  - HA Kubernetes Cluster
  - Kubernetes Release Binaries
  - Provision Infrastructure
  - Choose a Network Solution
  - Kubernetes Infrastructure Config
  - Run & Analyze end-to-end test
  - Node end-to-end tests
- Troubleshooting
  - Application Failure
  - Control Plane Failure
  - Worker Node Failure
  - Networking
  
## Practice Tests

CKA exam is a practical hands-on exam it is very important to practice what you learn. Which is why we build a custom solution that will give you access to a **`Real Kubernetes Environment`** right in your browser along with **`Quiz Portal`**
  
## Kubernetes the hard way

   - Take me to [Kubernetes The Hard way on VirtualBox](https://github.com/mmumshad/kubernetes-the-hard-way)


================================================
FILE: docs/01-Introduction/02-Certification.md
================================================
# Certification

  - Take me to [Video Tutorial](https://kodekloud.com/topic/certification/)
  
## Certification Details

   - **`Certified Kubernetes Administrator`**: https://www.cncf.io/certification/cka/

   - **`Exam Curriculum (Topics)`**: https://github.com/cncf/curriculum

   - **`Candidate Handbook`**: https://www.cncf.io/certification/candidate-handbook

   - **`Exam Tips`**: http://training.linuxfoundation.org/go//Important-Tips-CKA-CKAD

#### Use the code - KUBERNETES15 - while registering for the CKA or CKAD exams at Linux Foundation to get a 15% discount.



================================================
FILE: docs/02-Core-Concepts/01-Core-Concepts-Section-Introduction.md
================================================
# Core Concepts Section Introduction

 - Take me to the [Video Tutorial](https://kodekloud.com/topic/core-concepts-section-introduction/)
 
In this section, we will take a look at the below
- Cluster Architecture  
- API Primitives
- Services & Other Network Primitives

k8s reference docs:
- https://kubernetes.io/docs/concepts/overview/kubernetes-api/
- https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/
- https://kubernetes.io/docs/concepts/architecture/
- https://kubernetes.io/docs/concepts/overview/components/
- https://kubernetes.io/docs/concepts/services-networking/



================================================
FILE: docs/02-Core-Concepts/02-Cluster-Architecture.md
================================================
# Cluster Architecture

  - Take me to [Video Tutorial](https://kodekloud.com/topic/cluster-architecture/)

In this section , we will take a look at the kubernetes Architecture at high level.
- 10,000 Feet Look at the Kubernetes Architecture

  ![Kubernetes Architecture](../../images/k8s-arch.PNG)
  
  ![Kubernetes Architecture 1](../../images/k8s-arch1.PNG)

K8s Reference Docs:
- https://kubernetes.io/docs/concepts/architecture/


================================================
FILE: docs/02-Core-Concepts/03-Docker-vs-ContainerD.md
================================================
# Docker vs. ContainerD

In this section we will look at the differences between Docker and ContainerD


So you’re going to come across Docker and `containerd` many times. Going forward, when you read older blogs or documentation pages , you’ll see Docker mentioned along with Kubernetes and when you read newer blogs you’ll see `containerd` and you’ll wonder what the difference is between the two. And there are a few CLI tools like `ctr`, `crictl` or `nerdctl` and you’ll wonder what are these CLI tools and which one should you be using, so that’s what I’m going to explain.

![](../../images/02-03-01.png)

Let’s go back in time to the beginning of the container era. In the beginning, there was just Docker. There were a few other tools like Rocket ([rkt](https://www.redhat.com/en/topics/containers/what-is-rkt)), but Docker’s user experience made working with containers super simple and hence Docker became the most dominant container tool. And then came Kubernetes to orchestrate Docker so Kubernetes was built to orchestrate Docker specifically in the beginning so Docker and Kubernetes were tightly coupled and back then Kubernetes only worked with Docker and didn't support any other container solutions.

![](../../images/02-03-02.png)

And then Kubernetes grew in popularity as a container orchestrator and now other container runtimes like `rkt` wanted in so Kubernetes users needed it to work with container runtimes that are other than just Docker, and so Kubernetes introduced an interface called container runtime interface or CRI, so CRI allowed any vendor to work as a container runtime for Kubernetes as long as they adhere to the OCI standards.
So OCI stands for Open Container Initiative and it consists of an image spec and a runtime spec. Image spec means the specifications on how an image should be built. It defines the specifications on how an image should be built and the runtime spec defines the standards on how any container runtime should be developed so keeping these standards in mind, anyone can build a container runtime that can be used by anybody to work with Kubernetes, so that was the idea.

![](../../images/02-03-03.png)

So `rkt` and other container runtimes that adhere to the OCI standards were now supported as container runtimes for Kubernetes via the CRI, however Docker wasn’t built to support  the CRI standards, remember Docker was built way before CRI was introduced and Docker still was the dominant container tool used by most, so Kubernetes had to continue to support Docker as well and so Kubernetes introduced what is known as `dockershim` which was a hacky but temporary way to support Docker outside of the CRI.

![](../../images/02-03-04.png)

So while most other container runtimes worked to the CRI, Docker continued to work without it, so now you see Docker isn’t just a container runtime alone. Docker consists of multiple tools that are put together, for example the Docker CLI, the Docker API, the build tools that help in building images. There was support for volumes, security, and finally the container runtime called `runc`, and the daemon that managed `runc`, that was called `containerd`. So containerd is CRI compatible and can work directly with Kubernetes as all other runtimes, so containerd can be used as a runtime on its own separate from Docker.

![](../../images/02-03-05.png)

So now you have containerd as a separate runtime and Docker separately, so Kubernetes continued to maintain support for Docker engine directly however having to maintain the dockershim was an unnecessary effort and added complications so it was decided in v1.24 release of Kubernetes to remove dockershim completely and so support for Docker was removed. But you see all the images that were built before Docker was removed so all the Docker images continued to work because Docker followed the image spec from the OCI standards so all the images built by Docker follow the standard so they continued to work with containerd but Docker itself was removed as a supported runtime from Kubernetes. So that’s kind of the whole story, now let’s look into containerd more specifically.

![](../../images/02-03-06.png)

So containerd although is part of Docker, is a separate project on its own now and is a member of [CNCF](https://www.cncf.io/) with the [graduated](https://www.cncf.io/projects/) status, so you can now install containerd on its own without having to install Docker itself so if you don’t really need Docker’s other features you could ideally just install containerd alone. So typically we ran containers using the `docker run` command when we had Docker and if Docker isn’t installed then how do you run containers with just containerd? Now, once you install containerd it comes with a command line tool called [ctr](https://github.com/projectatomic/containerd/blob/master/docs/cli.md#client-cli), and this tool is solely made for debugging containerd and is not very user friendly as it only supports a limited set of features and this is all you can see in the documentation pages for this particular tool. So for the other than limited set of features that require any other way you want to interact with containerd you have to rely on making API calls directly which is not the most user friendly way for us to operate.

So just to give you an idea, the `ctr` command can be used to perform basic container-related activities such as pull images, for example to pull redis image you would run

```
ctr images pull docker.io/library/redis:alpine
```

To run a container we use the `ctr` run command

```
ctr run docker.io/library/redis:alpine redis
```

But as I mentioned, this tool is solely for debugging containerd and is not very user friendly and is not to be used for managing containers on a production environment.
So a better alternative recommended is the [nerdctl](https://github.com/containerd/nerdctl#nerdctl-docker-compatible-cli-for-container) tool. So the `nerdctl` tool is a command line tool that’s very similar to Docker, so it’s a Docker-like CLI for containerd. It supports most of the CLI options that Docker supports and apart from that it has the added benefit that it can give us access to the newest features implemented in containerd, so for example we can work with encrypted container images or other new features that will eventually be implemented into the regular Docker command in the future. It also supports lazy pulling of images, P2P image distribution, image signing and verifying and namespaces in Kubernetes which are not available in Docker. So the `nerdctl` tool works very similar to Docker cli, so instead of Docker you would simply have to replace it with `nerdctl` so it can run almost all Docker commands that interact with containers like this

![](../../images/02-03-07.png)

So that’s pretty easy and straightforward so now that we have talked about `ctr` and the `nerdctl` tool, it’s important to talk about another command like tool known as [crictl](https://github.com/kubernetes-sigs/cri-tools/blob/master/docs/crictl.md#container-runtime-interface-cri-cli). So earlier we talked about the CRI which is a single interface used to connect CRI compatible container runtimes, containerd, `rkt` and others. So the `crictl` is a command line utility that is used to interact with the CRI compatible container runtime, so this is kind of interaction from the Kubernetes perspective. So this tool is developed and maintained by the Kubernetes community and this tool works across all the different container runtimes and because earlier you had the `ctr` and `nerdctl` utility that was built by the containerd community specifically for containerd, but this particular tool is from the Kubernetes perspective that works across different container runtimes.

So it must be installed separately and is used to inspect and debug container runtimes so this again is not ideally used to create containers unlike the Docker or the `nerdctl` utility but is again a debugging tool. You can technically create containers with the `crictl` utility but it’s not easy. It’s only to be used for some special debugging purposes. And remember that it kind of works along with the kubelet so we know that the kubelet is responsible for ensuring that a specific number of containers or pods are available on a node at time, so if you kind of go through the `crictl` utility and try and create containers with it, then eventually kubelet is going to delete them because kubelet is unaware of some of those containers or pods that are created outside of its knowledge so anything that it sees it’s going to go and delete it, so because of those things remember that the `crictl` utility is only used for debugging purposes and getting into containers and all of that.

So let’s look at some of the command line examples so you simply run  the `crictl` command for this and this can be used to perform basic container-related activities such as pull images, or list existing images, list containers, very similar to the Docker command where you use the PS commands, so in Docker you run the `ps` command, and here you run the `crictl ps` command and to run a command in since a container docker remember we use the `exec` command and it’s the same here and along with the same options such as `-i` and `-t` and you specify the container id. The view the logs, you use the `crictl` logs command, again very similar to the docker command.

![](../../images/02-03-08.png)

One major difference is that the `crictl` command is also aware of pods so you can list pods by running the `crictl` pods command so this wasn’t something that Docker was aware of. So while working with Kubernetes in the past, we used Docker commands a lot to troubleshoot containers and view logs especially on the worker nodes and now you’re going to use the `crictl` command to do so. So the syntax is a lot similar and so it shouldn’t be really hard.
So here’s a chart that lists the comparison between the Docker and `crictl` command line tools. So as you can see, a lot of command such as attach exec, images, info, inspect, logs, ps, stats, version etc., work exactly the same way, and some of the commands to create, remove and start and stop images work similarly too. So a full list of differences can be found in [this link](https://kubernetes.io/docs/reference/tools/map-crictl-dockercli/#retrieve-debugging-information).

| docker cli | crictl            | Description                                                          | Unsupported Features                |
|------------|-------------------|----------------------------------------------------------------------|-------------------------------------|
| attach     | attach            | Attach to a running container                                        | --detach-keys, --sig-proxy          |
| exec       | exec              | Run a command in a running container                                 | --privileged, --user, --detach-keys |
| images     | images            | List images                                                          |                                     |
| info       | info              | Display system-wide information                                      |                                     |
| inspect    | inspect, inspecti | Return low-level information on a container, image or task           |                                     |
| logs       | logs              | Fetch the logs of a container                                        | --details                           |
| ps         | ps                | List containers                                                      |                                     |
| stats      | stats             | Display a live stream of container(s) resource usage statistics      | Column: NET/BLOCK I/O, PIDs         |
| version    | version           | Show the runtime (Docker, ContainerD, or others) version information |                                     |

So, since as I mentioned, `crictl` can be used to connect to any CRI compatible runtime, remember to set the right endpoint if you have multiple container runtimes configured, or if you want `crictl` to interact with a specific runtime, for example if you haven’t configured anything by default it’s going to connect to these sockets in this particular order, so it’s going to try and connect to dockershim first, then containerd, then CRI-O, then the CRI-dockerd – that’s kind of the order that it falls. But if you want to override that and set a specific endpoint, you use the `--runtime-endpoint` option with the `crictl` command line, or you could use the `CONTAINER_RUNTIME_ENDPOINT` environment variable. Set the environment variable to the right endpoint.

![](../../images/02-03-09.png)

So to summarize we have the `ctr` command line utility that comes with containerd and works with containerd which is used for debugging purposes only and has a very limited set of features, so ideally you wouldn’t be using this at all so you can kind of ignore this. Then we have the `nerdctl` CLI which is again from the containerd community but this is a Docker-like CLI for containerd used for general purpose to create containers and supports the same or more features than Docker CLI, so it’s something that I think we’ll be using a lot more going forward. Then we have the `crictl` utility which is from the Kubernetes community and mainly used to interact with CRI compatible runtimes, so it’s not just for containerd – this can be used for all CRI supported runtimes – again this is mainly to be used for debugging purposes.

![](../../images/02-03-10.png)

So if we look at the comparisons here, you can see that `ctr` and `crictl` are used mainly for debugging purposes, whereas the `nerdctl` is used for general purpose. The `ctr` and `nerdctl` are from the containerd community and work with containerd, whereas `crictl` is from the Kubernetes community and works across all CRI compatible runtimes.
So our labs originally had Docker installed on all the nodes so we used the Docker commands to troubleshoot, but now it’s all containerd so remember to use the `crictl` command instead to troubleshoot.




================================================
FILE: docs/02-Core-Concepts/04-ETCD-For-Beginners.md
================================================
# ETCD for Beginners
  - Take me to the [Video Tutorial](https://kodekloud.com/topic/etcd-for-beginners/)

  In this section, we will take a quick look at introduction to ETCD for beginners.
  - What is ETCD?
  - What is a Key-Value Store?
  - How to get started quickly with ETCD?
  - How to operate ETCD?

 ## What is a ETCD?
     - ETCD is a distributed reliable key-value store that is simple, secure & Fast.

## What is a Key-Value Store
   - Traditionally, databases have been in tabular format, you must have heard about SQL or Relational databases. They store data in rows and columns

     ![relational-dbs](../../images/relational-dbs.PNG)

   - A Key-Value Store stores information in a Key and Value format.

     ![key-value](../../images/key-value.PNG)

## Install ETCD
   - It's easy to install and get started with **`ETCD`**.
     - Download the relevant binary for your operating system from github releases page (https://github.com/etcd-io/etcd/releases)

       For Example: To download ETCD v3.5.6, run the below curl command

       ```
       $ curl -LO https://github.com/etcd-io/etcd/releases/download/v3.5.6/etcd-v3.5.6-linux-amd64.tar.gz
       ```
     - Extract it.
       ```
       $ tar xvzf etcd-v3.5.6-linux-amd64.tar.gz
       ```
     - Run the ETCD Service
       ```
       $ ./etcd
       ```
     - When you start **`ETCD`** it will by default listen on port **`2379`**
      - The default client that comes with **`ETCD`** is the [**`etcdctl`**](https://github.com/etcd-io/etcd/tree/main/etcdctl) client. You can use it to store and retrieve key-value pairs.
        ```
        Syntax: To Store a Key-Value pair
        $ ./etcdctl put key1 value1
        ```
        ```
        Syntax: To retrieve the stored data
        $ ./etcdctl get key1
        ```
        ```
        Syntax: To view more commands. Run etcdctl without any arguments
        $ ./etcdctl
        ```

        ![etcdctl](../../images/etcdctl.PNG)

       K8s Reference Docs:
       - https://kubernetes.io/docs/concepts/overview/components/
       - https://etcd.io/docs/
       - https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/



================================================
FILE: docs/02-Core-Concepts/05-ETCD-in-Kubernetes.md
================================================
# ETCD in Kubernetes
  - Take me to [Video Tutorial](https://kodekloud.com/topic/etcd-in-kubernetes/)

In this section, we will take a look at ETCD role in kubernetes

## ETCD Datastore
- The ETCD Datastore stores information regarding the cluster such as **`Nodes`**, **`PODS`**, **`Configs`**, **`Secrets`**, **`Accounts`**, **`Roles`**, **`Bindings`** and **`Others`**.
- Every information you see when you run the **`kubectl get`** command is from the **`ETCD Server`**.

## Setup - Manual
- If you setup your cluster from scratch then you deploy **`ETCD`** by downloading ETCD Binaries yourself
- Installing Binaries and Configuring ETCD as a service in your master node yourself.
  ```
  $ wget -q --https-only "https://github.com/etcd-io/etcd/releases/download/v3.3.11/etcd-v3.3.11-linux-amd64.tar.gz"
  ```

  ![etcd](../../images/etcd.PNG)
  
## Setup - Kubeadm
- If you setup your cluster using **`kubeadm`** then kubeadm will deploy etcd server for you as a pod in **`kube-system`** namespace.
  ```
  $ kubectl get pods -n kube-system
  ```
  ![etcd1](../../images/etcd1.PNG)

## Explore ETCD
- To list all keys stored by kubernetes, run the below command
  ```
  $ kubectl exec etcd-master -n kube-system -- sh -c "ETCDCTL_API=3 etcdctl --cert=/etc/kubernetes/pki/etcd/server.crt --key=/etc/kubernetes/pki/etcd/server.key --cacert=/etc/kubernetes/pki/etcd/ca.crt get / --prefix --keys-only"
  ```
- Kubernetes Stores data in a specific directory structure, the root directory is the **`registry`** and under that you have various kubernetes constructs such as **`minions`**, **`nodes`**, **`pods`**, **`replicasets`**, **`deployments`**, **`roles`**, **`secrets`** and **`Others`**.
  
  ![etcdctl1](../../images/etcdctl1.PNG)

## ETCD in HA Environment
   - In a high availability environment, you will have multiple master nodes in your cluster that will have multiple ETCD Instances spread across the master nodes.
   - Make sure etcd instances know each other by setting the right parameter in the **`etcd.service`** configuration. The **`--initial-cluster`** option where you need to specify the different instances of the etcd service.
     ![etcd-ha](../../images/etcd-ha.PNG)

K8s Reference Docs:
- https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/
- https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm/
- https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/high-availability/#stacked-control-plane-and-etcd-nodes
- https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/high-availability/#external-etcd-nodes


================================================
FILE: docs/02-Core-Concepts/06-Kube-API-Server.md
================================================
# Kube API Server
  - Take me to [Video Tutorial](https://kodekloud.com/topic/kube-api-server/)
  
In this section, we will talk about kube-apiserver in kubernetes

#### Kube-apiserver is the primary component in kubernetes.
- Kube-apiserver is responsible for **`authenticating`**, **`validating`** requests, **`retrieving`** and **`Updating`** data in ETCD key-value store. In fact kube-apiserver is the only component that interacts directly to the etcd datastore. The other components such as kube-scheduler, kube-controller-manager and kubelet uses the API-Server to update in the cluster in their respective areas.
  
  ![post](../../images/post.PNG)
  
## Installing kube-apiserver

- If you are bootstrapping kube-apiserver using **`kubeadm`** tool, then you don't need to know this, but if you are setting up using the hardway then kube-apiserver is available as a binary in the kubernetes release page.
  - For example: You can downlaod the kube-apiserver v1.13.0 binary here [kube-apiserver](https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kube-apiserver)
    ```
    $ wget https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kube-apiserver
    ```
 
 ![kube-apiserver](../../images/kube-apiserver.PNG)
 
## View kube-apiserver - Kubeadm
- kubeadm deploys the kube-apiserver as a pod in kube-system namespace on the master node.
  ```
  $ kubectl get pods -n kube-system
  ```
   
  ![kube-apiserver1](../../images/kube-apiserver1.PNG)
   
## View kube-apiserver options - Kubeadm
- You can see the options with in the pod definition file located at **`/etc/kubernetes/manifests/kube-apiserver.yaml`**
  ```
  $ cat /etc/kubernetes/manifests/kube-apiserver.yaml
  ```
  
  ![kube-apiserver2](../../images/kube-apiserver2.PNG)
   
## View kube-apiserver options - Manual
- In a Non-kubeadm setup, you can inspect the options by viewing the kube-apiserver.service
  ```
  $ cat /etc/systemd/system/kube-apiserver.service
  ```
  
  ![kube-apiserver3](../../images/kube-apiserver3.PNG)
   
- You can also see the running process and effective options by listing the process on master node and searching for kube-apiserver.
  ```
  $ ps -aux | grep kube-apiserver
  ```
  ![kube-apiserver4](../../images/kube-apiserver4.PNG)

K8s Reference Docs:
- https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/
- https://kubernetes.io/docs/concepts/overview/components/
- https://kubernetes.io/docs/concepts/overview/kubernetes-api/
- https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/
- https://kubernetes.io/docs/tasks/administer-cluster/access-cluster-api/


================================================
FILE: docs/02-Core-Concepts/07-Kube-Controller-Manager.md
================================================
# Kube Controller Manager

  - Take me to [Video Tutorial](https://kodekloud.com/topic/kube-controller-manager/)
  
In this section, we will take a look at kube-controller-manager.

#### Kube Controller Manager manages various controllers in kubernetes.
- In kubernetes terms, a controller is a process that continuously monitors the state of the components within the system and works towards bringing the whole system to the desired functioning state.

## Node Controller
   - Responsible for monitoring the state of the Nodes and taking necessary actions to keep the application running. 
  
   ![node-controller](../../images/node-controller.PNG)
   
## Replication Controller
   - It is responsible for monitoring the status of replicasets and ensuring that the desired number of pods are available at all time within the set.
   
   ![replication-controller](../../images/replication-controller.PNG)
   
## Other Controllers
   - There are many more such controllers available within kubernetes
     
   ![other-controllers](../../images/other-controllers.PNG)
   
   
  ## Installing Kube-Controller-Manager
  - When you install kube-controller-manager the different controllers will get installed as well.
  - Download the kube-controller-manager binary from the kubernetes release page. For example: You can download kube-controller-manager v1.13.0 here [kube-controller-manager](https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kube-controller-manager)
    ```
    $ wget https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kube-controller-manager
    ```
  - By default all controllers are enabled, but you can choose to enable specific one from **`kube-controller-manager.service`**
    ```
    $ cat /etc/systemd/system/kube-controller-manager.service
    ```
    ![kube-controller-manager](../../images/kube-controller-manager.PNG)
    
## View kube-controller-manager - kubeadm
- kubeadm deploys the kube-controller-manager as a pod in kube-system namespace
  ```
  $ kubectl get pods -n kube-system
  ```
  ![kube-controller-manager0](../../images/kube-controller-manager0.PNG)
  
## View kube-controller-manager options - kubeadm
- You can see the options within the pod located at **`/etc/kubernetes/manifests/kube-controller-manager.yaml`**
  ```
  $ cat /etc/kubernetes/manifests/kube-controller-manager.yaml
  ```
  ![kube-controller-manager1](../../images/kube-controller-manager1.PNG)
  
## View kube-controller-manager options - Manual
- In a non-kubeadm setup, you can inspect the options by viewing the **`kube-controller-manager.service`**
  ```
  $ cat /etc/systemd/system/kube-controller-manager.service
  ```
  ![kube-controller-manager2](../../images/kube-controller-manager2.PNG)
  
- You can also see the running process and effective options by listing the process on master node and searching for kube-controller-manager.
  ```
  $ ps -aux | grep kube-controller-manager
  ```
  ![kube-controller-manager3](../../images/kube-controller-manager3.PNG)
  
K8s Reference Docs:
- https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/
- https://kubernetes.io/docs/concepts/overview/components/
   
     


================================================
FILE: docs/02-Core-Concepts/08-Kube-Scheduler.md
================================================
# Kube Scheduler
  - Take me to [Video Tutorial](https://kodekloud.com/topic/kube-scheduler/)

In this section, we will take a look at kube-scheduler.

#### kube-scheduler is responsible for scheduling pods on nodes.  
- The kube-scheduler is only responsible for deciding which pod goes on which node. It doesn't actually place the pod on the nodes, that's the job of the **`kubelet`**.

  ![kube-scheduler1](../../images/kube-scheduler1.PNG)
  
#### Why do you need a Scheduler?

  ![kube-scheduler2](../../images/kube-scheduler2.PNG)
    
## Install kube-scheduler - Manual
- Download the kubescheduler binary from the kubernetes release pages [kube-scheduler](https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kube-scheduler). For example: To download kube-scheduler v1.13.0, Run the below command.
  ```
  $ wget https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kube-scheduler
  ```
- Extract it
- Run it as a service

  ![kube-scheduler3](../../images/kube-scheduler3.PNG)
  
## View kube-scheduler options - kubeadm
- If you set it up with kubeadm tool, kubeadm tool will deploy the kube-scheduler as pod in kube-system namespace on master node.
  ```
  $ kubectl get pods -n kube-system
  ```
- You can see the options for kube-scheduler in pod definition file that is located at **`/etc/kubernetes/manifests/kube-scheduler.yaml`**
  ```
  $ cat /etc/kubernetes/manifests/kube-scheduler.yaml
  ```
  ![kube-scheduler4](../../images/kube-scheduler4.PNG)
  
- You can also see the running process and effective options by listing the process on master node and searching for kube-apiserver.
  ``` 
  $ ps -aux | grep kube-scheduler
  ```
  ![kube-scheduler5](../../images/kube-scheduler5.PNG)
  
  K8s Reference Docs:
  - https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/
  - https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/
  - https://kubernetes.io/docs/concepts/overview/components/
  - https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/
    


================================================
FILE: docs/02-Core-Concepts/09-Kubelet.md
================================================
# Kubelet
  - Take me to [Video Tutorial](https://kodekloud.com/topic/kubelet/)
  
In this section we will take a look at kubelet.

#### Kubelet is the sole point of contact for the kubernetes cluster
- The **`kubelet`** will create the pods on the nodes, the scheduler only decides which pods goes where.

  ![kubelet](../../images/kubelet.PNG)
  
## Install kubelet
- Kubeadm does not deploy kubelet by default. You must manually download and install it.
- Download the kubelet binary from the kubernetes release pages [kubelet](https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kubelet). For example: To download kubelet v1.13.0, Run the below command.
  ```
  $ wget https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kubelet
  ```
- Extract it
- Run it as a service

  ![kubelet1](../../images/kubelet1.PNG)
  
## View kubelet options
- You can also see the running process and affective options by listing the process on worker node and searching for kubelet.
  ``` 
  $ ps -aux |grep kubelet
  ```
  
  ![kubelet2](../../images/kubelet2.PNG)

K8s Reference Docs:
- https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/
- https://kubernetes.io/docs/concepts/overview/components/
- https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/kubelet-integration/


================================================
FILE: docs/02-Core-Concepts/10-Kube-Proxy.md
================================================
# Kube Proxy
- Take me to [Video Tutorial](https://kodekloud.com/topic/kube-proxy/)

In this section, we will take a look at kube-proxy.

Within Kubernetes Cluster, every pod can reach every other pod. This is accomplished by deploying a pod networking cluster to the cluster. 
- Kube-Proxy is a process that runs on each node in the kubernetes cluster.
  
  ![kube-proxy](../../images/kube-proxy.PNG)
  
## Install kube-proxy - Manual
- Download the kube-proxy binary from the kubernetes release pages [kube-proxy](https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kube-proxy). For example: To download kube-proxy v1.13.0, Run the below command.
  ```
  $ wget https://storage.googleapis.com/kubernetes-release/release/v1.13.0/bin/linux/amd64/kube-proxy
  ```
- Extract it
- Run it as a service

  ![kube-proxy1](../../images/kube-proxy1.PNG)

## View kube-proxy options - kubeadm
- If you set it up with kubeadm tool, kubeadm tool will deploy the kube-proxy as pod in kube-system namespace. In fact it is deployed as a daemonset on master node.
  ```
  $ kubectl get pods -n kube-system
  ```
  ![kube-proxy2](../../images/kube-proxy2.PNG)
  
  
K8s Reference Docs:
- https://kubernetes.io/docs/reference/command-line-tools-reference/kube-proxy/
- https://kubernetes.io/docs/concepts/overview/components/


================================================
FILE: docs/02-Core-Concepts/11-Pods.md
================================================
# Pods
  - Take me to [Video Tutorial](https://kodekloud.com/topic/pods-2/)
  
In this section, we will take a look at PODS.
- POD introduction
- How to deploy pod?

#### Kubernetes doesn't deploy containers directly on the worker node.

  ![pod](../../images/pod.PNG)
  
#### Here is a single node kubernetes cluster with single instance of your application running in a single docker container encapsulated in the pod.

![pod1](../../images/pod1.PNG)

#### Pod will have a one-to-one relationship with containers running your application.

  ![pod2](../../images/pod2.PNG)
  
## Multi-Container PODs
- A single pod can have multiple containers except for the fact that they are usually not multiple containers of the **`same kind`**.
  
  ![pod3](../../images/pod3.PNG)
  
## Docker Example (Docker Link)
  
  ![pod4](../../images/pod4.PNG)
  
## How to deploy pods?
Lets now take a look to create a nginx pod using **`kubectl`**.

- To deploy a docker container by creating a POD.
  ```
  $ kubectl run nginx --image nginx
  ```

- To get the list of pods
  ```
  $ kubectl get pods
  ```

 ![kubectl](../../images/kubectl.PNG)

K8s Reference Docs:
- https://kubernetes.io/docs/concepts/workloads/pods/pod/
- https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/
- https://kubernetes.io/docs/tutorials/kubernetes-basics/explore/explore-intro/




================================================
FILE: docs/02-Core-Concepts/12-Practice-Test-Introduction.md
================================================
# Practice Test Introduction

In this section, we will take a look at practice test demo.
- Take me to [Video Tutorial](https://kodekloud.com/topic/practice-test-introduction-2/)



================================================
FILE: docs/02-Core-Concepts/13-Practice-Test-PODs.md
================================================
# Practice Test - PODs
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-pods/)

## Here are the solutions to the practice test
1. <details>
   <summary>How many pods exist on the system?</summary>

   ```bash
   kubectl get pods
   ```

   Count the number of pods (if any)

   </details>

1. <details>
   <summary>Create a new pod with the nginx image.</summary>

   ```bash
   kubectl run nginx --image=nginx
   ```
   </details>

1. <details>
   <summary>How many pods are created now?</summary>

   ```bash
   kubectl get pods
   ```

   Count the number of pods (if any)

   To get the system to tell you you can also do this

   ```bash
   kubectl get pods --no-headers | wc -l
   ```

   * `--no-headers` should be obvious - output only the details.
   * `wc` is the word count program. `-l` tells it to count lines instead, and it will count the lines emitted by `kubectl`
   </details>

1. <details>
   <summary>What is the image used to create the new pods?</summary>

    `kubectl describe` outputs lots of information. The following will describe all pods whose name starts with `newpods`, and then we filter with `grep` to get what we are looking for.

    ```bash
    kubectl describe pod newpods | grep image
    ```

    We see that all three are pulling the same image.
   </details>

1. <details>
   <summary>Which nodes are these pods placed on?</summary>

    ```bash
    kubectl get pods -o wide
    ```

    Note the node column for each of the 3 `newpods` pods

   </details>

1. <details>
   <summary>How many containers are part of the pod webapp?</summary>

   ```bash
   kubectl describe pod webapp
   ```

   Look under the `Containers` section. Note there is `nginx` and `agentx`

   </details>

1. <details>
   <summary>What images are used in the new webapp pod?</summary>

   Examine the output from Q6. For each of the identified containers, look at `Image:`

   </details>

1. <details>
   <summary>What is the state of the container agentx in the pod webapp?</summary>

   ```bash
   kubectl describe pod webapp
   ```

   Examine the `State:` field for the `agentx` container.

   </details>

1. <details>
   <summary>Why do you think the container agentx in pod webapp is in error?</summary>

   Examine the output from Q8 and look in the `Events:` section at the end. Look at the event that says `failed to pull and unpack image ...`

   </details>

1. <details>
   <summary>What does the READY column in the output of the kubectl get pods command indicate?</summary>

   ```bash
   kubectl get pods
   ```

   Look at the `webapp` pod which we know has two containers and one is in error. You can deduce which of the answers is correct from this.

   </details>

1. <details>
   <summary>Delete the webapp Pod.</summary>

   ```bash
   kubectl delete pod webapp
   ```

   To delete the pod without any delay and confirmation, we can add `--force` flag. Note that in a real production system, forcing is a last resort as it can leave behind containers that haven't been cleaned up properly. Some may have important cleanup jobs to run when they are requested to terminate, which wouldn't get run.

   You can however use `--force` in the exam as it will gain you time. No exam pods rely on any of the above.

   </details>

1. <details>
   <summary>Create a new pod with the name redis and with the image redis123.</br>Use a pod-definition YAML file.</summary>

   To create the pod definition YAML file:

   `--dry-run=client` tells `kubectl` to test without actually doing anything. `-o yaml` says "Output what you would send to API server to the console", which we then redirect into the named file.

   ```bash
   kubectl run redis --image=redis123 --dry-run=client -o yaml > redis.yaml
   ```

   And now use the YAML you created to deploy the pod.

   ```bash
   kubectl create -f redis.yaml
   ```

   </details>

1. <details>
   <summary>Now change the image on this pod to redis.</br>Once done, the pod should be in a running state.</summary>

   There are three ways this can be done!

   1. Method 1</br>
      Edit your manifest file created in last question

      ```bash
      vi redis.yaml
      ```

      Fix the image name in the redis.yaml to `redis`, save and exit.

      Apply the edited yaml

      ```bash
      kubectl apply -f redis.yaml
      ```

   1. Method 2</br>
      Edit the running pod directly (note not all fields can be edited this way)

      ```
      kubectl edit pod redis
      ```

      This will bring the pod YAML up in `vi`. Edit it as per method 1. When you eixt `vi` the change will be immediately applied. If you make a mistake, you will be dropped back into `vi`

   1. Method 3</br>
      Patch the image directly. For this you need to know the `name` of the container in the pod, as we assign the new image to that name, as in `container_image_name=new_image`

      ```bash
      kubectl set image pod/redis redis=redis
      ```

   </details>


================================================
FILE: docs/02-Core-Concepts/14-ReplicaSets.md
================================================
# ReplicaSets
  - Take me to [Video Tutorial](https://kodekloud.com/topic/replicasets/)

In this section, we will take a look at the below
- Replication Controller
- ReplicaSet

#### Controllers are brain behind kubernetes

## What is a Replica and Why do we need a replication controller?

  ![rc](../../images/rc.PNG)
  
  ![rc1](../../images/rc1.PNG)
  
## Difference between ReplicaSet and Replication Controller
- **`Replication Controller`** is the older technology that is being replaced by a **`ReplicaSet`**.
- **`ReplicaSet`** is the new way to setup replication.

## Creating a Replication Controller

## Replication Controller Definition File
  
   ![rc2](../../images/rc2.PNG)
  
```
    apiVersion: v1
    kind: ReplicationController
    metadata:
      name: myapp-rc
      labels:
        app: myapp
        type: front-end
    spec:
     template:
        metadata:
          name: myapp-pod
          labels:
            app: myapp
            type: front-end
        spec:
         containers:
         - name: nginx-container
           image: nginx
     replicas: 3
```
  - To Create the replication controller
    ```
    $ kubectl create -f rc-definition.yaml
    ```
  - To list all the replication controllers
    ```
    $ kubectl get replicationcontroller
    ```
  - To list pods that are launch by the replication controller
    ```
    $ kubectl get pods
    ```
    ![rc3](../../images/rc3.PNG)
    
## Creating a ReplicaSet
  
## ReplicaSet Definition File

   ![rs](../../images/rs.PNG)

```
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
      name: myapp-replicaset
      labels:
        app: myapp
        type: front-end
    spec:
     template:
        metadata:
          name: myapp-pod
          labels:
            app: myapp
            type: front-end
        spec:
         containers:
         - name: nginx-container
           image: nginx
     replicas: 3
     selector:
       matchLabels:
        type: front-end
 ```
#### ReplicaSet requires a selector definition when compare to Replication Controller.
   
  - To Create the replicaset
    ```
    $ kubectl create -f replicaset-definition.yaml
    ```
  - To list all the replicaset
    ```
    $ kubectl get replicaset
    ```
  - To list pods that are launch by the replicaset
    ```
    $ kubectl get pods
    ```
   
    ![rs1](../../images/rs1.PNG)
    
## Labels and Selectors
#### What is the deal with Labels and Selectors? Why do we label pods and objects in kubernetes?

  ![labels](../../images/labels.PNG)
  
## How to scale replicaset
- There are multiple ways to scale replicaset
  - First way is to update the number of replicas in the replicaset-definition.yaml definition file. E.g replicas: 6 and then run 
 ```
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
      name: myapp-replicaset
      labels:
        app: myapp
        type: front-end
    spec:
     template:
        metadata:
          name: myapp-pod
          labels:
            app: myapp
            type: front-end
        spec:
         containers:
         - name: nginx-container
           image: nginx
     replicas: 6
     selector:
       matchLabels:
        type: front-end
```

  ```
  $ kubectl apply -f replicaset-definition.yaml
  ```
  - Second way is to use **`kubectl scale`** command.
  ```
  $ kubectl scale --replicas=6 -f replicaset-definition.yaml
  ```
  - Third way is to use **`kubectl scale`** command with type and name
  ```
  $ kubectl scale --replicas=6 replicaset myapp-replicaset
  ```
  ![rs2](../../images/rs2.PNG)

#### K8s Reference Docs:
- https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
- https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller/


================================================
FILE: docs/02-Core-Concepts/15-Practice-Tests-ReplicaSet.md
================================================
# Practice Test - ReplicaSets
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-replicasets/)

#### Solutions for the replicaset practice tests
1. <details>
   <summary>How many pods exist on the system?</summary>

   ```bash
   kubectl get pods
   ```

   Count the number of pods (if any)

   </details>

1. <details>
   <summary>How many ReplicaSets exist on the system?</summary>

   ```bash
   kubectl get replicasets
   ```

   Count the number of ReplicaSets  (if any)

   </details>


1. <details>
   <summary>How about now? How many ReplicaSets do you see?</summary>

   ```bash
   kubectl get replicasets
   ```

   Count the number of ReplicaSets  (if any)

   </details>

1. <details>
   <summary>How many PODs are DESIRED in the new-replica-set?</summary>

   From the output of Q3, look in `DESIRED` column
   </details>

1. <details>
   <summary>What is the image used to create the pods in the new-replica-set?</summary>

   ```
   kubectl describe replicaset
   ```

   ...and look under the containers section --- or --

   ```
   kubectl get rs -o wide
   ```

   ...and look in the `IMAGES` column. Kubernetes accepts `rs` as shorthand for `replicaset`.

   </details>

1. <details>
   <summary>How many PODs are READY in the new-replica-set?</summary>

   ```
   kubectl get rs
   ```

   Look in the `READY` column.
   </details>

1. <details>
   <summary>Why do you think the PODs are not ready?</summary>

   ```
   kubectl describe pods
   ```

   Look in the `Events` section at the end.
   </details>

1. <details>
   <summary>Delete any one of the 4 PODs.</summary>

   ```
   kubectl get pods
   ```

   Choose any of the four.

   ```
   kubectl delete pod new-replica-set-XXXX
   ```
   </details>

1. <details>
   <summary>How many PODs exist now?</summary>

   ```
   kubectl get pods
   ```

   </details>

1. <details>
   <summary>Why are there still 4 PODs, even after you deleted one?</summary>
   > ReplicaSets ensures that desired number of PODs always run

   </details>

1. <details>
   <summary>Create a ReplicaSet using the replicaset-definition-1.yaml file located at /root/.</br>There is an issue with the file, so try to fix it.</summary>

   ```
   kubectl create -f replicaset-definition-1.yaml
   ```

   Note the error message.

   Get the apiVersion for replicaset

   ```
   $ kubectl explain replicaset | grep VERSION
   ```

   Update the replicaset definition file in `vi` with correct version and then retry creation.

   ```
   $ kubectl create -f replicaset-definition-1.yaml
   ```
   </details>

1. <details>
   <summary>Fix the issue in the replicaset-definition-2.yaml file and create a ReplicaSet using it.</summary>

   ```
   kubectl create -f replicaset-definition-1.yaml
   ```

   Note the error message.

   Selector matchLabels should match with POD labels - Update `replicaset-definition-2.yaml`

   The values for labels on lines 9 and 13 should match.

   ```
   $ kubectl create -f replicaset-definition-2.yaml
   ```
   </details>

1. <details>
   <summary>Delete the two newly created ReplicaSets - replicaset-1 and replicaset-2</summary>

   ```
   kubectl delete replicaset replicaset-1
   kubectl delete rs replicaset-2
   ```

   --- OR ---

   ```
   kubectl delete replicaset replicaset-1 replicaset-2
   ```

   </details>

1. <details>
   <summary>Fix the original replica set new-replica-set to use the correct busybox image.</summary>

   ```
   kubectl edit replicaset new-replica-set
   ```

   Edit the image to be `busybox`, save and exit.
   </details>

1. <details>
   <summary>Fix the original replica set new-replica-set to use the correct busybox image.</summary>

   ```
   kubectl edit replicaset new-replica-set
   ```

   Fix the image, save and exit.

   You will note if you do `kubectl get pods`, that they are still broken. ReplicaSets are not very smart and do not redeploy pods when the container specification has been edited.

   We must either delete and recreate the replicaset by exporting its YAML...

   ```
   kubectl get rs new-replica-set -o yaml > rs.yaml
   kubectl delete rs new-replica-set
   kunectl create -f rs.yaml
   ```

   -- OR --

   Delete each broken pod. The ReplicaSet will deploy a new one in its place which should be working.

   -- OR --

   Scale it to zero, then back to 4
   ```
   kubectl scale rs new-replica-set --replicas 0
   kubectl scale rs new-replica-set --replicas 4
   ```

   </details>

1. <details>
   <summary>Scale the ReplicaSet to 5 PODs.</summary>

   ```
   kubectl scale rs new-replica-set --replicas 5
   ```

   </details>




================================================
FILE: docs/02-Core-Concepts/16-Deployments.md
================================================
# Deployments
  - Take me to [Video Tutorial](https://kodekloud.com/topic/deployments-3/)

In this section, we will take a look at kubernetes deployments

#### Deployment is a kubernetes object. 
  
 ![deployment](../../images/deployment.PNG)
  
#### How do we create deployment?

```
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: myapp-deployment
      labels:
        app: myapp
        type: front-end
    spec:
     template:
        metadata:
          name: myapp-pod
          labels:
            app: myapp
            type: front-end
        spec:
         containers:
         - name: nginx-container
           image: nginx
     replicas: 3
     selector:
       matchLabels:
        type: front-end
 ```
- Once the file is ready, create the deployment using deployment definition file
  ```
  $ kubectl create -f deployment-definition.yaml
  ```
- To see the created deployment
  ```
  $ kubectl get deployment
  ```
- The deployment automatically creates a **`ReplicaSet`**. To see the replicasets
  ```
  $ kubectl get replicaset
  ```
- The replicasets ultimately creates **`PODs`**. To see the PODs
  ```
  $ kubectl get pods
  ```
    
  ![deployment1](../../images/deployment1.PNG)
  
- To see the all objects at once
  ```
  $ kubectl get all
  ```
  ![deployment2](../../images/deployment2.PNG)
  
K8s Reference Docs:
- https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
- https://kubernetes.io/docs/tutorials/kubernetes-basics/deploy-app/deploy-intro/
- https://kubernetes.io/docs/concepts/cluster-administration/manage-deployment/
- https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/


================================================
FILE: docs/02-Core-Concepts/17-Practice-Tests-Deployments.md
================================================
# Practice Test - Deployments
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-tests-deployments/)

Solutions to the deployments practice test
1. <details>
   <summary>How many pods exist on the system?</summary>

   ```bash
   kubectl get pods
   ```

   Count the number of pods (if any)

   </details>

1. <details>
   <summary>How many ReplicaSets exist on the system?</summary>

   ```bash
   kubectl get replicasets
   ```

   Count the number of ReplicaSets  (if any)

   </details>

1. <details>
   <summary>How many Deployments exist on the system?</summary>

   ```bash
   kubectl get deployments
   ```

   Count the number of Deployments  (if any)

   </details>

1. <details>
   <summary>How many Deployments exist on the system now?</summary>

   ```bash
   kubectl get deployments
   ```

   Count the number of Deployments  (if any)

   </details>

1. <details>
   <summary>How many ReplicaSets exist on the system now?</summary>

   ```bash
   kubectl get replicasets
   ```

   Count the number of ReplicaSets  (if any)

   </details>

1. <details>
   <summary>How many Pods exist on the system?</summary>

   ```bash
   kubectl get pods
   ```

   Count the number of pods  (if any)

   </details>

1. <details>
   <summary>Out of all the existing PODs, how many are ready?</summary>

   From the output of the previous command, check the `READY` column
   </details>

1. <details>
   <summary>What is the image used to create the pods in the new deployment?</summary>

   ```
   kubectl describe deployment
   ```

   Look under the containers section.

   Another way - run the following and check the `IMAGES` column

   ```
   kubectl get deployment -o wide
   ```
   </details>

1. <details>
   <summary>Why do you think the deployment is not ready?</summary>

   ```
   kubectl describe pods
   ```

   Look under the events section.
   </details>

1. <details>
   <summary>Create a new Deployment using the deployment-definition-1.yaml file located at /root/.</br>There is an issue with the file, so try to fix it.</summary>

   ```
   kubectl create -f deployment-definition-1.yaml
   ```

   Note the error

   Edit the file with `vi`...

   The value for **`kind`** is incorrect. It should be **`Deployment`** with a capital **`D`**. Update the deployment definition and create the deployment with the above command.

   </details>

1. <details>
   <summary>Create a new Deployment with the below attributes using your own deployment definition file.</summary>

   Create a deployment definition file in `vi`, e.g. `my-deployment.yaml` with the following

    ```yaml
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      labels:
        app: httpd-frontend
      name: httpd-frontend
    spec:
      replicas: 3
      selector:
        matchLabels:
          app: httpd-frontend
      template:
        metadata:
          labels:
            app: httpd-frontend
        spec:
          containers:
          - image: httpd:2.4-alpine
            name: httpd
    ```

   ```
   kubectl create -f my-deployment.yaml
   ```

   Or we could create it imperatively...

   ```
   kubectl create deployment httpd-frontend --image=httpd:2.4-alpine --replicas=3
   ```
   </details>



================================================
FILE: docs/02-Core-Concepts/18-Namespaces.md
================================================
# Namespaces
  - Take me to [Video Tutorial](https://kodekloud.com/topic/namespaces/)
  
In this section, we will take a look at **`Namespaces`**

So far in this course we have created **`Objects`** such as **`PODs`**, **`Deployments`** and **`Services`** in our cluster. Whatever we have been doing we have been doing in a **`NAMESPACE`**.
- This namespace is the **`default`** namespace in kubernetes. It is automatically created when kubernetes is setup initially.

  ![ns](../../images/ns.PNG)
 
- You can create your own namespaces as well.

  ![ns3](../../images/ns3.PNG)
  
- To list the pods in default namespace
  ```
  $ kubectl get pods
  ```
- To list the pods in another namespace. Use **`kubectl get pods`** command along with the **`--namespace`** flag or argument.
  ```
  $ kubectl get pods --namespace=kube-system
  ```
  ![ns8](../../images/ns8.PNG)
  
- Here we have a pod definition file, when we create a pod with pod-definition file, the pod is created in the default namespace.

```
apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
  labels:
     app: myapp
     type: front-end
spec:
  containers:
  - name: nginx-container
    image: nginx
 ```
  ```
  $ kubectl create -f pod-definition.yaml
  ```
- To create the pod with the pod-definition file in another namespace, use the **`--namespace`** option.
  ```
  $ kubectl create -f pod-definition.yaml --namespace=dev
  ```
  ![ns9](../../images/ns9.PNG)

- If you want to make sure that this pod gets you created in the **`dev`** env all the time, even if you don't specify in the command line, you can move the **`--namespace`** definition into the pod-definition file.
```
apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
  namespace: dev
  labels:
     app: myapp
     type: front-end
spec:
  containers:
  - name: nginx-container
    image: nginx
 ```
  
  ![ns10](../../images/ns10.PNG)
  
- To create a new namespace, create a namespace definition as shown below and then run **`kubectl create`**
```
apiVersion: v1
kind: Namespace
metadata:
  name: dev
```

  ```
  $ kubectl create -f namespace-dev.yaml
  ```
  Another way to create a namespace
  ```
  $ kubectl create namespace dev
  ```
  ![ns11](../../images/ns11.PNG)
  
- By default, we will be in a **`default`** namespace. To switch to a particular namespace permenently run the below command.
  ```
  $ kubectl config set-context $(kubectl config current-context) --namespace=dev
  ```
- To view pods in all namespaces
  ```
  $ kubectl get pods --all-namespaces
  ```
  ![ns12](../../images/ns12.PNG)
  
- To limit resources in a namespace, create a resource quota. To create one start with **`ResourceQuota`** definition file.
```
apiVersion: v1
kind: ResourceQuota
metadata:
  name: compute-quota
  namespace: dev
spec:
  hard:
    pods: "10"
    requests.cpu: "4"
    requests.memory: 5Gi
    limits.cpu: "10"
    limits.memory: 10Gi
```
  ```
  $ kubectl create -f compute-quota.yaml
  ```
  ![ns13](../../images/ns13.PNG)
  
K8s Reference Docs:
- https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
- https://kubernetes.io/docs/tasks/administer-cluster/namespaces-walkthrough/
- https://kubernetes.io/docs/tasks/administer-cluster/namespaces/
- https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/
- https://kubernetes.io/docs/tasks/access-application-cluster/list-all-running-container-images/
  
  


================================================
FILE: docs/02-Core-Concepts/19-Practice-Test-Namespaces.md
================================================
# Practice Test - Namespaces
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-namespaces/)

Solutions to practice test for namespaces

1. <details>
   <summary>How many Namespaces exist on the system?</summary>

   ```
   kubectl get namespace
   ```

   Count the number of namespaces (if any)
   </details>

1. <details>
   <summary>How many pods exist in the research namespace?</summary>

   ```
   kubectl get pods --namespace=research
   ```

   Count the number of pods (if any)
   </details>

1. <details>
   <summary>Create a POD in the finance namespace.</summary>

   ```
   kubectl run redis --image=redis --namespace=finance
   ```
   </details>

1. <details>
   <summary>Which namespace has the blue pod in it?</summary>

   ```
   kubectl get pods --all-namespaces
   ```

   Examine the output.

   Or use `grep` to filter the results, knowing that `NAMESPACE` is the first result column

   ```
   kubectl get pods --all-namespaces | grep blue
   ```

   </details>

1. <details>
   <summary>Access the Blue web application using the link above your terminal!!</summary>

   Press the `blue-application-ui` button at the top of the terminal. Try the following:

   ```
   Host Name: db-service
   Host Port: 6379
   ```
   </details>

1. <details>
   <summary>What DNS name should the Blue application use to access the database db-service in its own namespace - marketing?</summary>

   > db-service

   To access services in the same namespace, only the host name part of the fully qualified domain name (FQDN) is required.

   </details>

1. <details>
   <summary>What DNS name should the Blue application use to access the database db-service in the dev namespace?</summary>

   Either FQDN

   > db-service.dev.svc.cluster.local

   Or, it is sufficient just to append the namespace name

   > db-service.dev

   </details>



================================================
FILE: docs/02-Core-Concepts/20-Services.md
================================================
# Kubernetes Services
  - Take me to [Video Tutorial](https://kodekloud.com/topic/services-3/)
  
In this section we will take a look at **`services`** in kubernetes

## Services
- Kubernetes Services enables communication between various components within and outside of the application.

  ![srv1](../../images/srv1.PNG)
  
#### Let's look at some other aspects of networking

## External Communication

- How do we as an **`external user`** access the **`web page`**?

  - From the node (Able to reach the application as expected)
  
    ![srv2](../../images/srv2.PNG)
    
  - From outside world (This should be our expectation, without something in the middle it will not reach the application)
  
    ![srv3](../../images/srv3.PNG)
   
    
 ## Service Types
 
 #### There are 3 types of service types in kubernetes
 
   ![srv-types](../../images/srv-types.PNG)
 
 1. NodePort
    - Where the service makes an internal port accessible on a port on the NODE.
      ```
      apiVersion: v1
      kind: Service
      metadata:
       name: myapp-service
      spec:
       types: NodePort
       ports:
       - targetPort: 80
         port: 80
         nodePort: 30008
      ```
     ![srvnp](../../images/srvnp.PNG)
      
      #### To connect the service to the pod
      ```
      apiVersion: v1
      kind: Service
      metadata:
       name: myapp-service
      spec:
       type: NodePort
       ports:
       - targetPort: 80
         port: 80
         nodePort: 30008
       selector:
         app: myapp
         type: front-end
       ```

    ![srvnp1](../../images/srvnp1.PNG)
      
      #### To create the service
      ```
      $ kubectl create -f service-definition.yaml
      ```
      
      #### To list the services
      ```
      $ kubectl get services
      ```
      
      #### To access the application from CLI instead of web browser
      ```
      $ curl http://192.168.1.2:30008
      ```
      
      ![srvnp2](../../images/srvnp2.PNG)

      #### A service with multiple pods
      
      ![srvnp3](../../images/srvnp3.PNG)
      
      #### When Pods are distributed across multiple nodes
     
      ![srvnp4](../../images/srvnp4.PNG)
     
            
 1. ClusterIP
    - In this case the service creates a **`Virtual IP`** inside the cluster to enable communication between different services such as a set of frontend servers to a set of backend servers.
    
 1. LoadBalancer
    - Where the service provisions a **`loadbalancer`** for our application in supported cloud providers.
    
K8s Reference Docs:
- https://kubernetes.io/docs/concepts/services-networking/service/
- https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/



================================================
FILE: docs/02-Core-Concepts/21-Services-ClusterIP.md
================================================
# Kubernetes Services - ClusterIP
  - Take me to [Video Tutorial](https://kodekloud.com/topic/services-cluster-ip-2/)
  
In this section we will take a look at **`services - ClusterIP`** in kubernetes
         
## ClusterIP
- In this case the service creates a **`Virtual IP`** inside the cluster to enable communication between different services such as a set of frontend servers to a set of backend servers.
    
    ![srvc1](../../images/srvc1.PNG)
    
#### What is a right way to establish connectivity between these services or tiers  
- A kubernetes service can help us group the pods together and provide a single interface to access the pod in a group.

  ![srvc2](../../images/srvc2.PNG)
  
#### To create a service of type ClusterIP
```
apiVersion: v1
kind: Service
metadata:
 name: back-end
spec:
 types: ClusterIP
 ports:
 - targetPort: 80
   port: 80
 selector:
   app: myapp
   type: back-end
```
```
$ kubectl create -f service-definition.yaml
```

#### To list the services
```
$ kubectl get services
```
  ![srvc3](../../images/srvc3.PNG)
   
K8s Reference Docs:
- https://kubernetes.io/docs/concepts/services-networking/service/
- https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/


================================================
FILE: docs/02-Core-Concepts/22-Practice-Test-Services.md
================================================
# Practice Test - Services
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-services/)

#### Solutions to Practice test - Services

1. <details>
    <summary>How many Services exist on the system?</summary>

    ```
    kubectl get services
    ```

    Count the number of services (if any)
    </details>


1. Information only

1.  <details>
    <summary>What is the type of the default kubernetes service?</summary>

    From the output of Q1, examine the `TYPE` column.
    </details>

1.  <details>
    <summary>What is the targetPort configured on the kubernetes service?</summary>

    ```
    $ kubectl describe service | grep TargetPort
    ```
    </details>

1.  <details>
    <summary>How many labels are configured on the kubernetes service?</summary>

    ```
    kubectl describe service
    ```

    ...and look for labels.

    --- OR ---

    ```
    kubectl get service --show-labels
    ```

    </details>

1.  <details>
    <summary>How many Endpoints are attached on the kubernetes service?</summary>

    ```
    kubectl describe service
    ```

    ...and look for endpoints

    </details>

1.  <details>
    <summary>How many Deployments exist on the system now?</summary>

    ```
    kubectl get deployment
    ```

    Count the deployments (if any)
    </details>

1.  <details>
    <summary>What is the image used to create the pods in the deployment?</summary>

    ```
    kubectl describe deployment
    ```

    Look in the containers section.

    --- OR ---

    ```
    kubectl get deployment -o wide
    ```

    Look in the `IMAGES` column

    </details>

1.  <details>
    <summary>Are you able to access the Web App UI?</summary>

    Try to access the Web Application UI using the tab simple-webapp-ui above the terminal.

    </details>

1.  <details>
    <summary>Create a new service to access the web application using the service-definition-1.yaml file.</summary>

    ```
    vi service-definition-1.yaml
    ```

    Fill in the values as directed, save and exit.

    ```
    kubectl create -f service-definition-1.yaml
    ```
    </details>

1. Test newly deployed service.



================================================
FILE: docs/02-Core-Concepts/23-Imperative-Commands-with-kubectl.md
================================================
# Certification Tips - Imperative Commands with kubectl
  - Take me to the [Certification tips page](https://kodekloud.com/topic/certification-tips-imperative-commands-with-kubectl/)



================================================
FILE: docs/02-Core-Concepts/24-Practice-Test-Imperative-Commands.md
================================================
# Practice Test - Imperative Commands
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-imperative-commands-2/)

Solutions for Practice Test - Imperative Commands

1. Information

1.  <details>
    <summary>Deploy a pod named nginx-pod using the nginx:alpine image.</summary>

    ```
    kubectl run nginx-pod --image=nginx:alpine
    ```
    </details>

1.  <details>
    <summary>Deploy a redis pod using the redis:alpine image with the labels set to tier=db.</summary>

    ```
    kubectl run redis --image=redis:alpine -l tier=db
    ```
    </details>

1.  <details>
    <summary>Create a service redis-service to expose the redis application within the cluster on port 6379.</summary>

    ```
    kubectl expose pod redis --port=6379 --name redis-service
    ```
    </details>

1.  <details>
    <summary>Create a deployment named webapp using the image kodekloud/webapp-color with 3 replicas.</summary>

    ```
    kubectl create deployment webapp --image=kodekloud/webapp-color --replicas=3
    ```
    </details>

1.  <details>
    <summary>Create a new pod called custom-nginx using the nginx image and expose it on container port 8080.</summary>

    ```
    kubectl run custom-nginx --image=nginx --port=8080
    ```
    </details>

1.  <details>
    <summary>Create a new namespace called dev-ns.</summary>

    ```
    kubectl create ns dev-ns
    ```
    </details>

1.  <details>
    <summary>Create a new deployment called redis-deploy in the dev-ns namespace with the redis image. It should have 2 replicas.</summary>

    ```
    kubectl create deployment redis-deploy -n dev-ns --image redis --replicas 2
    ```
    </details>

1.  <details>
    <summary>Create a pod called httpd using the image httpd:alpine in the default namespace.</br>Next, create a service of type ClusterIP by the same name (httpd).</br>The target port for the service should be 80.</summary>

    ```
    kubectl run httpd --image httpd:alpine --expose --port 80
    ```
    </details>




================================================
FILE: docs/02-Core-Concepts/25-Attachments.md
================================================
# KodeKloud - CKA Course Documents
  - Take me to the [Presentation Deck - 1](https://kodekloud.com/topic/attachments/)
  - Take me to the [Presentation Deck - 2](https://kodekloud.com/topic/download-presentation-deck-for-this-section-1/)



================================================
FILE: docs/03-Scheduling/01-Scheduling-Section-Introduction.md
================================================
# Scheduling Section Introduction
  - Take me to [Video Tutorial](https://kodekloud.com/topic/scheduling-section-introduction/)


================================================
FILE: docs/03-Scheduling/02-Manual-Scheduling.md
================================================
# Manual Scheduling
  - Take me to [Video Tutorial](https://kodekloud.com/topic/manual-scheduling/)
  
In this section, we will take a look at **`Manually Scheduling`** a **`POD`** on a node.

## How Scheduling Works
- What do you do when you do not have a scheduler in your cluster?
  - Every POD has a field called NodeName that by default is not set. You don't typically specify this field when you create the manifest file, kubernetes adds it automatically.
  - Once identified it schedules the POD on the node by setting the nodeName property to the name of the node by creating a binding object.
    ```
    apiVersion: v1
    kind: Pod
    metadata:
     name: nginx
     labels:
      name: nginx
    spec:
     containers:
     - name: nginx
       image: nginx
       ports:
       - containerPort: 8080
     nodeName: node02
    ```
    ![sc1](../../images/sc1.png)
    
## No Scheduler
  - You can manually assign pods to node itself. Well without a scheduler, to schedule pod is to set **`nodeName`** property in your pod definition file while creating a pod.
    
    ![sc2](../../images/sc2.PNG)
    
  - Another way
    ```
    apiVersion: v1
    kind: Binding
    metadata:
      name: nginx
    target:
      apiVersion: v1
      kind: Node
      name: node02
    ```
    ```
    apiVersion: v1
    kind: Pod
    metadata:
     name: nginx
     labels:
      name: nginx
    spec:
     containers:
     - name: nginx
       image: nginx
       ports:
       - containerPort: 8080
    ```
    ![sc3](../../images/sc3.PNG)
    
    
K8s Reference Docs:
- https://kubernetes.io/docs/reference/using-api/api-concepts/
- https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodename
    
    
   


================================================
FILE: docs/03-Scheduling/03-Practice-Test-Manual-Scheduling.md
================================================
# Practice Test - Manual Scheduling
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-manual-scheduling/)

Solutions to Practice Test - Manual Scheduling

1.  <details>
    <summary>A pod definition file nginx.yaml is given. Create a pod using the file.</summary>

    ```
    kubectl create -f nginx.yaml
    ```
    </details>

1.  <details>
    <summary>What is the status of the created POD?</summary>

    ```
    kubectl get pods
    ```

    Examine the `STATUS` column
    </details>

1.  <details>
    <summary>Why is the POD in a pending state?</br>Inspect the environment for various kubernetes control plane components.</summary>

    ```
    kubectl get pods --namespace kube-system
    ```

    There is a key pod missing here!
    </details>

1.  <details>
    <summary>Manually schedule the pod on node01.</summary>

    We will have to delete and recereate the pod, as the only property that may be edited on a running container is `image`

    ```
    vi nginx.yaml
    ```

    Make the following edit

    ```yaml
    ---
    apiVersion: v1
    kind: Pod
    metadata:
      name: nginx
    spec:
      nodeName: node01    # add this line
      containers:
      -  image: nginx
         name: nginx
    ```

    ```
    kubectl delete -f nginx.yaml
    kubectl create -f nginx.yaml
    ```
    </details>

1.  <details>
    <summary>Now schedule the same pod on the controlplane node.</summary>

    Repeat the steps as per the previous question. Edit `nodeName` to be `controlplane`
  </details>



================================================
FILE: docs/03-Scheduling/04-Labels-and-Selectors.md
================================================
# Labels and Selectors
  - Take me to [Video Tutorial](https://kodekloud.com/topic/labels-and-selectors/)
  
In this section, we will take a look at **`Labels and Selectors`**

#### Labels and Selectors are standard methods to group things together.
  
#### Labels are properties attached to each item.

  ![labels-ckc](../../images/labels-ckc.PNG)
  
#### Selectors help you to filter these items
 
  ![sl](../../images/sl.PNG)
  
How are labels and selectors are used in kubernetes?
- We have created different types of objects in kubernetes such as **`PODs`**, **`ReplicaSets`**, **`Deployments`** etc.
  
  ![ls](../../images/ls.PNG)
  
How do you specify labels?
   ```
    apiVersion: v1
    kind: Pod
    metadata:
     name: simple-webapp
     labels:
       app: App1
       function: Front-end
    spec:
     containers:
     - name: simple-webapp
       image: simple-webapp
       ports:
       - containerPort: 8080
   ```
 ![lpod](../../images/lpod.PNG)
 
Once the pod is created, to select the pod with labels run the below command
```
$ kubectl get pods --selector app=App1
```

Kubernetes uses labels to connect different objects together
   ```
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
      name: simple-webapp
      labels:
        app: App1
        function: Front-end
    spec:
     replicas: 3
     selector:
       matchLabels:
        app: App1
     template:
       metadata:
         labels:
           app: App1
           function: Front-end
       spec:
         containers:
         - name: simple-webapp
           image: simple-webapp   
   ```

  ![lrs](../../images/lrs.PNG)

For services
 
      ```
      apiVersion: v1
      kind: Service
      metadata:
       name: my-service
      spec:
       selector:
         app: App1
       ports:
       - protocol: TCP
         port: 80
         targetPort: 9376 
       ```
  ![lrs1](../../images/lrs1.PNG)
  
## Annotations
- While labels and selectors are used to group objects, annotations are used to record other details for informative purpose.
    ```
    apiVersion: apps/v1
    kind: ReplicaSet
    metadata:
      name: simple-webapp
      labels:
        app: App1
        function: Front-end
      annotations:
         buildversion: 1.34
    spec:
     replicas: 3
     selector:
       matchLabels:
        app: App1
    template:
      metadata:
        labels:
          app: App1
          function: Front-end
      spec:
        containers:
        - name: simple-webapp
          image: simple-webapp   
    ```
  ![annotations](../../images/annotations.PNG)

K8s Reference Docs:
- https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/


================================================
FILE: docs/03-Scheduling/05-Practice-Test-Labels-and-Selectors.md
================================================
# Practice Test - Labels and Selectors
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-labels-and-selectors/)

Solutions to Practice Test - Labels and Selectors
1.  <details>
    <summary>We have deployed a number of PODs. They are labelled with tier, env and bu. How many PODs exist in the dev environment (env)?</summary>

    Here we are filtering pods by the value olf a label

    ```
    kubectl get pods --selector env=dev
    ```

    Count the pods (if any)

    </details>

1.  <details>
    <summary>How many PODs are in the finance business unit (bu)?</summary>

    Similarly ...

    ```
    kubectl get pods --selector bu=finance
    ```

    Count the pods (if any)
    </details>

1.  <details>
    <summary>How many objects are in the prod environment including PODs, ReplicaSets and any other objects?</summary>

    ```
    kubectl get all --selector env=prod
    ```

    Count everything (if anything)
    </details>

1.  <details>
    <summary>Identify the POD which is part of the prod environment, the finance BU and of frontend tier?</summary>

    We can combine label expressions with comma. Only items with _all_ the given label/value pairs will be returned, i.e. it is an `and` condition.

    ```
    kubectl get all --selector env=prod,bu=finance,tier=frontend
    ```
    </details>

1. <details>
   <summary>A ReplicaSet definition file is given replicaset-definition-1.yaml. Try to create the replicaset. There is an issue with the file. Try to fix it.</summary>

   ```
   kubectl create -f replicaset-definition-1.yaml
   ```

   Note the error message.

   Selector matchLabels should match with POD labels - Update `replicaset-definition-2.yaml`

   The values for labels on lines 9 and 13 should match.

   ```
   $ kubectl create -f replicaset-definition-2.yaml
   ```
   </details>



================================================
FILE: docs/03-Scheduling/06-Taints-and-Tolerations.md
================================================
# Taints and Tolerations
  - Take me to [Video Tutorial](https://kodekloud.com/topic/taints-and-tolerations-2/)
  
In this section, we will take a look at taints and tolerations.
- Pod to node relationship and how you can restrict what pods are placed on what nodes.

#### Taints and Tolerations are used to set restrictions on what pods can be scheduled on a node. 
- Only pods which are tolerant to the particular taint on a node will get scheduled on that node.

  ![tandt](../../images/tandt.PNG)
  
## Taints
- Use **`kubectl taint nodes`** command to taint a node.

  Syntax
  ```
  $ kubectl taint nodes <node-name> key=value:taint-effect
  ```
 
  Example
  ```
  $ kubectl taint nodes node1 app=blue:NoSchedule
  ```
  
- The taint effect defines what would happen to the pods if they do not tolerate the taint.
- There are 3 taint effects
  - **`NoSchedule`**
  - **`PreferNoSchedule`**
  - **`NoExecute`**
  
  ![tn](../../images/tn.PNG)
  
## Tolerations
   - Tolerations are added to pods by adding a **`tolerations`** section in pod definition.
     ```
     apiVersion: v1
     kind: Pod
     metadata:
      name: myapp-pod
     spec:
      containers:
      - name: nginx-container
        image: nginx
      tolerations:
      - key: "app"
        operator: "Equal"
        value: "blue"
        effect: "NoSchedule"
     ```
    
  ![tp](../../images/tp.PNG)
    

#### Taints and Tolerations do not tell the pod to go to a particular node. Instead, they tell the node to only accept pods with certain tolerations.
- To see this taint, run the below command
  ```
  $ kubectl describe node kubemaster |grep Taint
  ```
 
 ![tntm](../../images/tntm.PNG)
  
     
#### K8s Reference Docs
- https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/



================================================
FILE: docs/03-Scheduling/07-Practice-Test-Taints-and-Tolerations.md
================================================
# Practice Test - Taints and Tolerations
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-taints-and-tolerations/)

Solutions to the Practice Test - Taints and Tolerations

1.  <details>
    <summary>How many nodes exist on the system?</summary>

    ```
    $ kubectl get nodes
    ```

    Count the nodes

    </details>

1.  <details>
    <summary>Do any taints exist on node01 node?</summary>

    ```
    $ kubectl describe node node01
    ```

    Find the `Taints` property in the output.
    </details>

1.  <details>
    <summary>Create a taint on node01 with key of spray, value of mortein and effect of NoSchedule</summary>

    ```
    kubectl taint nodes node01 spray=mortein:NoSchedule
    ```
    </details>

1.  <details>
    <summary>Create a new pod with the nginx image and pod name as mosquito.</summary>

    ```
    kubectl run mosquito --image nginx
    ```
    </details>

1.  <details>
    <summary>What is the state of the POD?</summary>

    ```
    kubectl get pods
    ```

    Check the `STATUS` column
    </details>

1.  <details>
    <summary>Why do you think the pod is in a pending state?</summary>

    Mosqitoes don't like mortein!

    So the answer is that the pod cannot tolerate the taint on the node.

    </details>

1.  <details>
    <summary>Create another pod named bee with the nginx image, which has a toleration set to the taint mortein.</summary>

    Allegedly bees are immune to mortein!

    1.  Create a YAML skeleton for the pod imperatively

        ```
        kubectl run bee --image nginx --dry-run=client -o yaml > bee.yaml
        ```
    1.  Edit the file to add the toleration
        ```
        vi bee.yaml
        ```
    1. Add the toleration. This goes at the same indentation level as `containers` as it is a POD setting.
        ```yaml
          tolerations:
          - key: spray
            value: mortein
            effect: NoSchedule
            operator: Equal
        ```
    1. Save and exit, then create pod
        ```
        kubectl create -f bee.yaml
        ```
    </details>

1. Information only.

1.  <details>
    <summary>Do you see any taints on controlplane node?</summary>

    ```
    kubectl describe node controlplane
    ```

    Examine the `Taints` property.
    </details>

1.  <details>
    <summary>Remove the taint on controlplane, which currently has the taint effect of NoSchedule.</summary>

    ```
    kubectl taint nodes controlplane node-role.kubernetes.io/control-plane:NoSchedule-
    ```
    </details>

1.  <details>
    <summary>What is the state of the pod mosquito now?</summary>

    ```
    $ kubectl get pods
    ```
    </details>

1.  <details>
    <summary>Which node is the POD mosquito on now?</summary>

    ```
    $ kubectl get pods -o wide
    ```

    This also explains why the `mosquito` pod colud schedule anywhere. It also could not tolerate `controlplane` taints, which we have now removed.
    </details>




================================================
FILE: docs/03-Scheduling/08-Node-Selectors.md
================================================
# Node Selectors
  - Take me to [Video Tutorial](https://kodekloud.com/topic/node-selectors/)

In this section, we will take a look at Node Selectors in Kubernetes

#### We add new property called Node Selector to the spec section and specify the label.
- The scheduler uses these labels to match and identify the right node to place the pods on.
  ```
  apiVersion: v1
  kind: Pod
  metadata:
   name: myapp-pod
  spec:
   containers:
   - name: data-processor
     image: data-processor
   nodeSelector:
    size: Large
  ```
![nsel](../../images/nsel.PNG)
  
- To label nodes

  Syntax
  ```
  $ kubectl label nodes <node-name> <label-key>=<label-value>
  ```
  Example
  ```
  $ kubectl label nodes node-1 size=Large
  ```
  
![ln](../../images/ln.PNG)
  
- To create a pod definition
  ```
  apiVersion: v1
  kind: Pod
  metadata:
   name: myapp-pod
  spec:
   containers:
   - name: data-processor
     image: data-processor
   nodeSelector:
    size: Large
  ```
  ```
  $ kubectl create -f pod-definition.yml
  ```
  
![nsel](../../images/nsel.PNG)
  
## Node Selector - Limitations
- We used a single label and selector to achieve our goal here. But what if our requirement is much more complex.
  
![nsl](../../images/nsl.PNG)
 
- For this we have **`Node Affinity and Anti Affinity`**
  
#### K8s Reference Docs
- https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector







================================================
FILE: docs/03-Scheduling/09-Node-Affinity.md
================================================
# Node Affinity
  - Take me to the [Video Tutorial](https://kodekloud.com/topic/node-affinity-2/)
  
In this section, we will talk about "Node Affinity" feature in kubernetes.

#### The primary feature of Node Affinity is to ensure that the pods are hosted on particular nodes.
- With **`Node Selectors`** we cannot provide the advance expressions.
  ```
  apiVersion: v1
  kind: Pod
  metadata:
   name: myapp-pod
  spec:
   containers:
   - name: data-processor
     image: data-processor
   nodeSelector:
    size: Large
  ```
  ![ns-old](../../images/ns-old.PNG)
  ```
  apiVersion: v1
  kind: Pod
  metadata:
   name: myapp-pod
  spec:
   containers:
   - name: data-processor
     image: data-processor
   affinity:
     nodeAffinity:
       requiredDuringSchedulingIgnoredDuringExecution:
          nodeSelectorTerms:
          - matchExpressions:
            - key: size
              operator: In
              values: 
              - Large
              - Medium
  ```
  ![na](../../images/na.PNG)
  
  ```
  apiVersion: v1
  kind: Pod
  metadata:
   name: myapp-pod
  spec:
   containers:
   - name: data-processor
     image: data-processor
   affinity:
     nodeAffinity:
       requiredDuringSchedulingIgnoredDuringExecution:
          nodeSelectorTerms:
          - matchExpressions:
            - key: size
              operator: NotIn
              values: 
              - Small
  ```
  ![na1](../../images/na1.PNG)
  
  ```
  apiVersion: v1
  kind: Pod
  metadata:
   name: myapp-pod
  spec:
   containers:
   - name: data-processor
     image: data-processor
   affinity:
     nodeAffinity:
       requiredDuringSchedulingIgnoredDuringExecution:
          nodeSelectorTerms:
          - matchExpressions:
            - key: size
              operator: Exists
  ```
  
  ![na2](../../images/na2.PNG)
  

## Node Affinity Types
- Available
  - requiredDuringSchedulingIgnoredDuringExecution
  - preferredDuringSchedulingIgnoredDuringExecution
- Planned
  - requiredDuringSchedulingRequiredDuringExecution
  - preferredDuringSchedulingRequiredDuringExecution
  
  ![nat](../../images/nat.PNG)
  
## Node Affinity Types States

  ![nats](../../images/nats.PNG)
  
  ![nats1](../../images/nats1.PNG)
  
#### K8s Reference Docs
- https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/
- https://kubernetes.io/blog/2017/03/advanced-scheduling-in-kubernetes/


================================================
FILE: docs/03-Scheduling/10-Practice-Test-Node-Affinity.md
================================================
# Practice Test - Node Affinity
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-node-affinity-2/)

Solutions to practice test - node affinity

1.  <details>
    <summary>How many Labels exist on node node01?</summary>

    ```
    kubectl describe node node01
    ```

    Look under `Labels` section

    --- OR ---

    ```
    kubectl get node node01 --show-labels
    ```

    </details>

1.  <details>
    <summary>What is the value set to the label key beta.kubernetes.io/arch on node01?</summary>

    From the output of Q1, find the answer there.
    </details>

1.  <details>
    <summary>Apply a label color=blue to node node01</summary>

    ```
    kubectl label node node01 color=blue
    ```
    </details>

1.  <details>
    <summary>Create a new deployment named blue with the nginx image and 3 replicas.</summary>

    ```
    kubectl create deployment blue --image=nginx --replicas=3
    ```
    </details>

1.  <details>
    <summary>Which nodes can the pods for the blue deployment be placed on?</summary>


    Check if master and node01 have any taints on them that will prevent the pods to be scheduled on them. If there are no taints, the pods can be scheduled on either node.

    ```
    kubectl describe nodes controlplane | grep -i taints
    kubectl describe nodes node01 | grep -i taints
    ```
    </details>

1.  <details>
    <summary>Set Node Affinity to the deployment to place the pods on node01 only.</summary>
    Now we edit in place the deployment we created earlier. Remember that we labelled `node01` with `color=blue`? Now we are going to create an affinity to that label, which will "attract" the pods of the deployment to it.

    1.
        ```
        $ kubectl edit deployment blue
        ```
    1. Add the YAML below under the template.spec section, i.e. at the same level as `containers` as it is a POD setting. The affinity will be considered only during scheduling stage, however this edit will cause the deployment to roll out again.

      ```yaml
        affinity:
          nodeAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
              nodeSelectorTerms:
              - matchExpressions:
                - key: color
                  operator: In
                  values:
                  - blue
      ```
    </details>

1. <details>
    <summary>Which nodes are the pods placed on now?</summary>

    ```
    $ kubectl get pods -o wide
    ```
    </details>

1.  <details>
    <summary>Create a new deployment named red with the nginx image and 2 replicas, and ensure it gets placed on the controlplane node only.</summary>

    1. Create a YAML template for the deploymemt

        ```
        kubectl create deployment red --image nginx --replicas 2 --dry-run=client -o yaml > red.yaml
        ```
    1. Edit the file
        ```
        vi red.yaml
        ```
    1.  Add the toleration using the label stated in the question, and placing it as before for the `blue` deployment
      ```yaml
        affinity:
          nodeAffinity:
            requiredDuringSchedulingIgnoredDuringExecution:
              nodeSelectorTerms:
              - matchExpressions:
                - key: node-role.kubernetes.io/control-plane
                  operator: Exists
      ```
    1. Save, exit and create the deployment
      ```
      kubectl create -f red.yaml
      ```
    1. Check the result
      ```
      $ kubectl get pods -o wide
      ```
    </details>





================================================
FILE: docs/03-Scheduling/11.Taints-and-Tolerations-vs-Node-Affinity.md
================================================
# Taints and Tolerations vs Node Affinity
  - Take me to [Video Tutorial](https://kodekloud.com/topic/taints-and-tolerations-vs-node-affinity/)

In this section, we will take a look at Taints and Tolerations vs Node Affinity
- Taints and Tolerations do not guarantee that the pods will only prefer these nodes; in this case, the red pods may end up on one of the other nodes that do not have a taint or toleration set.
  
  ![tn-na](../../images/tn-na.PNG)
  
 
- As such, a combination of taints and tolerations and node affinity rules can be used together to completely dedicate nodes for specific parts.

  ![tn-nsa](../../images/tn-nsa.png)

  
#### K8s Reference Docs:
- https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
- https://kubernetes.io/docs/tasks/configure-pod-container/assign-pods-nodes-using-node-affinity/


================================================
FILE: docs/03-Scheduling/12-Resource-Limits.md
================================================
# Resource Limits
  - Take me to [Video Tutorials](https://kodekloud.com/topic/resource-limits/)
  
In this section we will take a look at Resource Limits

#### Let us take a look at 3 node kubernetes cluster.
- Each node has a set of CPU, Memory and Disk resources available.
- If there is no sufficient resources available on any of the nodes, kubernetes holds the scheduling the pod. You will see the pod in pending state. If you look at the events, you will see the reason as insufficient CPU.
  
  ![rl](../../images/rl.PNG)
  
## Resource Requirements
- By default, K8s assume that a pod or container within a pod requires **`0.5`** CPU and **`256Mi`** of memory. This is known as the **`Resource Request` for a container**.
  
  ![rr](../../images/rr.PNG)
  
- If your application within the pod requires more than the default resources, you need to set them in the pod definition file.

  ```
  apiVersion: v1
  kind: Pod
  metadata:
    name: simple-webapp-color
    labels:
      name: simple-webapp-color
  spec:
   containers:
   - name: simple-webapp-color
     image: simple-webapp-color
     ports:
      - containerPort:  8080
     resources:
       requests:
        memory: "1Gi"
        cpu: "1"
  ```
  ![rr-pod](../../images/rr-pod.PNG) 
   
## Resources - Limits
- By default, k8s sets resource limits to 1 CPU and 512Mi of memory
  
  ![rsl](../../images/rsl.PNG)
  
- You can set the resource limits in the pod definition file.
  
  ```
  apiVersion: v1
  kind: Pod
  metadata:
    name: simple-webapp-color
    labels:
      name: simple-webapp-color
  spec:
   containers:
   - name: simple-webapp-color
     image: simple-webapp-color
     ports:
      - containerPort:  8080
     resources:
       requests:
        memory: "1Gi"
        cpu: "1"
       limits:
         memory: "2Gi"
         cpu: "2"
  ```
  ![rsl1](../../images/rsl1.PNG)
  
#### Note: Remember Requests and Limits for resources are set per container in the pod.
  
## Exceed Limits
- what happens when a pod tries to exceed resources beyond its limits?

   ![el](../../images/el.PNG)
   
  
#### K8s Reference Docs:
- https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
  
  


================================================
FILE: docs/03-Scheduling/13-Practice-Test-Resource-Limits.md
================================================
# Practice Test - Resource Limits
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-resource-limits/)
  
Solutions to practice test - resource limtis
- Run the command 'kubectl describe pod rabbit' and inspect requests.
  
  <details>

  ```
  $ kubectl describe pod rabbit
  ```
  </details>

- Run the command 'kubectl delete pod rabbit'.

  <details>

  ```
  $ kubectl delete pod rabbit
  ```
  </details>

- Run the command 'kubectl get pods' and inspect the status of the pod elephant

  <details>

  ```
  $ kubectl get pods
  ```
  </details>

- The status 'OOMKilled' indicates that the pod ran out of memory. Identify the memory limit set on the POD.

- Generate a template of the existing pod.

  <details>

  ```
  $ kubectl get pods elephant -o yaml > elephant.yaml
  ```
  </details>

  Update the elephant.yaml pod definition with the resource memory limits to 20Mi
  
  <details>

  ```
  resources:
      limits:
        memory: 20Mi
  ---
  ```
  </details>

  Delete the pod and recreate it.
  
  <details>

  ```
  $ kubectl delete pod elephant
  $ kubectl create -f elephant.yaml
  ```
  </details>

- Inspect the status of POD. Make sure it's running
  
  <details>

  ```
  $ kubectl get pods
  ```
  </details>

- Run the command 'kubectl delete pod elephant'.

  <details>

  ```
  $ kubectl delete pod elephant
  ```
  </details>





================================================
FILE: docs/03-Scheduling/14-DaemonSets.md
================================================
# DaemonSets
  - Take me to [Video Tutorial](https://kodekloud.com/topic/daemonsets/)

In this section, we will take a look at DaemonSets.

#### DaemonSets are like replicasets, as it helps in to deploy multiple instances of pod. But it runs one copy of your pod on each node in your cluster.
  
  ![ds](../../images/ds.PNG)
  
## DaemonSets - UseCases

  ![ds-uc](../../images/ds-uc.PNG)
  
  ![ds-uc-kp](../../images/ds-uc-kp.PNG)
  
  ![ds-ucn](../../images/ds-ucn.PNG)
  
## DaemonSets - Definition
- Creating a DaemonSet is similar to the ReplicaSet creation process.
- For DaemonSets, we start with apiVersion, kind as **`DaemonSets`** instead of **`ReplicaSet`**, metadata and spec. 
  ```
  apiVersion: apps/v1
  kind: Replicaset
  metadata:
    name: monitoring-daemon
    labels:
      app: nginx
  spec:
    selector:
      matchLabels:
        app: monitoring-agent
    template:
      metadata:
       labels:
         app: monitoring-agent
      spec:
        containers:
        - name: monitoring-agent
          image: monitoring-agent
  ```
  
  ```
  apiVersion: apps/v1
  kind: DaemonSet
  metadata:
    name: monitoring-daemon
    labels:
      app: nginx
  spec:
    selector:
      matchLabels:
        app: monitoring-agent
    template:
      metadata:
       labels:
         app: monitoring-agent
      spec:
        containers:
        - name: monitoring-agent
          image: monitoring-agent
  ```
  ![dsd](../../images/dsd.PNG)
  
- To create a daemonset from a definition file
  ```
  $ kubectl create -f daemon-set-definition.yaml
  ```

## View DaemonSets
- To list daemonsets
  ```
  $ kubectl get daemonsets
  ```
- For more details of the daemonsets
  ```
  $ kubectl describe daemonsets monitoring-daemon
  ```
  ![ds1](../../images/ds1.PNG)
  
## How DaemonSets Works

  ![ds2](../../images/ds2.PNG)

#### K8s Reference Docs
- https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#writing-a-daemonset-spec


================================================
FILE: docs/03-Scheduling/15-Practice-Test-DaemonSets.md
================================================
# Practice Test - DaemonSets
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-daemonsets/)
  
Solutions to practice test daemonsets
- Run the command kubectl get daemonsets --all-namespaces
  
  <details>

  ```
  $ kubectl get daemonsets --all-namespaces
  ```
  </details>

- Run the command kubectl get daemonsets --all-namespaces

  <details>

  ```
  $ kubectl get daemonsets --all-namespaces
  ```
  </details>

- Run the command kubectl get all --all-namespaces and identify the types

  <details>

  ```
  $ kubectl get all --all-namespaces
  ```
  </details>

- Run the command kubectl describe daemonset kube-proxy --namespace=kube-system

  <details>

  ```
  $ kubectl describe daemonset kube-proxy --namespace=kube-system
  ```
  </details>

- Run the command kubectl describe daemonset kube-flannel-ds-amd64 --namespace=kube-system

  <details>

  ```
  $ kubectl describe daemonset kube-flannel-ds-amd64 --namespace=kube-system
  ```
  </details>
    
- Create a daemonset

  <details>

  ```
  $ vi ds.yaml
  ```

  ```
  apiVersion: apps/v1
  kind: DaemonSet
  metadata:
    name: elasticsearch
    namespace: kube-system
    labels:
      k8s-app: fluentd-logging
  spec:
    selector:
      matchLabels:
        name: elasticsearch
    template:
      metadata:
        labels:
          name: elasticsearch
      spec:
        tolerations:
        # this toleration is to have the daemonset runnable on master nodes
        # remove it if your masters can't run pods
        - key: node-role.kubernetes.io/master
          effect: NoSchedule
        containers:
        - name: elasticsearch
          image: k8s.gcr.io/fluentd-elasticsearch:1.20
  ```
  </details>

- To create the daemonset and list the daemonsets and pods

  <details>

  ```
  $ kubectl create -f ds.yaml
  $ kubectl get ds -n kube-system
  $ kubectl get pod -n kube-system|grep elasticsearch
  ```
  </details>






================================================
FILE: docs/03-Scheduling/16-Static-Pods.md
================================================
# Static Pods 
  - Take me to [Video Tutorial](https://kodekloud.com/topic/static-pods/)
  
In this section, we will take a look at Static Pods

#### How do you provide a pod definition file to the kubelet without a kube-apiserver?
- You can configure the kubelet to read the pod definition files from a directory on the server designated to store information about pods.

## Configure Static Pod
- The designated directory can be any directory on the host and the location of that directory is passed in to the kubelet as an option while running the service.
  - The option is named as **`--pod-manifest-path`**.
  
  ![sp](../../images/sp.PNG)
  
## Another way to configure static pod 
- Instead of specifying the option directly in the **`kubelet.service`** file, you could provide a path to another config file using the config option, and define the directory path as staticPodPath in the file.

  ![sp1](../../images/sp1.PNG)

## View the static pods
- To view the static pods
  ```
  $ docker ps
  ```
  ![sp2](../../images/sp2.PNG)

#### The kubelet can create both kinds of pods - the static pods and the ones from the api server at the same time.

  ![sp3](../../images/sp3.PNG)

## Static Pods - Use Case

  ![sp4](../../images/sp4.PNG)
  
  ![sp5](../../images/sp5.PNG)
  
## Static Pods vs DaemonSets

   ![spvsds](../../images/spvsds.PNG)
  

#### K8s Reference Docs
- https://kubernetes.io/docs/tasks/configure-pod-container/static-pod/


================================================
FILE: docs/03-Scheduling/17-Practice-Test-StaticPods.md
================================================
# Practice Test - Static Pods
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-static-pods/)
  
Solutions to the practice test - static pods
- Run the command kubectl get pods --all-namespaces and look for those with -controlplane appended in the name
  
  <details>

  ```
  $ kubectl get pods --all-namespaces
  ```
  </details>

- Which of the below components is NOT deployed as a static pod?

  <details>

  ```
  $ kubectl get pods --all-namespaces
  ```
  </details>

- Which of the below components is NOT deployed as a static POD?

  <details>

  ```
  $ kubectl get pods --all-namespaces
  ```
  </details>

- Run the kubectl get pods --all-namespaces -o wide

  <details>

  ```
  $ kubectl get pods --all-namespaces -o wide
  ```
  </details>

- Run the command ps -aux | grep kubelet and identify the config file - --config=/var/lib/kubelet/config.yaml. Then checkin the config file for staticPdPath.

  <details>

  ```
  $ ps -aux | grep kubelet
  ```
  </details>

- Count the number of files under /etc/kubernetes/manifests

- Check the image defined in the /etc/kubernetes/manifests/kube-apiserver.yaml manifest file.

- Create a pod definition file in the manifests folder. Use command kubectl run --restart=Never --image=busybox static-busybox --dry-run -o yaml --command -- sleep 1000 > /etc/kubernetes/manifests/static-busybox.yaml
  
  <details>

  ```
  $ kubectl run --restart=Never --image=busybox static-busybox --dry-run=client -o yaml --command -- sleep 1000 > /etc/kubernetes/manifests/static-busybox.yaml
  ```
  </details>

- Simply edit the static pod definition file and save it 

  <details>

  ```
  /etc/kubernetes/manifests/static-busybox.yaml
  ```
  </details>

  OR
  
  <details>

  ```
  Run the command with updated image tag:
  kubectl run --restart=Never --image=busybox:1.28.4 static-busybox--dry-run=client -o yaml --command -- sleep 1000 > /etc/kubernetes/manifests/static-busybox.yaml
  ```
  </details>

- Identify which node the static pod is created on, ssh to the node and delete the pod definition file. If you don't know theIP of the node, run the kubectl get nodes -o wide command and identify the IP. Then SSH to the node using that IP. For static pod manifest path look at the file /var/lib/kubelet/config.yaml on node01

  <details>

  ```
  $ kubectl get pods -o wide
  $ kubectl get nodes -o wide
  $ ssh <ip address of pod>
  $ grep staticPodPath /var/lib/kubelet/config.yaml
  $ node01 $ rm -rf /etc/just-to-mess-with-you/greenbox.yaml
  ```
  </details>


================================================
FILE: docs/03-Scheduling/18-Multiple-Schedulers.md
================================================
# Multiple Schedulers 
  - Take me to [Video Tutorial](https://kodekloud.com/topic/multiple-schedulers/)

In this section, we will take a look at multiple schedulers

## Custom Schedulers
- Your kubernetes cluster can schedule multiple schedulers at the same time.

  ![ms](../../images/ms.PNG)
  
## Deploy additional scheduler
- Download the binary
  ```
  $ wget https://storage.googleapis.com/kubernetes-release/release/v1.12.0/bin/linux/amd64/kube-scheduler
  ```
  ![das](../../images/das.PNG)
  
## Deploy additional scheduler - kubeadm
   
  ![dask](../../images/dask.PNG)
  
  - To create a scheduler pod
    ```
    $ kubectl create -f my-custom-scheduler.yaml
    ```
  
## View Schedulers
- To list the scheduler pods
  ```
  $ kubectl get pods -n kube-system
  ```

## Use the Custom Scheduler
- Create a pod definition file and add new section called **`schedulerName`** and specify the name of the new scheduler
  ```
  apiVersion: v1
  kind: Pod
  metadata:
    name: nginx
  spec:
    containers:
    - image: nginx
      name: nginx
    schedulerName: my-custom-scheduler
  ```
  ![cs](../../images/cs.png)
  
- To create a pod definition
  ```
  $ kubectl create -f pod-definition.yaml
  ```
- To list pods
  ```
  $ kubectl get pods
  ```

## View Events
- To view events
  ```
  $ kubectl get events
  ```
  ![cs1](../../images/cs1.PNG)
  
## View Scheduler Logs
- To view scheduler logs
  ```
  $ kubectl logs my-custom-scheduler -n kube-system
  ```
  ![cs2](../../images/cs2.PNG)
  
#### K8s Reference Docs
- https://kubernetes.io/docs/tasks/extend-kubernetes/configure-multiple-schedulers/
  


================================================
FILE: docs/03-Scheduling/19-Practice-Test-Multiple-Schedulers.md
================================================
# Practice Test - Multiple Schedulers
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-multiple-schedulers/)
  
Solutions to practice test - multiple schedulers
- Run the command 'kubectl get pods --namespace=kube-system'
  
  <details>

  ```
  $ kubectl get pods --namespace=kube-system
  ```
  </details>

- Run the command 'kubectl describe pod kube-scheduler-controlplane --namespace=kube-system'

  <details>

  ```
  $ kubectl describe pod kube-scheduler-controlplane --namespace=kube-system
  ```
  </details>
  
- Use the imperative command to create the configmap with option --from-file

  <details>

  ```
  $ kubectl create -n kube-system configmap my-scheduler-config --from-file=/root/my-scheduler-config.yaml
  ```
  </details>

- Use the file at /root/my-scheduler.yaml to create your own scheduler with correct image.


  <details>

  ```
  $ kubectl create -f /root/my-scheduler.yaml
  ```
  </details>

- Set schedulerName property on pod specification to the name of the new scheduler. File is located at /root/nginx-pod.yaml
  
  <details>

  ```
  master $ grep schedulerName /root/nginx-pod.yaml
  schedulerName: my-scheduler
  
  $ kubectl create -f /root/nginx-pod.yaml
  ```
  </details>




================================================
FILE: docs/03-Scheduling/20-Configuring-Kubernetes-Schedulers.md
================================================
# Configuring Kubernetes Schedulers
  - Take me to [video Tutorial](https://kodekloud.com/topic/configuring-kubernetes-scheduler/)
  
In this section, we will take a look at configuring kubernetes schedulers.

![ks](../../images/ks.PNG)

## References
- https://github.com/kubernetes/community/blob/master/contributors/devel/sig-scheduling/scheduler.md
- https://kubernetes.io/blog/2017/03/advanced-scheduling-in-kubernetes/
- https://jvns.ca/blog/2017/07/27/how-does-the-kubernetes-scheduler-work/
- https://stackoverflow.com/questions/28857993/how-does-kubernetes-scheduler-work



================================================
FILE: docs/03-Scheduling/21-Download-Presentation-Deck.md
================================================
# Download Presentation Deck
  - Take me to [Presentation Deck](https://kodekloud.com/topic/download-presentation-deck-2-2/)


================================================
FILE: docs/04-Logging-and-Monitoring/01-Logging-and-Monitoring-Section-Introduction.md
================================================
# Logging and Monitoring Section Introduction
  - Take me to [Video Tutorial](https://kodekloud.com/topic/logging-and-monitoring-section-introduction/)
  
In this section, we will take a look at the below
- Monitor Cluster Components
- Monitor Applications
- Monitor Cluster Components Logs
- Application Logs


================================================
FILE: docs/04-Logging-and-Monitoring/02-Monitor-Cluster-Components.md
================================================
# Monitor Cluster Components
  - Take me to [Video Tutuorials](https://kodekloud.com/topic/monitor-cluster-components/)
  
In this section, we will take a look at monitoring kubernetes cluster

#### How do you monitor resource consumption in kubernetes? or more importantly, what would you like to monitor?
  ![mon](../../images/mon.PNG)
 
## Heapster vs Metrics Server
- Heapster is now deprecated and a slimmed down version was formed known as the **`metrics server`**.

  ![hpms](../../images/hpms.PNG)
  
## Metrics Server

  ![ms1](../../images/ms1.PNG)

#### How are the metrics generated for the PODs on these nodes?

  ![ca](../../images/ca.PNG)
  
## Metrics Server - Getting Started

  ![msg](../../images/msg.PNG)
  
- Clone the metric server from github repo
  ```
  $ git clone https://github.com/kubernetes-incubator/metrics-server.git
  ```
- Deploy the metric server
  ```
  $ kubectl create -f metric-server/deploy/1.8+/
  ```
  
- View the cluster performance
  ```
  $ kubectl top node
  ```
- View performance metrics of pod
  ```
  $ kubectl top pod
  ```
  
  ![view](../../images/view.PNG)
  
  


================================================
FILE: docs/04-Logging-and-Monitoring/03-Practice-Test-Monitor-Cluster-Components.md
================================================
# Practice Test - Monitor Cluster Components
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-monitor-cluster-components/)
  
Solutions to practice test - monitor cluster components
1.  <details>
    <summary>We have deployed a few PODs running workloads. Inspect it.</summary>

    ```
    kubectl get pods
    ```
    </details>
  
1.  <details>
    <summary>Let us deploy metrics-server to monitor the PODs and Nodes. Pull the git repository for the deployment files.</summary>

    ```
    git clone https://github.com/kodekloudhub/kubernetes-metrics-server.git
    ```
    </details>
  
1.  <details>
    <summary>Deploy the metrics-server by creating all the components downloaded.</summary>
    
    Run the 'kubectl create -f .' command from within the downloaded repository.
  
    ```
    cd kubernetes-metrics-server
    kubectl create -f .
    ```
    </details>
    
1.  <details>
    <summary>It takes a few minutes for the metrics server to start gathering data.</summary>

    Run the `kubectl top node` command and wait for a valid output.
    
    ```
    kubectl top node
    ```
    </details>
  
1.  <details>
    <summary>Identify the node that consumes the most CPU(cores).</summary>

     Run the `kubectl top node` command

      ```
      kubectl top node
      ```

      Examine the `CPU(cores)` column of the output to get the answer.

      </details>
  
1.  <details>
    <summary>Identify the node that consumes the most Memory(bytes).</summary>
    Run the `kubectl top node` command
  
    ```
    $ kubectl top node
    ```

    Examine the `MEMORY(bytes)` column of the output to get the answer.

    </details>
  
1.  <details>
    <summary>Identify the POD that consumes the most Memory(bytes).</summary>

    Run the `kubectl top pod` command
  
    ```
    kubectl top pod
    ```

    Examine the `MEMORY(bytes)` column of the output to get the answer.

    </details>
  
1.  <details>

    <summary>Identify the POD that consumes the least CPU(cores).</summary>

    Run the `kubectl top pod` command
  
    ```
    kubectl top pod
    ```

    Examine the `CPU(cores)` column of the output to get the answer.

  </details>
  




================================================
FILE: docs/04-Logging-and-Monitoring/04-Managing-Application-Logs.md
================================================
# Managing Application Logs
  - Take me to [Video Tutorial](https://kodekloud.com/topic/managing-application-logs/)

In this section, we will take a look at managing application logs

#### Let us start with logging in docker

![ld](../../images/ld.PNG)
 
![ld1](../../images/ld1.PNG)
 
#### Logs - Kubernetes
```
apiVersion: v1
kind: Pod
metadata:
  name: event-simulator-pod
spec:
  containers:
  - name: event-simulator
    image: kodekloud/event-simulator
```
 ![logs-k8s](../../images/logs-k8s.png)
 
- To view the logs
  ```
  $ kubectl logs -f event-simulator-pod
  ```
- If there are multiple containers in a pod then you must specify the name of the container explicitly in the command.
  ```
  $ kubectl logs -f <pod-name> <container-name>
  $ kubectl logs -f even-simulator-pod event-simulator
  ```

  ![logs1](../../images/logs1.PNG)
  
#### K8s Reference Docs
- https://kubernetes.io/blog/2015/06/cluster-level-logging-with-kubernetes/
 


================================================
FILE: docs/04-Logging-and-Monitoring/05-Download-Presentation-Deck.md
================================================
# Download Presentation Deck
  - Take me to [Presentation Deck](https://kodekloud.com/topic/download-presentation-deck-3/)


================================================
FILE: docs/04-Logging-and-Monitoring/06-Practice-Test-Managing-Application-Logs.md
================================================
# Practice Test - Managing Application Logs
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-managing-application-logs/)
  
Solutions to practice test - managing application logs
- We have deployed a POD hosting an application. Inspect it. Wait for it to start.

  <details>
  
  ```
  $ kubectl get pods
  ```
  </details>
  
- Inspect the logs of the POD
  
  <details>
  
  ```
  $ kubectl logs webapp-1
  ```
  </details>
  
- We have deployed a new POD - 'webapp-2' - hosting an application. Inspect it. Wait for it to start.

  <details>
  
  ```
  $ kubectl get pods
  ```
  </details>
  
- Inspect the logs of the webapp in the POD
  
  <details>
  
  ```
  $ kubectl logs webapp-2
  ```
  </details>







================================================
FILE: docs/05-Application-Lifecycle-Management/01-Application-Lifecycle-Management--Section-Introduction.md
================================================
# Application Lifecycle Management Section Introduction
  - Take me to [Video Tutorial](https://kodekloud.com/topic/application-lifecycle-management-section-introduction/)
  
In this section, we will take a look at application lifecycle management
- Rolling Updates and Rollbacks in Deployments
- Configure Applications
- Scale Applications
- Self-Healing Application



================================================
FILE: docs/05-Application-Lifecycle-Management/02-RollingUpdates-and-Rollback.md
================================================
# Rolling Updates and Rollback
  - Take me to [Video Tutorial](https://kodekloud.com/topic/rolling-updates-and-rollbacks/)
  
In this section, we will take a look at rolling updates and rollback in a deployment

## Rollout and Versioning in a Deployment

  ![rollv](../../images/rollv.PNG)
  
## Rollout commands
- You can see the status of the rollout by the below command
  ```
  $ kubectl rollout status deployment/myapp-deployment
  ```
- To see the history and revisions
  ```
  $ kubectl rollout history deployment/myapp-deployment
  ```
 
  ![rollc](../../images/rollc.PNG)
  
## Deployment Strategies
- There are 2 types of deployment strategies
  1. Recreate
  2. RollingUpdate (Default Strategy)
  
  ![dst](../../images/dst.PNG)
  
## kubectl apply
- To update a deployment, edit the deployment and make necessary changes and save it. Then run the below command.
  ```
  apiVersion: apps/v1
  kind: Deployment
  metadata:
   name: myapp-deployment
   labels:
    app: nginx
  spec:
   template:
     metadata:
       name: myap-pod
       labels:
         app: myapp
         type: front-end
     spec:
      containers:
      - name: nginx-container
        image: nginx:1.7.1
   replicas: 3
   selector:
    matchLabels:
      type: front-end       
  ```
  ```
  $ kubectl apply -f deployment-definition.yaml
  ```
- Alternate way to update a deployment say for example for updating an image.
  ```
  $ kubectl set image deployment/myapp-deployment nginx=nginx:1.9.1
  ```
  ![ka](../../images/ka.PNG)
  
## Recreate vs RollingUpdate
  
  ![rcrl](../../images/rcrl.PNG)
  
## Upgrades

  ![up](../../images/up.PNG)
  
## Rollback
  
  ![rb](../../images/rb.PNG)
  
- To undo a change
  ```
  $ kubectl rollout undo deployment/myapp-deployment
  ```
  
## kubectl create
- To create a deployment
  ```
  $ kubectl create deployment nginx --image=nginx
  ```
## Summarize kubectl commands
```
$ kubectl create -f deployment-definition.yaml
$ kubectl get deployments
$ kubectl apply -f deployment-definition.yaml
$ kubectl set image deployment/myapp-deployment nginx=nginx:1.9.1
$ kubectl rollout status deployment/myapp-deployment
$ kubectl rollout history deployment/myapp-deployment
$ kubectl rollout undo deployment/myapp-deployment
```

![sum](../../images/sum.PNG)
 
#### K8s Reference Docs
- https://kubernetes.io/docs/concepts/workloads/controllers/deployment
- https://kubernetes.io/docs/tasks/run-application/run-stateless-application-deployment


================================================
FILE: docs/05-Application-Lifecycle-Management/03-Practice-Test-RollingUpdates-Rollback.md
================================================
# Practice Test - Rolling Updates and Rollback
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-rolling-updates-and-rollbacks/)
  
Solutions to practice test - rolling updates and rollback
- We have deployed a simple web application. Inspect the PODs and the Services

  <details>
  
  ```
  $ kubectl get pods
  $ kubectl get services
  ```
  </details>
  
- What is the current color of the web application?
  
  <details>
  
  ```
  Access the web portal
  ```
  </details>
    
- Execute the script at /root/curl-test.sh.

- Run the command 'kubectl describe deployment' and look at 'Desired Replicas'

  <details>
  
  ```
  $ kubectl describe deployment
  ```
  </details>
  
- Run the command 'kubectl describe deployment' and look for 'Images'
  
  <details>
  
  ```
  $ kubectl describe deployment
  ```
  </details>
  
- Run the command 'kubectl describe deployment' and look at 'StrategyType'
  
  <details>
  
  ```
  $ kubectl describe deployment
  ```
  </details>
  
- If you were to upgrade the application now what would happen?
  
  <details>
  
  ```
  PODs are upgraded few at a time
  ```
  </details>
  
- Run the command 'kubectl edit deployment frontend' and modify the required feild
  
  <details>
  
  ```
  $ kubectl edit deployment frontend
  ```
  </details>
    
- Execute the script at /root/curl-test.sh.

- Look at the Max Unavailable value under RollingUpdateStrategy in deployment details

  <details>
  ```
  $ kubectl describe deployment
  ```
  </details>
  
- Run the command 'kubectl edit deployment frontend' and modify the required field. Make sure to delete the properties of rollingUpdate as well, set at 'strategy.rollingUpdate'.
  
  <details>
  
  ```
  $ kubectl edit deployment frontend
  ```
  
  </details>
  
- Run the command 'kubectl edit deployment frontend' and modify the required feild

  <details>
  
  ```
  $ kubectl edit deployment frontend
  ```
  </details>
  
- Execute the script at /root/curl-test.sh.






================================================
FILE: docs/05-Application-Lifecycle-Management/04-Commands-and-Arguments-in-Docker.md
================================================
# Commands and Arguments in Docker
  - Take me to [Video Tutorial](https://kodekloud.com/topic/commands-and-arguments-in-docker/)
  
In this section, we will take a look at commands and arguments in docker

- To run a docker container
  ```
  $ docker run ubuntu
  ```
- To list running containers
  ```
  $ docker ps 
  ```
- To list all containers including that are stopped
  ```
  $ docker ps -a
  ```
  
  ![dc](../../images/dc.PNG)
  
#### Unlike virtual machines, containers are not meant to host operating system.
- Containers are meant to run a specific task or process such as to host an instance of a webserver or application server or a database server etc.

  ![ex](../../images/ex.PNG)
  
  
#### How do you specify a different command to start the container?
- One Option is to append a command to the docker run command and that way it overrides the default command specified within the image.
  ```
  $ docker run ubuntu sleep 5
  ```
- This way when the container starts it runs the sleep program, waits for 5 seconds and then exists. How do you make that change permanent?
  
  ![sleep](../../images/sleep.PNG)
  
- There are different ways of specifying the command either the command simply as is in a shell form or in a JSON array format.
 
  ![sleep1](../../images/sleep1.PNG)
  
- Now, build the docker image
  ```
  $ docker build -t ubuntu-sleeper .
  ```
- Run docker container
  ```
  $ docker run ubuntu-sleeper
  ```
  
  ![sleep2](../../images/sleep2.PNG)
  
## Entrypoint Instruction
- The entrypoint instruction is like the command instruction as in you can specify the program that will be run when the container starts and whatever you specify on the command line.

#### K8s Reference Docs
- https://docs.docker.com/engine/reference/builder/#cmd


================================================
FILE: docs/05-Application-Lifecycle-Management/05-Commands-and-Arguments-in-Kubernetes.md
================================================
# Commands and Arguments in Kubernetes
  - Take me to [Video Tutorial](https://kodekloud.com/topic/commands-and-arguments-in-kubernetes-2/)

In this section, we will take a look at commands and arguments in kubernetes

- Anything that is appended to the docker run command will go into the **`args`** property of the pod definition file in the form of an array.
- The command field corresponds to the entrypoint instruction in the Dockerfile so to summarize there are 2 fields that correspond to 2 instructions in the Dockerfile.
  ```
  apiVersion: v1
  kind: Pod
  metadata:
    name: ubuntu-sleeper-pod
  spec:
   containers:
   - name: ubuntu-sleeper
     image: ubuntu-sleeper
     command: ["sleep2.0"]
     args: ["10"]
  ```
  ![args](../../images/args.PNG)
  
#### K8s Reference Docs
- https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/


================================================
FILE: docs/05-Application-Lifecycle-Management/06-Practice-Test-Commands-and-Arguments.md
================================================
# Practice Test - Commands and Arguments
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-commands-and-arguments/)
  
Solutions to practice test - commands and arguments
- Run the command 'kubectl get pods' and count the number of pods.
  
  <details>
  
  ```
  $ kubectl get pods
  ```
  </details>
  
- Run the command 'kubectl describe pod' and look for command option

  <details>
  
  ```
  $ kubectl describe pod
  ```
  </details>
  
- Set the command option to ['sleep', '5000']. Answer file at: /var/answers/answer-ubuntu-sleeper-2.yaml

- Both sleep and 1200 should be defined as a string. Answer file at: /var/answers/answer-ubuntu-sleeper-3.yaml

- Answer file at: /var/answers/answer-ubuntu-sleeper-3-2.yaml

- Inspect the file 'Dockerfile' given at /root/webapp-color. What command is run at container startup?
  
  <details>
  
  ```
  python app.py
  ```
  </details>
  
- Inspect the file 'Dockerfile2' given at /root/webapp-color. What command is run at container startup?

  <details>
  ```
  python app.py --color red
  ```
  </details>
  
- The 'command' (entrypoint) is overridden in the pod definition. So the answer is --color green

- Inspect the two files under directory 'webapp-color-3'. What command is run at container startup?

  <details>
  
  ```
  python app.py --color pink
  ```
  </details>
  
- Answer file located at /var/answers/answer-webapp-color-green.yaml




================================================
FILE: docs/05-Application-Lifecycle-Management/07.Configure-Environment-Variables-in-Applications.md
================================================
# Configure Environment Variables In Applications
  - Take me to [Video Tutorial](https://kodekloud.com/topic/configure-environment-variables-in-applications/)
  
#### ENV variables in Docker
```
$ docker run -e APP_COLOR=pink simple-webapp-color
```

#### ENV variables in kubernetes 
- To set an environment variable set an **`env`** property in pod definition file.
  
  ```
  apiVersion: v1
  kind: Pod
  metadata:
    name: simple-webapp-color
  spec:
   containers:
   - name: simple-webapp-color
     image: simple-webapp-color
     ports:
     - containerPort: 8080
     env:
     - name: APP_COLOR
       value: pink
  ```
  ![env](../../images/env.PNG)
  
- There are other ways of setting the environment variables such as **`ConfigMaps`** and **`Secrets`**

  ![cms](../../images/cms.PNG)
  
#### K8s Reference Docs
- https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/


================================================
FILE: docs/05-Application-Lifecycle-Management/08-Configure-ConfigMaps-in-Applications.md
================================================
# Configure ConfigMaps in Applications
  - Take me to [Video Tutorial](https://kodekloud.com/topic/configure-configmaps-in-applications/)
  
In this section, we will take a look at configuring configmaps in applications

## ConfigMaps
- There are 2 phases involved in configuring ConfigMaps. 
  - First, create the configMaps
  - Second, Inject then into the pod.
- There are 2 ways of creating a configmap.
  - The Imperative way
    ```
    $ kubectl create configmap app-config --from-literal=APP_COLOR=blue --from-literal=APP_MODE=prod
    $ kubectl create configmap app-config --from-file=app_config.properties (Another way)
    ```
    ![cmi](../../images/cmi.PNG)
    
  - The Declarative way
    
    ```
    apiVersion: v1
    kind: ConfigMap
    metadata:
     name: app-config
    data:
     APP_COLOR: blue
     APP_MODE: prod
    ```
    ```
    Create a config map definition file and run the 'kubectl create` command to deploy it.
    $ kubectl create -f config-map.yaml
    ```
    ![cmd1](../../images/cmd1.PNG)
    
 ## View ConfigMaps
 - To view configMaps
   ```
   $ kubectl get configmaps (or)
   $ kubectl get cm
   ```
 - To describe configmaps
   ```
   $ kubectl describe configmaps
   ```
   
   ![cmv](../../images/cmv.PNG)
   
 ## ConfigMap in Pods
 - Inject configmap in pod
   ```
   apiVersion: v1
   kind: Pod
   metadata:
     name: simple-webapp-color
   spec:
    containers:
    - name: simple-webapp-color
      image: simple-webapp-color
      ports:
      - containerPort: 8080
      envFrom:
      - configMapRef:
          name: app-config
   ```
   ```
   apiVersion: v1
   kind: ConfigMap
   metadata:
     name: app-config
   data:
     APP_COLOR: blue
     APP_MODE: prod
   ```
   ```
   $ kubectl create -f pod-definition.yaml
   ```
  
   ![cmp](../../images/cmp.PNG)
   
 #### There are other ways to inject configuration variables into pod   
 - You can inject it as a **`Single Environment Variable`** 
 - You can inject it as a file in a **`Volume`**
 
   ![cmp1](../../images/cmp1.PNG)
   
 #### K8s Reference Docs
 - https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/
 - https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#define-container-environment-variables-using-configmap-data
 - https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#create-configmaps-from-files


================================================
FILE: docs/05-Application-Lifecycle-Management/09-Practice-Test-Env-Variables.md
================================================
# Practice Test Env Variables
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-env-variables/)
  
Solutions to practice test env variables
- Run the command 'kubectl get pods' and count the number of pods.
  
  <details>
  
  ```
  $ kubectl get pods
  ```
  
  </details>
  
- Run the command 'kubectl describe pod' and look for ENV option

  <details>
  
  ```
  $ kubectl describe pod
  ```
  
  </details>
  
- Run the command 'kubectl describe pod' and look for ENV option
  
  <details>
  
  ```
  $ kubectl describe pod
  ```
  
  </details>
    
- View the web application UI by clicking on the 'Webapp Color' Tab above your terminal.

- Set the environment option to APP_COLOR - green.
  
  <details>
  
  ```
  $ kubectl get pods webapp-color -o yaml > green.yaml
  $ kubectl delete pods webapp-color
  Update APP_COLOR to green
  $ kubectl create -f green.yaml
  ```
  
  </details>
  
- View the changes to the web application UI by clicking on the 'Webapp Color' Tab above your terminal.

- Run kubectl get configmaps
  
  <details>
  
  ```
  $ kubectl get configmaps
  ```
  
  </details>
  
- Run the command 'kubectl describe configmaps' and look for DB_HOST option

  <details>
  
  ```
  $ kubectl describe configmaps
  ```
  
  </details>
  
- Create a new ConfigMap for the 'webapp-color' POD. Use the spec given on the right.

  <details>
  
  ```
  $ kubectl create configmap webapp-config-map --from-literal=APP_COLOR=darkblue
  ```
  
  </details>
  
- Set the environment option to envFrom and use configMapRef webapp-config-map.
  
  <details>
  
  ```
  $ kubectl get pods webapp-color -o yaml > new-webapp.yaml
  $ kubectl delete pods webapp-color
   Update pod definition file, under spec.containers section update the below.
  - envFrom:
    - configMapRef:
       name: webapp-config-map
  ```
  
  </details>
  
  <details>
  
  ```
  $ kubectl create -f new-webapp.yaml
  ``` 
  
  </details>

- View the changes to the web application UI by clicking on the 'Webapp Color' Tab above your terminal.


================================================
FILE: docs/05-Application-Lifecycle-Management/10.Secrets.md
================================================
# Secrets
  - Take me to [Video Tutorials](https://kodekloud.com/topic/secrets-2/)

In this section, we will take a look at secrets in kubernetes

## Web-Mysql Application

 ![web](../../images/web.PNG)
 
- One way is to move the app properties/envs into a configmap. But the configmap stores data into a plain text format. It is definitely not a right place to store a password.
  ```
  apiVersion: v1
  kind: ConfigMap
  metadata:
   name: app-config
  data:
    DB_Host: mysql
    DB_User: root
    DB_Password: paswrd
  ```
  ![web1](../../images/web1.PNG)
  
- Secrets are used to store sensitive information. They are similar to configmaps but they are stored in an encrypted format or a hashed format.

#### There are 2 steps involved with secrets
- First, Create a secret
- Second, Inject the secret into a pod.
  
  ![sec](../../images/sec.PNG)
  
#### There are 2 ways of creating a secret
- The Imperative way
  ```
  $ kubectl create secret generic app-secret --from-literal=DB_Host=mysql --from-literal=DB_User=root --from-literal=DB_Password=paswrd
  $ kubectl create secret generic app-secret --from-file=app_secret.properties
  ```
  ![csi](../../images/csi.PNG)
  
- The Declarative way
  ```
  Generate a hash value of the password and pass it to secret-data.yaml definition value as a value to DB_Password variable.
  $ echo -n "mysql" | base64
  $ echo -n "root" | base64
  $ echo -n "paswrd"| base64
  ```
  
  Create a secret definition file and run `kubectl create` to deploy it
  ```
  apiVersion: v1
  kind: Secret
  metadata:
   name: app-secret
  data:
    DB_Host: bX1zcWw=
    DB_User: cm9vdA==
    DB_Password: cGFzd3Jk
  ```
  ```
  $ kubectl create -f secret-data.yaml
  ```

  ![csd](../../images/csd.PNG)
  
## Encode Secrets

  ![enc](../../images/enc.PNG)
  
## View Secrets
- To view secrets
  ```
  $ kubectl get secrets
  ```
- To describe secret
  ```
  $ kubectl describe secret
  ```
- To view the values of the secret
  ```
  $ kubectl get secret app-secret -o yaml
  ```
  
  ![secv](../../images/secv.PNG)
  
## Decode Secrets
- To decode secrets
  ```
  $ echo -n "bX1zcWw=" | base64 --decode
  $ echo -n "cm9vdA==" | base64 --decode
  $ echo -n "cGFzd3Jk" | base64 --decode
  ```
  ![secd](../../images/secd.PNG)
  
## Configuring secret with a pod
- To inject a secret to a pod add a new property **`envFrom`** followed by **`secretRef`** name and then create the pod-definition
  
  ```
  apiVersion: v1
  kind: Secret
  metadata:
   name: app-secret
  data:
    DB_Host: bX1zcWw=
    DB_User: cm9vdA==
    DB_Password: cGFzd3Jk
  ```
  ```
   apiVersion: v1
   kind: Pod
   metadata:
     name: simple-webapp-color
   spec:
    containers:
    - name: simple-webapp-color
      image: simple-webapp-color
      ports:
      - containerPort: 8080
      envFrom:
      - secretRef:
          name: app-secret
   ```
  ```
  $ kubectl create -f pod-definition.yaml
  ```
  ![secp](../../images/secp.PNG)
  
#### There are other ways to inject secrets into pods.
- You can inject as **`Single ENV variable`**
- You can inject as whole secret as files in a **`Volume`**

  ![seco](../../images/seco.PNG)
  
## Secrets in pods as volume
- Each attribute in the secret is created as a file with the value of the secret as its content.
  
  ![secpv](../../images/secpv.PNG)
  

#### Additional Notes: [A Note on Secrets](https://kodekloud.com/topic/a-note-on-secrets/)

Remember that secrets encode data in base64 format. Anyone with the base64 encoded secret can easily decode it. As such the secrets can be considered not very safe.

The concept of safety of the Secrets is a bit confusing in Kubernetes. The [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/secret) page and a lot of blogs out there refer to secrets as a “safer option” to store sensitive data. They are safer than storing in plain text as they reduce the risk of accidentally exposing passwords and other sensitive data. In my opinion it’s not the secret itself that is safe, it is the practices around it.

Secrets are not encrypted, so it is not safer in that sense. However, some best practices around using secrets make it safer. As in best practices like:

- Not checking-in secret object definition files to source code repositories.
- [Enabling Encryption at Rest](https://kubernetes.io/docs/tasks/administer-cluster/encrypt-data/) for Secrets so they are stored encrypted in ETCD.

Also the way kubernetes handles secrets. Such as:

- A secret is only sent to a node if a pod on that node requires it.
- Kubelet stores the secret into a tmpfs so that the secret is not written to disk storage.
- Once the Pod that depends on the secret is deleted, kubelet will delete its local copy of the secret data as well.

Read about the [protections](https://kubernetes.io/docs/concepts/configuration/secret/#protections) and [risks](https://kubernetes.io/docs/concepts/configuration/secret/#risks) of using secrets [here](https://kubernetes.io/docs/concepts/configuration/secret/#risks)

Having said that, there are other better ways of handling sensitive data like passwords in Kubernetes, such as using tools like Helm Secrets, [HashiCorp Vault](https://www.vaultproject.io/). I hope to make a lecture on these in the future.

#### K8s Reference Docs
- https://kubernetes.io/docs/concepts/configuration/secret/
- https://kubernetes.io/docs/concepts/configuration/secret/#use-cases
- https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/


================================================
FILE: docs/05-Application-Lifecycle-Management/11.Practice-Test-Secrets.md
================================================
# Practice Test - Secrets
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-secrets/)

Solutions for pracice test - Secrets
- Run the command 'kubectl get secrets' and count the number of pods.
  
  <details>
  ```
  $ kubectl get secrets
  ```
  </details>
    
- Run the command 'kubectl get secrets' and look at the DATA field

  <details>
  ```
  $ kubectl get secrets
  ```
  </details>
  
- Run the command 'kubectl describe secret'

  <details>
  ```
  $ kubectl describe secret
  ```
  </details>
    
- Run the command 'kubectl describe secret'

  <details>
  ```
  $ kubectl describe secret
  ```
  </details>
  
- We have already deployed the required pods and services. Check out the pods and services created. Check out the web application using the 'Webapp MySQL' link above your terminal, next to the Quiz Portal Link.

- Run command kubectl create secret generic db-secret --from-literal=DB_Host=sql01 --from-literal=DBUser=root --from-literal=DB_Password=password123

  <details>
  ```
  $ kubectl create secret generic db-secret --from-literal=DB_Host=sql01 --from-literal=DB_User=root --from-literal=DB_Password=password123
  ```
  </details>
  
- Check Answer at /var/answers/answer-webapp.yaml

  <details>
  ```
  $ kubectl get pod webapp-pod -o yaml > web.yaml
  $ kubectl delete pod webapp-pod
  ```
  </details>
  
  Update web.yaml with secret section
  
  envFrom:
  - secretRef:
      name: db-secret
  
  <details>
  ```
  $ kubectl create -f web.yaml
  ```
  </details>
  
- View the web application to verify it can successfully connect to the database



================================================
FILE: docs/05-Application-Lifecycle-Management/12.Multi-Containers-PODs.md
================================================
# Multi-Container Pods
  - Take me to [Video Tutorial](https://kodekloud.com/topic/multi-container-pods-2/)

In this section, we will take a look at multi-container pods

## Monolith and Microservices

  ![loga](../../images/loga.PNG)
  
#### Multi-Container Pods

  ![mcp](../../images/mcp.PNG)
  
- To create a new multi-container pod, add the new container information to the pod definition file.
  ```
  apiVersion: v1
  kind: Pod
  metadata:
    name: simple-webapp
    labels:
      name: simple-webapp
  spec:
    containers:
    - name: simple-webapp
      image: simple-webapp
      ports:
      - ContainerPort: 8080
    - name: log-agent
      image: log-agent
  ```
  ![mcpc](../../images/mcpc.PNG)
 
#### K8s Reference Docs
- https://kubernetes.io/docs/tasks/access-application-cluster/communicate-containers-same-pod-shared-volume/


================================================
FILE: docs/05-Application-Lifecycle-Management/13-Practice-Test-Multi-Container-Pods.md
================================================
# Practice Test - Multi-Container Pods
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-multi-container-pods/)
  
Solutions to practice test - multi-container pods
- Identify the number of containers running in the 'red' pod.
  
  <details>
  
  ```
  $ kubectl get pod red
  ```
  </details>
  
- Identify the name of the containers running in the 'blue' pod.

  <details>
  ```
  $ kubectl describe pod blue
  ```
  </details>
    
- Answer file is located at /var/answers/answer-yellow.yaml

  <details>
  ```
  $ kubectl create -f /var/answers/answer-yellow.yaml
  ```
  </details>
  
- We have deployed an application logging stack in the elastic-stack namespace. Inspect it.
  
  <details>
  ```
  $ kubectl get pods -n elastic-stack
  ```
  </details>
  
- Inspect the Kibana UI using the link above your terminal. There shouldn't be any logs for now.

- Run `kubectl describe pod -n elastic-stack`

  <details>
  ```
  $ kubectl describe pod -n elastic-stack
  ```
  </details>
  
- Run the command 'kubectl -n elastic-stack exec -it app cat /log/app.log'
  
  <details>
  ```
  $ kubectl -n elastic-stack exec -it app cat /log/app.log
  ```
  </details>
  
- Answer file is located at /var/answers/answer-app.yaml
  
- Inspect the Kibana UI. You should now see logs appearing in the 'Discover' section. You might have to wait for a couple of minutes for the logs to populate. You might have to create an index pattern to list the logs. If not sure check this video: https://bit.ly/2EXYdHf
  


================================================
FILE: docs/05-Application-Lifecycle-Management/14-Multi-Container-Pods-Design-Patterns.md
================================================
# Multi-Container Pods Design Patterns
  - Take me to [Design Pattern page](https://kodekloud.com/topic/multi-container-pods-design-patterns/)
  
  ![dp](../../images/dp.PNG)
  
#### K8s Reference Docs
- https://kubernetes.io/blog/2015/06/the-distributed-system-toolkit-patterns/


================================================
FILE: docs/05-Application-Lifecycle-Management/15.Init-Containers.md
================================================
# Init Containers
- Take me to [Init-Containers](https://kodekloud.com/topic/init-containers/)

In a multi-container pod, each container is expected to run a process that stays alive as long as the POD’s lifecycle. For example in the multi-container pod that we talked about earlier that has a web application and logging agent, both the containers are expected to stay alive at all times. The process running in the log agent container is expected to stay alive as long as the web application is running. If any of them fails, the POD restarts.

 

But at times you may want to run a process that runs to completion in a container. For example a process that pulls a code or binary from a repository that will be used by the main web application. That is a task that will be run only one time when the pod is first created. Or a process that waits for an external service or database to be up before the actual application starts. That’s where initContainers comes in.

 

An initContainer is configured in a pod like all other containers, except that it is specified inside a initContainers section, like this:

 

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
  labels:
    app: myapp
spec:
  containers:
  - name: myapp-container
    image: busybox:1.28
    command: ['sh', '-c', 'echo The app is running! && sleep 3600']
  initContainers:
  - name: init-myservice
    image: busybox
    command: ['sh', '-c', 'git clone <some-repository-that-will-be-used-by-application> ;']
```
When a POD is first created the initContainer is run, and the process in the initContainer must run to a completion before the real container hosting the application starts.

You can configure multiple such initContainers as well, like how we did for multi-containers pod. In that case, each init container is run one at a time in sequential order.

If any of the initContainers fail to complete, Kubernetes restarts the Pod repeatedly until the Init Container succeeds.

```yaml 
apiVersion: v1
kind: Pod
metadata:
  name: myapp-pod
  labels:
    app: myapp
spec:
  containers:
  - name: myapp-container
    image: busybox:1.28
    command: ['sh', '-c', 'echo The app is running! && sleep 3600']
  initContainers:
  - name: init-myservice
    image: busybox:1.28
    command: ['sh', '-c', 'until nslookup myservice; do echo waiting for myservice; sleep 2; done;']
  - name: init-mydb
    image: busybox:1.28
    command: ['sh', '-c', 'until nslookup mydb; do echo waiting for mydb; sleep 2; done;']
```

#### K8s Reference Docs
- https://kubernetes.io/docs/concepts/workloads/pods/init-containers/
- https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-initialization/


================================================
FILE: docs/05-Application-Lifecycle-Management/16-Practice-Test-Init-Containers.md
================================================
# Practice Test - Init-Containers
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-init-containers/)
  
Solutions to practice test - init-containers
- Identify the pod that has an initContainer configured.

  <details>
  ```
  $ kubectl get pods
  $ kubectl describe pods
  ```
  </details>
  
- What is the image used by the initContainer on the blue pod?
  
  <details>
  ```
  $ kubectl describe pods blue
  ```
  </details>
    
- Run the command kubectl describe pod blue and check the state field of the initContainer.

  <details>
  ```
  $ kubectl describe pod blue
  ```
  </details>
  
- Check the reason field of the initContainer
  
  <details>
  ```
  $ kubectl describe pod blue
  ```
  </details>
  
- Run the command kubectl describe pod purple
  
  <details>
  ```
  $ kubectl describe pod purple
  ```
  </details>
  
- Run the kubectl describe pod purple command and look at the container state
  
  <details>
  ```
  $ kubectl describe pod purple
  ```
  </details>
  
- Check the commands used in the initContainers. The first one sleeps for 600 seconds (10 minutes) and the second one sleeps for 1200 seconds (20 minutes)
  
  <details>
  ```
  $ kubectl describe pod purple
  ```
  </details>
  
- Update the pod red to use an initContainer that uses the busybox image and sleeps for 20 seconds
  
  <details>
  ```
  $ kubectl get pod red -o yaml > red.yaml
  $ kubectl delete pod red
  ```
  </details>
  
  Update the red.yaml with sleep 20 seconds
  
  <details>
  ```
  $ kubectl create -f red.yaml
  ```
  </details>
  
- Check the command used by the initContainer. Looks like there is a type in sleep command. Fix it, it should be **`sleep 2`** not **`sleeeep 2`**
  
  <details>
  ```
  $ kubectl describe pod orange
  $ kubectl get pod orange -o yaml > orange.yaml
  $ kubectl delete pod orange
  
  Update the orange.yaml with correct sleep command and recreate the pod
  $ kubectl create -f orange.yaml
  ```
 </details>


================================================
FILE: docs/05-Application-Lifecycle-Management/17.Self-Healing-Applications.md
================================================
# Self Healing Applications
  - Take me to [Tutorial](https://kodekloud.com/topic/self-healing-applications-2/)

# Self Healing Applications
Kubernetes supports self-healing applications through ReplicaSets and Replication Controllers. The replication controller helps in ensuring that a POD is re-created automatically when the application within the POD crashes. It helps in ensuring enough replicas of the application are running at all times.

Kubernetes provides additional support to check the health of applications running within PODs and take necessary actions through Liveness and Readiness Probes. However these are not required for the CKA exam and as such they are not covered here. These are topics for the Certified Kubernetes Application Developers (CKAD) exam and are covered in the CKAD course.




================================================
FILE: docs/05-Application-Lifecycle-Management/18.Download-Presentation-Deck.md
================================================
# Download Presentation Deck
  - Take me to [Presentation Deck](https://kodekloud.com/topic/download-presentation-deck-4/)




================================================
FILE: docs/06-Cluster-Maintenance/01-Cluster-Maintenance-Section-Introduction.md
================================================
# Cluster Maintenance Section Introduction
  - Take me to [Video Tutorial](https://kodekloud.com/topic/cluster-maintenance-section-introduction-2/)
  
In this section, we will take a look at cluster maintenance
- Cluster Upgrade Process
- Operating System Upgrades
- Backup and Restore Methodologies


================================================
FILE: docs/06-Cluster-Maintenance/02-OS-Upgrades.md
================================================
# OS Upgrades
  - Take me to [Video Tutorial](https://kodekloud.com/topic/os-upgrades/)
  
In this section, we will take a look at OS upgrades.

#### If the node was down for more than 5 minutes, then the pods are terminated from that node

  ![os](../../images/os.PNG)
  
- You can purposefully **`drain`** the node of all the workloads so that the workloads are moved to other nodes.
  ```
  $ kubectl drain node-1
  ```
- The node is also cordoned or marked as unschedulable.
- When the node is back online after a maintenance, it is still unschedulable. You then need to uncordon it.
  ```
  $ kubectl uncordon node-1
  ```
- There is also another command called cordon. Cordon simply marks a node unschedulable. Unlike drain it does not terminate or move the pods on an existing node.

  ![drain](../../images/drain.PNG)
  
  
#### K8s Reference Docs
- https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/


================================================
FILE: docs/06-Cluster-Maintenance/03-Practice-Test-OS-Upgrades.md
================================================
# Practice Test - OS Upgrades
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-os-upgrades/)
  
Solutions to practice test - OS Upgrades
- Let us explore the environment first. How many nodes do you see in the cluster?
  
  <details>
  ```
  $ kubectl get nodes
  ```
  </details>
  
- How many applications do you see hosted on the cluster?
  
  <details>
  ```
  $ kubectl get deploy
  ```
  </details>
  
- Run the command 'kubectl get pods -o wide' and get the list of nodes the pods are placed on
  
  <details>
  ```
  $ kubectl get pods -o wide
  ```
  </details>
  
- Run the command kubectl drain node01 --ignore-daemonsets
  
  <details>
  ```
  $ kubectl drain node01 --ignore-daemonsets
  ```
  </details>
  
- Run the command 'kubectl get pods -o wide' and get the list of nodes the pods are placed on
  
  <details>
  ```
  $ kubectl get pods -o wide
  ```
  </details>
  
- Run the command kubectl uncordon node01
  
  <details>
  ```
  $ kubectl uncordon node01
  ```
  </details>
  
- Run the command kubectl get pods -o wide
  
  <details>
  ```
  $ kubectl get pods -o wide
  ```
  </details>
  
- Why are there no pods on node01?
  
  <details>
  ```
  Only when new pods are created they will be scheduled
  ```
  </details>
  
- Use the command kubectl describe node master and look under taint section to check if it has any taints.
  
  <details>
  ```
  $ kubectl describe node master
  ```
  </details>
  
- Run the command kubectl drain node02 --ignore-daemonsets
  
  <details>
  ```
  $ kubectl drain node02 --ignore-daemonsets
  ```
  </details>
  
- Check the applications hosted on the node02.
  
  <details>
  ```
  node02 has a pod not part of a replicaset
  $ kubectl get pods -o wide
  ```
  </details>
  
- Check the list of pods
  
  <details>
  ```
  $ kubectl get pods -o wide
  ```
  </details>
    
- What would happen to hr-app if node02 is drained forcefully?
  
  <details>
  ```
  $ kubectl drain node02 --ignore-daemonsets --force
  hr-app will be lost forever
  ```
  </details>
    
- Run the command kubectl drain node02 --ignore-daemonsets --force

  <details>
  ```
  $ kubectl drain node02 --ignore-daemonsets --force
  ```
  </details>
  
- Run the command kubectl cordon node03
  
  <details>
  ```
  $ kubectl cordon node03
  ```
  </details>



================================================
FILE: docs/06-Cluster-Maintenance/04-Kubernetes-Software-Versions.md
================================================
# Kubernetes Software Versions
  - Take me to [Video Tutorial](https://kodekloud.com/topic/kubernetes-software-versions/)
  
In this section, we will take a look at various kubernetes releases and versions

#### We can see the kubernetess version that we installed
```
$ kubectl get nodes
```
![kgn](../../images/kgn.PNG)

#### Let's take a closer look at the version number
- It consists of 3 parts
  - First is the major version
  - Second is the minor version
  - Finally, the patch version
  
  ![mmp](../../images/mmp.PNG)
  
#### Kubernetes follows a standard software release versioning procedure
- You can find all kubernetes releases at https://github.com/kubernetes/kubernetes/releases

  ![r1](../../images/r1.PNG)
  
  ![r2](../../images/r2.PNG)
  
#### Downloaded package has all the kubernetes components in it except **`ETCD Cluster`** and **`CoreDNS`** as they are seperate projects.

 ![r3](../../images/r3.PNG)
 
#### References

 - https://blog.risingstack.com/the-history-of-kubernetes/
 - https://kubernetes.io/docs/setup/release/version-skew-policy/
 
 








================================================
FILE: docs/06-Cluster-Maintenance/05-Cluster-Upgrade-Introduction.md
================================================
# Cluster Upgrade Introduction
  - Take me to [Video Tutorial](https://kodekloud.com/topic/cluster-upgrade-introduction/)
  
#### Is it mandatory for all of the kubernetes components to have the same versions?
- No, The components can be at different release versions.
  
#### At any time, kubernetes supports only up to the recent 3 minor versions
- The recommended approach is to upgrade one minor version at a time.
  
  ![up2](../../images/up2.PNG)
  
#### Options to upgrade k8s cluster
 
  ![opt](../../images/opt.PNG)
  
## Upgrading a Cluster
- Upgrading a cluster involves 2 major steps
  
#### There are different strategies that are available to upgrade the worker nodes
- One is to upgrade all at once. But then your pods will be down and users will not be able to access the applications.
  ![stg1](../../images/stg1.PNG)
- Second one is to upgrade one node at a time. 
  ![stg2](../../images/stg2.PNG)
- Third one would be to add new nodes to the cluster
  ![stg3](../../images/stg3.PNG)
  
## kubeadm - Upgrade master node
- kubeadm has an upgrade command that helps in upgrading clusters.
  ```
  $ kubeadm upgrade plan
  ```
  ![kube1](../../images/kube1.png)
  
- Upgrade kubeadm from v1.11 to v1.12
  ```
  $ apt-get upgrade -y kubeadm=1.12.0-00
  ```
- Upgrade the cluster
  ```
  $ kubeadm upgrade apply v1.12.0
  ```
- If you run the 'kubectl get nodes' command, you will see the older version. This is because in the output of the command it is showing the versions of kubelets on each of these nodes registered with the API Server and not the version of API Server itself  
  ```
  $ kubectl get nodes
  ```
  
  ![kubeu](../../images/kubeu.PNG)
  
- Upgrade 'kubelet' on the master node
  ```
  $ apt-get upgrade kubelet=1.12.0-00
  ```
- Restart the kubelet
  ```
  $ systemctl restart kubelet
  ```
- Run 'kubectl get nodes' to verify
  ```
  $ kubectl get nodes
  ```
  
  ![kubeu1](../../images/kubeu1.PNG)
 
## kubeadm - Upgrade worker nodes
  
- From master node, run 'kubectl drain' command to move the workloads to other nodes
  ```
  $ kubectl drain node-1
  ```
- Upgrade kubeadm and kubelet packages
  ```
  $ apt-get upgrade -y kubeadm=1.12.0-00
  $ apt-get upgrade -y kubelet=1.12.0-00
  ```
- Update the node configuration for the new kubelet version
  ```
  $ kubeadm upgrade node config --kubelet-version v1.12.0
  ```
- Restart the kubelet service
  ```
  $ systemctl restart kubelet
  ```
- Mark the node back to schedulable
  ```
  $ kubectl uncordon node-1
  ```
  
  ![kubeu2](../../images/kubeu2.PNG)
  
- Upgrade all worker nodes in the same way

  ![kubeu3](../../images/kubeu3.PNG)
  

#### Demo Video on [Cluster Upgrade](https://kodekloud.com/topic/demo-cluster-upgrade/)

#### K8s Reference Docs
- https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/
- https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-upgrade/
  

================================================
FILE: docs/06-Cluster-Maintenance/06-Practice-Test-Cluster-Upgrade-Process.md
================================================
# Practice Test - Cluster Upgrade Process
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-cluster-upgrade-process/)
  
Solutions to practice test cluster upgrade process
- What is the current version of the cluster?
  
  <details>
  ```
  $ kubectl get nodes
  ```
  </details>
  
- How many nodes are part of this cluster?
  
  <details>
  ```
  $ kubctl get nodes
  ```
  </details>
  
- Check what nodes the pods are hosted on.
  
  <details>
  ```
  $ kubectl get pods -o wide
  ```
  </details>
  
- Count the number of deployments
  
  <details>
  ```
  $ kubectl get deploy
  ```
  </details>
  
- Run the command kubectl get pods -o wide
  
  <details>
  ```
  $ kubectl get pods -o wide
  ```
  </details>
  
- You are tasked to upgrade the cluster. User's accessing the applications must not be impacted. And you cannot provision new VMs. What strategy would you use to upgrade the cluster?
  
  <details>
  ```
  Upgrade one node at a time while moving the workloads to the other
  ```
  </details>
  
- Run the kubeadm upgrade plan command
  
  <details>
  ```
  $ kubeadm upgrade plan
  ```
  </details>
  
- Run the kubectl drain master --ignore-daemonsets
  
  <details>
  ```
  $ kubectl drain master --ignore-daemonsets
  ```
  </details>
  
- Run the command apt install kubeadm=1.18.0-00 and then kubeadm upgrade apply v1.18.0 and then apt install kubelet=1.18.0-00 to upgrade the kubelet on the master node
  
  <details>
  ```
  $ apt install kubeadm=1.18.0-00
  $ kubeadm upgrade apply v1.18.0 
  $ apt install kubelet=1.18.0-00
  ```
  </details>
  
- Run the command kubectl uncordon master
  
  <details>
  ```
  $ kubectl uncordon master 
  ```
  </details>
  
- Run the command kubectl drain node01 --ignore-daemonsets
  
  <details>
  ```
  $ kubectl drain node01 --ignore-daemonsets
  ```
  </details>
  
- Run the commands: apt install kubeadm=1.18.0-00 and then kubeadm upgrade node. Finally, run apt install kubelet=1.18.0-00.
  
  <details>
  ```
  $ apt install kubeadm=1.18.0-00
  $ kubeadm upgrade node
  $ apt install kubelet=1.18.0-00
  ```
  </details>
  
- Run the command kubectl uncordon node01
  
  <details>
  ```
  $ kubectl uncordon node01
  ```
  </details>



================================================
FILE: docs/06-Cluster-Maintenance/07-Backup-and-Restore-Methods.md
================================================
# Backup and Restore Methods
  - Take me to [Video Tutorial](https://kodekloud.com/topic/backup-and-restore-methods/)
  
In this section, we will take a look at backup and restore methods

## Backup Candidates
 
 ![bc](../../images/bc.PNG)
 
## Resource Configuration
- Imperative way
  
  ![rci](../../images/rci.PNG)

- Declarative Way (Preferred approach)
  ```
  apiVersion: v1
  kind: Pod
  metadata:
    name: myapp-pod
    labels:
      app: myapp
      type: front-end
  spec:
    containers:
    - name: nginx-container
      image: nginx
  ```
 ![rcd](../../images/rcd.PNG)
 
- A good practice is to store resource configurations on source code repositories like github.

  ![rcd1](../../images/rcd1.PNG)

## Backup - Resource Configs

  ```
  $ kubectl get all --all-namespaces -o yaml > all-deploy-services.yaml (only for few resource groups)
  ```

- There are many other resource groups that must be considered. There are tools like **`ARK`** or now called **`Velero`** by Heptio that can do this for you.

  ![brc](../../images/brc.PNG)
  
## Backup - ETCD
- So, instead of backing up resources as before, you may choose to backup the ETCD cluster itself. 
  
  ![be](../../images/be.PNG)
  
- You can take a snapshot of the etcd database by using **`etcdctl`** utility snapshot save command.
  ```
  $ ETCDCTL_API=3 etcdctl snapshot save snapshot.db
  ```
  ```
  $  ETCDCTL_API=3 etcdctl snapshot status snapshot.db
  ```
  ![be1](../../images/be1.PNG)
  
## Restore - ETCD
- To restore etcd from the backup at later in time. First stop kube-apiserver service
  ```
  $ service kube-apiserver stop
  ```
- Run the etcdctl snapshot restore command
- Update the etcd service
- Reload system configs
  ```
  $ systemctl daemon-reload
  ```
- Restart etcd
  ```
  $ service etcd restart
  ```
  
  ![er](../../images/er.PNG)
  
- Start the kube-apiserver
  ```
  $ service kube-apiserver start
  ```
#### With all etcdctl commands specify the cert,key,cacert and endpoint for authentication.
```
$ ETCDCTL_API=3 etcdctl \
  snapshot save /tmp/snapshot.db \
  --endpoints=https://[127.0.0.1]:2379 \
  --cacert=/etc/kubernetes/pki/etcd/ca.crt \
  --cert=/etc/kubernetes/pki/etcd/etcd-server.crt \
  --key=/etc/kubernetes/pki/etcd/etcd-server.key
```

  ![erest](../../images/erest.PNG)
  
#### K8s Reference Docs
- https://kubernetes.io/docs/tasks/administer-cluster/configure-upgrade-etcd/


 


================================================
FILE: docs/06-Cluster-Maintenance/08-Working-With-ETCDCTL.md
================================================
# Working with ETCDCTL
  - Take me [Tutorial](https://kodekloud.com/topic/working-with-etcdctl/)
  


================================================
FILE: docs/06-Cluster-Maintenance/09-Practice-Test-Backup-and-Restore-Methods.md
================================================
# Practice Test - Backup and Restore Methods
Take me to [Practice Test](https://kodekloud.com/topic/practice-test-backup-and-restore-methods/)

Solutions to practice test - Backup and Restore Methods

1.  <details>
    <summary>How many deployments exist in the cluster?</summary>

    ```
    kubectl get deployments
    ```
    </details>

1.  <details>
    <summary>What is the version of ETCD running on the cluster?</summary>

    ```
    kubectl describe pod -n kube-system etcd-controlplane
    ```

    Find the entry for `Image`
    </details>

1.  <details>
    <summary>At what address can you reach the ETCD cluster from the controlplane node?</summary>

    ```
    kubectl describe pod -n kube-system etcd-controlplane
    ```

    Under `Command` find `--listen-client-urls`
    </details>

1.  <details>
    <summary>Where is the ETCD server certificate file located?</summary>

    On kubeadm clusters like this one, the default location for certificate files is `/etc/kubernetes/pki/etcd`

    Choose the correct certificate
    </details>

1.  <details>
    <summary>Where is the ETCD CA Certificate file located?</summary>

    On kubeadm clusters like this one, the default location for certificate files is `/etc/kubernetes/pki/etcd`

    Choose the correct certificate
    </details>

1.  <details>
    <summary>Take a snapshot of the ETCD database using the built-in snapshot functionality.</br>Store the backup file at location <b>/opt/snapshot-pre-boot.db</b></summary>

    ```
    ETCDCTL_API=3 etcdctl snapshot save \
      --cacert=/etc/kubernetes/pki/etcd/ca.crt \
      --cert=/etc/kubernetes/pki/etcd/server.crt \
      --key=/etc/kubernetes/pki/etcd/server.key \
      /opt/snapshot-pre-boot.db
    ```
    </details> 

1. Information only.


1.  <details>
    <summary>Wake up! We have a conference call! After the reboot the master nodes came back online, but none of our applications are accessible. Check the status of the applications on the cluster. What's wrong?</summary>

    > All of the above
    </details>

1.  <details>
    <summary>Luckily we took a backup. Restore the original state of the cluster using the backup file.</summary>

    1. Restore the backup to a new directory

        ```
        ETCDCTL_API=3 etcdctl snapshot restore \
          --data-dir /var/lib/etcd-from-backup \
          /opt/snapshot-pre-boot.db
        ```

    1. Modify the `etcd` pod to use the new directory.

        To do this, we need to edit the `volumes` section and change the `hostPath` to be the directory we restored to.

        ```
        vi /etc/kubernetes/manifests/etcd.yaml
        ```

        ```yaml
          volumes:
          - hostPath:
              path: /etc/kubernetes/pki/etcd
              type: DirectoryOrCreate
            name: etcd-certs
          - hostPath:
              path: /var/lib/etcd      # <- change this
              type: DirectoryOrCreate
            name: etcd-data
        ```

        New value: `/var/lib/etcd-from-backup`

        Save this and wait for up to a minute for the `etcd` pod to reload.

    1. Verify

        ```
        kubectl get deployments
        kubectl get services
        ```
    </details>

See also: https://github.com/kodekloudhub/community-faq/blob/main/docs/etcd-faq.md


================================================
FILE: docs/06-Cluster-Maintenance/10-Practice-Test-Backup-and-Restore-Methods-2.md
================================================
# Practice Test - Backup and Restore Methods 2
  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-backup-and-restore-methods-2-2/)

Solutions to practice test - Backup and Restore Methods 2

In this test, we practice both with _stacked_ and _external_ etcd clusters.

1. Information only
1.  <details>
    <summary>Explore the student-node and the clusters it has access to.</summary>

    ```bash
    kubectl config get-contexts
    ```

    </details>
1.  <details>
    <summary>How many clusters are defined in the kubeconfig on the student-node?</summary>

    ```bash
    kubectl config get-contexts
    ```

    > 2

    </details>
1.  <details>
    <summary>How many nodes (both controlplane and worker) are part of cluster1?</summary>

    ```bash
    kubectl config use-context cluster1
    kubectl get nodes
    ```

    > 2

    </details>
1.  <details>
    <summary>What is the name of the controlplane node in cluster2?</summary>

    ```bash
    kubectl config use-context cluster2
    kubectl get nodes
    ```

    > cluster2-controlplane

    </details>
1. Information only
1.  <details>
    <summary>How is ETCD configured for cluster1?</summary>

    ```bash
    kubectl config use-context cluster1
    kubectl get pods -n kube-system
    ```

    > From the output we can see a pod for etcd, therefore the answer is `Stacked ETCD`

    </details>
1.  <details>
    <summary>How is ETCD configured for cluster2?</summary>

    ```bash
    kubectl config use-context cluster2
    kubectl get pods -n kube-system
    ```

    > From the output we can see no pod for etcd. Since no etcd is not an option for a _functioning_ cluster the answer must therefore be `External ETCD`

    </details>
1.  <details>
    <summary>What is the IP address of the External ETCD datastore used in cluster2?</summary>

    For this, we need to exampine the API server configuration

    ```bash
    kubectl config use-context cluster2
    kubectl get pods -n kube-system kube-apiserver-cluster2-controlplane -o yaml | grep etcd
    ```

    > From the output, locate `--etcd-servers`. The IP address in this line is the answer.

    </details>
1.  <details>
    <summary>What is the default data directory used the for ETCD datastore used in cluster1?</summary>

    For this, we need to examine the etcd manifest on the control plane node, and we need to find out the hostpath of its `etcd-data` volume.

    ```bash
    kubectl config use-context cluster1
    kubectl get pods -n kube-system etcd-cluster1-controlplane -o yaml
    ```

    In the output, find the `volumes` section. The host path of the volume named `etcd-data` is the answer.

    > /var/lib/etcd

    </details>
1. Information only
1.  <details>
    <summary>What is the default data directory used the for ETCD datastore used in cluster2?</summary>

    For this, we need to examine the system unit file for the etcd service. Remember that for external etcd, it is running as an operating system service.

    ```bash
    ssh etcd-server
    ```

    ```bash
    # Verify the name of the service
    systemctl list-unit-files | grep etcd

    # Using the output from above command
    systemctl cat etcd.service
    ```

    Note the comment line in the output. This tells you where the service unit file is. We are going to need to edit this file in a later question!

    From the output, locate `--data-dir`

    > /var/lib/etcd-data

    Return to the student node:

    ```bash
    exit
    ```

    </details>
1.  <details>
    <summary>How many other nodes are part of the ETCD cluster that etcd-server is a part of?</summary>

    This question is somewhat contentious. It ought not to contain the word `other`. The required answer is

    > 1

    </details>
1.  <details>
    <summary>Take a backup of etcd on cluster1 and save it on the student-node at the path /opt/cluster1.db</summary>

    For this, we need to do the backup on the control node, then pull it back to the student node.

    ```bash
    ssh cluster1-controlplane
    ```

    ```bash
    ETCDCTL_API=3 etcdctl snapshot save \
      --cacert /etc/kubernetes/pki/etcd/ca.crt \
      --cert /etc/kubernetes/pki/etcd/server.crt \
      --key /etc/kubernetes/pki/etcd/server.key \
      cluster1.db

    # Return to student node
    exit
    ```

    ```bash
    scp cluster1-controlplane:~/cluster1.db /opt/
    ```

    </details>
1.  <details>
    <summary>An ETCD backup for cluster2 is stored at /opt/cluster2.db. Use this snapshot file to carry out a restore on cluster2 to a new path <b>/var/lib/etcd-data-new</b>.</summary>

    As you recall, `cluster2` is using _external_ etcd. This means
    * `etcd` does not have to be on the control plane node of the cluster. In this case, it is not.
    * `etcd` runs as an operating system service not a pod, therefore there is no manifest file to edit. Changes are instead made to a service unit file.</br></br>

    There are several parts to this question. Let's go through them one at a time.

    1.  <details>
        <summary>Move the backup to the etcd-server node</summary>

        ```bash
        scp /opt/cluster2.db etcd-server:~/
        ```
        </details>
    1.  <details>
        <summary>Log into etcd-server node</summary>

        ```bash
        ssh etcd-server
        ```

        </details>
    1.  <details>
        <summary>Check the ownership of the current etcd-data directory</summary>

        We will need to ensure correct ownership of our restored data. We determined the location of the data directory in Q12

        ```bash
        ls -ld /var/lib/etcd-data/
        ```

        > Note that owner and group are both `etcd`
        </details>
    1.  <details>
        <summary>Do the restore</summary>

        ```bash
        ETCDCTL_API=3 etcdctl snapshot restore \
            --data-dir /var/lib/etcd-data-new \
            cluster2.db
        ```

        </details>
    1.  <details>
        <summary>Set ownership on the restored directory</summary>

        ```bash
        chown -R etcd:etcd /var/lib/etcd-data-new
        ```

        </detials>
    1.  <details>
        <summary>Reconfigure and restart etcd</summary>

        We will need the location of the service unit file which we also determined in Q12

        ```bash
        vi /etc/systemd/system/etcd.service
        ```

        Edit the `--data-dir` argument to the newly restored directory, and save.

        Finally, reload and restart the `etcd` service. Whenever you have edited a service unit file, a `daemon-reload` is required to reload the in-memory configuration of the `systemd` service.

        ```bash
        systemctl daemon-reload
        systemctl restart etcd.service
        ```

        Return to the student node:

        ```bash
        exit
        ```

        </details>
    1.  <details>
        <summary>Verify the restore</summary>

        ```bash
        kubectl config use-context cluster2
        kubectl get all -n critical
        ```

        </details>
    </details>


================================================
FILE: docs/06-Cluster-Maintenance/11-Download-Presentation-Deck.md
================================================
# Download Presentation Deck
  - Take me to [Presentation Deck](https://kodekloud.com/topic/download-presentation-deck-5/)


================================================
FILE: docs/07-Security/01-Security-Section-Introduction.md
================================================
# Security Section Introduction
  - Take me to [Video Tutorial](https://kodekloud.com/topic/security-section-introduction/)

In this section, we will take a look at security section introduction
- Kubernetes Security Primitives
- Authentication
- TLS certificates for cluster components
- Secure Persistent key-value store
- Authorization
- Images Security
- Security Contexts
- Network Policies   


================================================
FILE: docs/07-Security/02-Kubernetes-Security-Primitives.md
================================================
# Kubernetes Security Primitives
  - Take me to [Video Tutorial](https://kodekloud.com/topic/kubernetes-security-primitives/)
  
In this section, we will take a look at kubernetes security primitives

## Secure Hosts

 ![sech](../../images/sech.PNG)
  
## Secure Kubernetes
- We need to make two types of decisions.
  - Who can access?
  - What can they do?
 
  ![seck](../../images/seck.PNG)
  
## Authentication
- Who can access the API Server is defined by the Authentication mechanisms.
  
## Authorization
- Once they gain access to the cluster, what they can do is defined by authorization mechanisms.

## TLS Certificates
- All communication with the cluster, between the various components such as the ETCD Cluster, kube-controller-manager, scheduler, api server, as well as those running on the working nodes such as the kubelet and kubeproxy is secured using TLS encryption.

 ![tls](../../images/tls.PNG)
 
## Network Policies
What about communication between applications within the cluster?

  ![np](../../images/np.PNG)
  


================================================
FILE: docs/07-Security/03-Authentication.md
================================================
# Authentication
  - Take me to [Video Tutorial](https://kodekloud.com/topic/authentication/)
  
In this section, we will take a look at authentication in a kubernetes cluster

## Accounts

  ![auth1](../../images/auth1.PNG)
  
#### Different users that may be accessing the cluster security of end users who access the applications deployed on the cluster is managed by the applications themselves internally.

 ![acc1](../../images/acc1.PNG)
 
- So, we left with 2 types of users
  - Humans, such as the Administrators and Developers
  - Robots such as other processes/services or applications that require access to the cluster.
  

  ![acc2](../../images/acc2.PNG)
  
- All user access is managed by apiserver and all of the requests goes through apiserver.
 
  ![acc3](../../images/acc3.PNG)
  
## Authentication Mechanisms
- There are different authentication mechanisms that can be configured.

  ![auth2](../../images/auth2.PNG)
  
## Authentication Mechanisms - Basic
  
  ![auth3](../../images/auth3.PNG)
  
## kube-apiserver configuration
- If you set up via kubeadm then update kube-apiserver.yaml manifest file with the option.
  
  ![auth4](../../images/auth4.PNG)
  
## Authenticate User

- To authenticate using the basic credentials while accessing the API server specify the username and password in a curl command.
  ```
  $ curl -v -k http://master-node-ip:6443/api/v1/pods -u "user1:password123"
  ```
  ![auth5](../../images/auth5.PNG)
  
- We can have additional column in the user-details.csv file to assign users to specific groups.

  ![auth6](../../images/auth6.PNG)
  
## Note
 
 ![note](../../images/note.PNG)
  
  
#### K8s Reference Docs
- https://kubernetes.io/docs/reference/access-authn-authz/authentication/ 
  
  


================================================
FILE: docs/07-Security/04-TLS-Certificates.md
================================================
# TLS Certificates Introduction
  - Take me to [Video Tutorial](https://kodekloud.com/topic/tls-introduction/)
  
In this section, we will take a look at TLS certificates
- What are TLS certificates?
- How does kubernetes use certificates?
- How to generate them?
- How to configure them?
- How to view them?
- How to troubleshoot issues related to certificates


================================================
FILE: docs/07-Security/05-TLS-Basics.md
================================================
# TLS Basics
  - Take me to [Video Tutorial](https://kodekloud.com/topic/tls-basics/)
  
In this section, we will take a look at TLS Basics

## Certificate
- A certificate is used to guarantee trust between 2 parties during a transaction.
- Example: when a user tries to access web server, tls certificates ensure that the communication between them is encrypted.

  ![cert1](../../images/cert1.PNG)
  
  
## Symmetric Encryption
- It is a secure way of encryption, but it uses the same key to encrypt and decrypt the data and the key has to be exchanged between the sender and the receiver, there is a risk of a hacker gaining access to the key and decrypting the data.

  ![cert2](../../images/cert2.PNG)
  
## Asymmetric Encryption
- Instead of using single key to encrypt and decrypt data, asymmetric encryption uses a pair of keys, a private key and a public key.

  ![cert3](../../images/cert3.PNG)
  
  ![cert4](../../images/cert4.PNG)
  
  ![cert5](../../images/cert5.PNG)
  
  ![cert6](../../images/cert6.PNG)
  

#### How do you look at a certificate and verify if it is legit?
- who signed and issued the certificate.
- If you generate the certificate then you will have it sign it by yourself; that is known as self-signed certificate.

  ![cert7](../../images/cert7.PNG)
  
#### How do you generate legitimate certificate? How do you get your certificates singed by someone with authority?
- That's where **`Certificate Authority (CA)`** comes in for you. Some of the popular ones are Symantec, DigiCert, Comodo, GlobalSign etc.

  ![cert8](../../images/cert8.PNG)
  
  ![cert9](
Download .txt
gitextract_rwswyqhk/

├── .gitignore
├── README.md
├── apple-silicon/
│   └── README.md
├── docs/
│   ├── 01-Introduction/
│   │   ├── 01-Course-Introduction.md
│   │   └── 02-Certification.md
│   ├── 02-Core-Concepts/
│   │   ├── 01-Core-Concepts-Section-Introduction.md
│   │   ├── 02-Cluster-Architecture.md
│   │   ├── 03-Docker-vs-ContainerD.md
│   │   ├── 04-ETCD-For-Beginners.md
│   │   ├── 05-ETCD-in-Kubernetes.md
│   │   ├── 06-Kube-API-Server.md
│   │   ├── 07-Kube-Controller-Manager.md
│   │   ├── 08-Kube-Scheduler.md
│   │   ├── 09-Kubelet.md
│   │   ├── 10-Kube-Proxy.md
│   │   ├── 11-Pods.md
│   │   ├── 12-Practice-Test-Introduction.md
│   │   ├── 13-Practice-Test-PODs.md
│   │   ├── 14-ReplicaSets.md
│   │   ├── 15-Practice-Tests-ReplicaSet.md
│   │   ├── 16-Deployments.md
│   │   ├── 17-Practice-Tests-Deployments.md
│   │   ├── 18-Namespaces.md
│   │   ├── 19-Practice-Test-Namespaces.md
│   │   ├── 20-Services.md
│   │   ├── 21-Services-ClusterIP.md
│   │   ├── 22-Practice-Test-Services.md
│   │   ├── 23-Imperative-Commands-with-kubectl.md
│   │   ├── 24-Practice-Test-Imperative-Commands.md
│   │   └── 25-Attachments.md
│   ├── 03-Scheduling/
│   │   ├── 01-Scheduling-Section-Introduction.md
│   │   ├── 02-Manual-Scheduling.md
│   │   ├── 03-Practice-Test-Manual-Scheduling.md
│   │   ├── 04-Labels-and-Selectors.md
│   │   ├── 05-Practice-Test-Labels-and-Selectors.md
│   │   ├── 06-Taints-and-Tolerations.md
│   │   ├── 07-Practice-Test-Taints-and-Tolerations.md
│   │   ├── 08-Node-Selectors.md
│   │   ├── 09-Node-Affinity.md
│   │   ├── 10-Practice-Test-Node-Affinity.md
│   │   ├── 11.Taints-and-Tolerations-vs-Node-Affinity.md
│   │   ├── 12-Resource-Limits.md
│   │   ├── 13-Practice-Test-Resource-Limits.md
│   │   ├── 14-DaemonSets.md
│   │   ├── 15-Practice-Test-DaemonSets.md
│   │   ├── 16-Static-Pods.md
│   │   ├── 17-Practice-Test-StaticPods.md
│   │   ├── 18-Multiple-Schedulers.md
│   │   ├── 19-Practice-Test-Multiple-Schedulers.md
│   │   ├── 20-Configuring-Kubernetes-Schedulers.md
│   │   └── 21-Download-Presentation-Deck.md
│   ├── 04-Logging-and-Monitoring/
│   │   ├── 01-Logging-and-Monitoring-Section-Introduction.md
│   │   ├── 02-Monitor-Cluster-Components.md
│   │   ├── 03-Practice-Test-Monitor-Cluster-Components.md
│   │   ├── 04-Managing-Application-Logs.md
│   │   ├── 05-Download-Presentation-Deck.md
│   │   └── 06-Practice-Test-Managing-Application-Logs.md
│   ├── 05-Application-Lifecycle-Management/
│   │   ├── 01-Application-Lifecycle-Management--Section-Introduction.md
│   │   ├── 02-RollingUpdates-and-Rollback.md
│   │   ├── 03-Practice-Test-RollingUpdates-Rollback.md
│   │   ├── 04-Commands-and-Arguments-in-Docker.md
│   │   ├── 05-Commands-and-Arguments-in-Kubernetes.md
│   │   ├── 06-Practice-Test-Commands-and-Arguments.md
│   │   ├── 07.Configure-Environment-Variables-in-Applications.md
│   │   ├── 08-Configure-ConfigMaps-in-Applications.md
│   │   ├── 09-Practice-Test-Env-Variables.md
│   │   ├── 10.Secrets.md
│   │   ├── 11.Practice-Test-Secrets.md
│   │   ├── 12.Multi-Containers-PODs.md
│   │   ├── 13-Practice-Test-Multi-Container-Pods.md
│   │   ├── 14-Multi-Container-Pods-Design-Patterns.md
│   │   ├── 15.Init-Containers.md
│   │   ├── 16-Practice-Test-Init-Containers.md
│   │   ├── 17.Self-Healing-Applications.md
│   │   └── 18.Download-Presentation-Deck.md
│   ├── 06-Cluster-Maintenance/
│   │   ├── 01-Cluster-Maintenance-Section-Introduction.md
│   │   ├── 02-OS-Upgrades.md
│   │   ├── 03-Practice-Test-OS-Upgrades.md
│   │   ├── 04-Kubernetes-Software-Versions.md
│   │   ├── 05-Cluster-Upgrade-Introduction.md
│   │   ├── 06-Practice-Test-Cluster-Upgrade-Process.md
│   │   ├── 07-Backup-and-Restore-Methods.md
│   │   ├── 08-Working-With-ETCDCTL.md
│   │   ├── 09-Practice-Test-Backup-and-Restore-Methods.md
│   │   ├── 10-Practice-Test-Backup-and-Restore-Methods-2.md
│   │   └── 11-Download-Presentation-Deck.md
│   ├── 07-Security/
│   │   ├── 01-Security-Section-Introduction.md
│   │   ├── 02-Kubernetes-Security-Primitives.md
│   │   ├── 03-Authentication.md
│   │   ├── 04-TLS-Certificates.md
│   │   ├── 05-TLS-Basics.md
│   │   ├── 06-TLS-in-Kubernetes.md
│   │   ├── 07-TLS-in-Kubernetes-Certificate-Creation.md
│   │   ├── 08-View-Certificate-Details.md
│   │   ├── 09-Certificate-Health-Check-Spreadsheet.md
│   │   ├── 10-Practice-Test-View-Certificate-Details.md
│   │   ├── 11-Certificate-API.md
│   │   ├── 12-Practice-Test-Certificates-API.md
│   │   ├── 13-kubeconfig.md
│   │   ├── 14-Practice-Test-KubeConfig.md
│   │   ├── 15-API-Groups.md
│   │   ├── 16-Authorization.md
│   │   ├── 17-RBAC.md
│   │   ├── 18-Practice-Test-RBAC.md
│   │   ├── 19-Cluster-Roles.md
│   │   ├── 20-Practice-Test-Cluster-Roles.md
│   │   ├── 21-Service-Account.md
│   │   ├── 22-Practice-Test-Service-Accounts.md
│   │   ├── 23-Image-Security.md
│   │   ├── 24-Practice-Test-Image-Security.md
│   │   ├── 25-Security-Context.md
│   │   ├── 26-Practice-Test-Security-Context.md
│   │   ├── 27-Network-Policies.md
│   │   ├── 28-Practice-Test-Network-Policies.md
│   │   ├── 29-kubectx-and-kubens-commands.md
│   │   └── 30-Download-Presentation-Deck.md
│   ├── 08-Storage/
│   │   ├── 01-Storage-Section-Introduction.md
│   │   ├── 02-Introduction-to-Docker-Storage.md
│   │   ├── 03-Storage-in-Docker.md
│   │   ├── 04-Volume-Driver-Plugins-in-Docker.md
│   │   ├── 05-Container.Storage-Interface.md
│   │   ├── 06-Volumes.md
│   │   ├── 07-Persistent-Volumes.md
│   │   ├── 08-Persistent-Volume-Claims.md
│   │   ├── 09-Using-PVC-in-PODs.md
│   │   ├── 10-Practice-Test-Persistent-Volume-Claims.md
│   │   ├── 11-Download-Presentation-Deck.md
│   │   ├── 12-Storage-Class.md
│   │   └── 13-Practice-Test-Storage-Class.md
│   ├── 09-Networking/
│   │   ├── 01-Networking-Introduction.md
│   │   ├── 02-Pre-requisite-Switching-Routing-Gateways.md
│   │   ├── 03-Pre-requisite-DNS.md
│   │   ├── 04-Pre-requisite-CoreDNS.md
│   │   ├── 05-Pre-requisite-Network-Namespace.md
│   │   ├── 06-Pre-requisite-Docker-Networking.md
│   │   ├── 07-Pre-requisite-CNI.md
│   │   ├── 08-Cluster-Networking.md
│   │   ├── 09-Practice-Test-Explore-Env.md
│   │   ├── 10-Pod-Networking.md
│   │   ├── 11-CNI-in-Kubernetes.md
│   │   ├── 12-CNI-weave.md
│   │   ├── 13-Practice-Test-CNI-weave.md
│   │   ├── 14-Practice-Test-Deploy-Network-Solution.md
│   │   ├── 15-ipam-weave.md
│   │   ├── 16-Practice-Test-Networking-weave.md
│   │   ├── 17-Service-Networking.md
│   │   ├── 18-Practice-Test-Service-Networking.md
│   │   ├── 19-DNS-in-kubernetes.md
│   │   ├── 20-CoreDNS-in-Kubernetes.md
│   │   ├── 21-Practice-Test-CoreDNS-in-Kubernetes.md
│   │   ├── 22-Ingress.md
│   │   ├── 23-Ingress-Annotations-and-rewrite-target.md
│   │   ├── 24-Practice-Test-CKA-Ingress-Net-1.md
│   │   ├── 25-Practice-Test-CKA-Ingress-Net-2.md
│   │   └── 26-Dowload-Presentation-Deck.md
│   ├── 10-Design-and-Install-Kubernetes-Cluster/
│   │   ├── 01-Designing-a-Kubernetes-Cluster.md
│   │   ├── 02-Choosing-Kubernetes-Infrastructure.md
│   │   ├── 03-Configure-High-Availability.md
│   │   ├── 04-ETCD-in-HA.md
│   │   ├── 05-Important-update-kubernetes-the-hard-way.md
│   │   └── 06-Download-Presentation-Deck.md
│   ├── 11-Install-Kubernetes-the-kubeadm-way/
│   │   ├── 01-Introduction-to-Deployment-with-kubeadm.md
│   │   ├── 02-Resources.md
│   │   ├── 03-Provision-VMs-with-Vagrant.md
│   │   ├── 04-Demo-Deployment-with-Kubeadm.md
│   │   └── 05-Practice-Test-Deploy-Kubernetes-Cluster-using-Kubeadm.md
│   ├── 12-Troubleshooting/
│   │   ├── 01-Troubelshooting-Section-Introduction.md
│   │   ├── 02-Application-Failure.md
│   │   ├── 03-Solution-Application-Failure.md
│   │   ├── 04-Control-Plane-Failure.md
│   │   ├── 05-Practice-Test-Control-Plane-Failure.md
│   │   ├── 06-Solution-Control-Plane-Failure.md
│   │   ├── 07-Worker-Node-Failure.md
│   │   ├── 08-Practice-Test-Worker-Node-Failure.md
│   │   ├── 09-Solution-Worker-Node-Failure.md
│   │   └── 10-Practice-Test-Troubleshoot-Network.md
│   ├── 13-Other-Topics/
│   │   ├── 01-Labs-JSON-PATH.md
│   │   ├── 02-Pre-Requisites-JSON-PATH.md
│   │   ├── 03-Advance-Kubectl-Commands.md
│   │   └── 04-Practice-Test-Advance-Kubectl-Commands.md
│   ├── 14-Lightning-Labs/
│   │   ├── 01-Lightning-Labs-Introduction.md
│   │   └── 02-Lightning-Lab-1.md
│   ├── 15-Mock-Exams/
│   │   ├── 01-Introduction.md
│   │   ├── 02-Mock-Exam-1.md
│   │   ├── 03-Mock-Exam-2.md
│   │   ├── 04-CKA-MockExam-2-Solution.md
│   │   ├── 05-Mock-Exam-3.md
│   │   └── 06-CKA-MockExam-3-Solution.md
│   ├── 16-Ultimate-Mocks/
│   │   ├── 02-Troubleshooting/
│   │   │   ├── README.md
│   │   │   └── docs/
│   │   │       ├── 11-C1-orange-pvc-cka13-trb.md
│   │   │       └── 19-C1-netpol-cyan-pod-cka28-trb.md
│   │   ├── 04-Storage/
│   │   │   ├── README.md
│   │   │   └── docs/
│   │   │       └── 10-CI-olive-pvc-cka10-str.md
│   │   ├── 05-Services-Networking/
│   │   │   ├── README.md
│   │   │   └── docs/
│   │   │       └── 03-C3-External-Webserver.md
│   │   ├── 09-general/
│   │   │   ├── README.md
│   │   │   └── docs/
│   │   │       └── 01-cluster-state-questions.md
│   │   └── README.md
│   └── 17-tips-and-tricks/
│       ├── README.md
│       └── docs/
│           ├── 01-server-for-testing-network-policies.md
│           └── 02-client--for-testing-network-things.md
├── images/
│   └── Readme.md
├── kubeadm-clusters/
│   ├── README.md
│   ├── apple-silicon/
│   │   ├── README.md
│   │   ├── delete-virtual-machines.sh
│   │   ├── deploy-virtual-machines.sh
│   │   ├── docs/
│   │   │   ├── 01-prerequisites.md
│   │   │   ├── 02-compute-resources.md
│   │   │   └── 03-connectivity.md
│   │   └── scripts/
│   │       ├── 01-setup-hosts.sh
│   │       ├── 02-setup-kernel.sh
│   │       ├── 03-setup-nodes.sh
│   │       ├── 04-kube-components.sh
│   │       ├── 05-deploy-controlplane.sh
│   │       ├── 06-deploy-workers.sh
│   │       └── tmux.conf
│   ├── aws/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── docs/
│   │   │   ├── 01-prerequisites.md
│   │   │   ├── 02-compute-resources.md
│   │   │   └── 03-connectivity.md
│   │   ├── kubeadm-aws.drawio
│   │   └── terraform/
│   │       ├── controlplane.sh
│   │       ├── data.tf
│   │       ├── ec2.tf
│   │       ├── main.tf
│   │       ├── security_groups.tf
│   │       └── variables.tf
│   ├── aws-ha/
│   │   ├── .gitignore
│   │   ├── README.md
│   │   ├── docs/
│   │   │   ├── 01-prerequisites.md
│   │   │   ├── 02-compute-resources.md
│   │   │   ├── 03-connectivity.md
│   │   │   ├── 04-loadbalancer.md
│   │   │   ├── 05-node-setup.md
│   │   │   ├── 06-controlplane.md
│   │   │   ├── 07-workers.md
│   │   │   └── 08-test.md
│   │   ├── kubeadm-aws-ha.drawio
│   │   └── terraform/
│   │       ├── controlplane.sh
│   │       ├── data.tf
│   │       ├── ec2.tf
│   │       ├── lb.sh
│   │       ├── main.tf
│   │       ├── security_groups.tf
│   │       └── variables.tf
│   ├── generic/
│   │   ├── 04-node-setup.md
│   │   ├── 05-controlplane.md
│   │   ├── 06-workers.md
│   │   ├── 07-test.md
│   │   └── README.md
│   └── virtualbox/
│       ├── .gitignore
│       ├── README.md
│       ├── Vagrantfile
│       ├── docs/
│       │   ├── 01-prerequisites.md
│       │   ├── 02-compute-resources.md
│       │   └── 03-connectivity.md
│       ├── mac/
│       │   └── mac-bridge.sh
│       ├── tools/
│       │   └── lab-script-generator.py
│       └── ubuntu/
│           ├── cert_verify.sh
│           ├── setup-kernel.sh
│           ├── ssh.sh
│           ├── tmux.conf
│           ├── update-dns.sh
│           ├── vagrant/
│           │   ├── controlplane.sh
│           │   ├── install-guest-additions.sh
│           │   ├── node-setup.sh
│           │   └── setup-hosts.sh
│           └── vimrc
├── managed-clusters/
│   ├── README.md
│   ├── aks/
│   │   ├── console/
│   │   │   ├── README.md
│   │   │   └── docs/
│   │   │       ├── 01-sign-in.md
│   │   │       ├── 02-create-service.md
│   │   │       ├── 03-create-cluster.md
│   │   │       ├── 04-creation-form.md
│   │   │       ├── 05-node-pools.md
│   │   │       ├── 06-networking.md
│   │   │       ├── 07-monitoring.md
│   │   │       ├── 08-review-and-create.md
│   │   │       └── 09-connect.md
│   │   ├── terraform/
│   │   │   ├── README.md
│   │   │   ├── docs/
│   │   │   │   ├── 01-sign-in.md
│   │   │   │   ├── 02-cloudshell.md
│   │   │   │   ├── 03-install-terraform.md
│   │   │   │   └── 04-deploy-cluster.md
│   │   │   ├── environment.sh
│   │   │   └── main.tf
│   │   └── terraform_local/
│   │       ├── README.md
│   │       ├── docs/
│   │       │   ├── 01-sign-in.md
│   │       │   ├── 02-install-softwares.md
│   │       │   ├── 03-setting-variable.md
│   │       │   └── 04-deploy-cluster.md
│   │       ├── environment.ps1
│   │       ├── environment.sh
│   │       └── main.tf
│   ├── eks/
│   │   └── console/
│   │       ├── README.md
│   │       └── docs/
│   │           ├── 01-sign-in.md
│   │           ├── 02-create-service-role.md
│   │           ├── 03-configure-cluster.md
│   │           ├── 04-networking.md
│   │           ├── 05-create-cluster.md
│   │           ├── 06-nodes.md
│   │           ├── 07-join-nodes.md
│   │           └── 08-node-port.md
│   └── gke/
│       ├── console/
│       │   ├── README.md
│       │   └── docs/
│       │       ├── 01-sign-in.md
│       │       ├── 02-create-cluster.md
│       │       ├── 03-node-setup.md
│       │       └── 04-connect.md
│       └── terraform/
│           ├── README.md
│           ├── docs/
│           │   ├── 01-sign-in.md
│           │   ├── 02-install-terraform.md
│           │   └── 03-deploy-cluster.md
│           └── main.tf
├── metrics-staging-scripts/
│   ├── high_cpu_node.sh
│   ├── high_cpu_pod.sh
│   ├── high_cpu_pod_1.yaml
│   ├── high_memory_node.sh
│   ├── high_memory_pod.sh
│   └── high_memory_pod.yaml
└── resources/
    ├── app-wl03.yaml
    ├── beta-logger.yaml
    ├── beta-namespace.yaml
    ├── calico/
    │   └── calico.yaml
    ├── custom-cni/
    │   ├── canal.yaml
    │   └── flannel.yaml
    ├── elastic-app-cka02-arch.yaml
    ├── essports-wl02.yaml
    ├── frontend-wl04.yaml
    ├── high_cpu_node.sh
    ├── high_cpu_pod.sh
    ├── high_cpu_pod.yaml
    ├── high_cpu_pod_1.yaml
    ├── high_memory_node.sh
    ├── high_memory_pod.sh
    ├── high_memory_pod.yaml
    ├── high_memory_pod_1.yaml
    ├── nginx-wl06.yaml
    ├── ns10-apd.yaml
    ├── staging-scripts/
    │   ├── alpha-ns-apd-13.yaml
    │   ├── check-connection.sh
    │   ├── circle-apd15.yaml
    │   ├── create_user_certs.sh
    │   ├── deploy.yaml
    │   ├── foundary-apd6.yaml
    │   ├── get-highest-pod.sh
    │   ├── ingress-application-ckad.yaml
    │   ├── ingress-controller-ckad.yaml
    │   ├── ingress-resource-ckad.yaml
    │   ├── ingress-staging-cka04-svcn.sh
    │   ├── install-webserver-cka03-svcn.sh
    │   ├── news-apd.yaml
    │   ├── results-apd.yaml
    │   ├── svc03-install-webserver.sh
    │   ├── svn-01.yaml
    │   ├── svn-template-01.yaml
    │   ├── test-v-apd14.yaml
    │   ├── update-ns-kubelet-cka01-svcn.sh
    │   ├── webapp-apd05.yaml
    │   └── webapp-wear.yaml
    ├── statging-cka16-trb-1.yaml
    ├── statging-cka16-trb-2.yaml
    ├── stating-cluster2-cka26.yaml
    ├── trace-wl08.yaml
    ├── weave/
    │   └── weave-daemonset-k8s.yaml
    ├── webapp-color-wl10.yaml
    ├── webapp-pod-wl05.yaml
    ├── webapp-wear-cka09-svcn.yaml
    └── webapp-wl07.yaml
Download .txt
SYMBOL INDEX (2 symbols across 1 files)

FILE: kubeadm-clusters/virtualbox/tools/lab-script-generator.py
  class State (line 23) | class State(Enum):
  function write_script (line 53) | def write_script(filename: str, script: list):
Condensed preview — 369 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,592K chars).
[
  {
    "path": ".gitignore",
    "chars": 41,
    "preview": ".vscode/\n.infracost/\n.vagrant/\n.DS_Store\n"
  },
  {
    "path": "README.md",
    "chars": 18080,
    "preview": "# Certified Kubernetes Administrator (CKA) Course\n\nThese are notes from the [Certified Kubernetes Administrator Course]("
  },
  {
    "path": "apple-silicon/README.md",
    "chars": 111,
    "preview": "# Installing Kubernetes the kubeadm way on Apple Silicon\n\nMoved to [here](../kubeadm-clusters/apple-silicon/).\n"
  },
  {
    "path": "docs/01-Introduction/01-Course-Introduction.md",
    "chars": 3139,
    "preview": "# Course Introduction\n\n  - Take me to the [Video Tutorial](https://kodekloud.com/topic/course-introduction-5/)\n\n#### Thi"
  },
  {
    "path": "docs/01-Introduction/02-Certification.md",
    "chars": 577,
    "preview": "# Certification\n\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/certification/)\n  \n## Certification Details"
  },
  {
    "path": "docs/02-Core-Concepts/01-Core-Concepts-Section-Introduction.md",
    "chars": 613,
    "preview": "# Core Concepts Section Introduction\n\n - Take me to the [Video Tutorial](https://kodekloud.com/topic/core-concepts-secti"
  },
  {
    "path": "docs/02-Core-Concepts/02-Cluster-Architecture.md",
    "chars": 434,
    "preview": "# Cluster Architecture\n\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/cluster-architecture/)\n\nIn this sect"
  },
  {
    "path": "docs/02-Core-Concepts/03-Docker-vs-ContainerD.md",
    "chars": 14213,
    "preview": "# Docker vs. ContainerD\n\nIn this section we will look at the differences between Docker and ContainerD\n\n\nSo you’re going"
  },
  {
    "path": "docs/02-Core-Concepts/04-ETCD-For-Beginners.md",
    "chars": 2173,
    "preview": "# ETCD for Beginners\n  - Take me to the [Video Tutorial](https://kodekloud.com/topic/etcd-for-beginners/)\n\n  In this sec"
  },
  {
    "path": "docs/02-Core-Concepts/05-ETCD-in-Kubernetes.md",
    "chars": 2635,
    "preview": "# ETCD in Kubernetes\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/etcd-in-kubernetes/)\n\nIn this section, "
  },
  {
    "path": "docs/02-Core-Concepts/06-Kube-API-Server.md",
    "chars": 2676,
    "preview": "# Kube API Server\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/kube-api-server/)\n  \nIn this section, we w"
  },
  {
    "path": "docs/02-Core-Concepts/07-Kube-Controller-Manager.md",
    "chars": 3233,
    "preview": "# Kube Controller Manager\n\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/kube-controller-manager/)\n  \nIn t"
  },
  {
    "path": "docs/02-Core-Concepts/08-Kube-Scheduler.md",
    "chars": 2103,
    "preview": "# Kube Scheduler\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/kube-scheduler/)\n\nIn this section, we will "
  },
  {
    "path": "docs/02-Core-Concepts/09-Kubelet.md",
    "chars": 1362,
    "preview": "# Kubelet\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/kubelet/)\n  \nIn this section we will take a look a"
  },
  {
    "path": "docs/02-Core-Concepts/10-Kube-Proxy.md",
    "chars": 1339,
    "preview": "# Kube Proxy\n- Take me to [Video Tutorial](https://kodekloud.com/topic/kube-proxy/)\n\nIn this section, we will take a loo"
  },
  {
    "path": "docs/02-Core-Concepts/11-Pods.md",
    "chars": 1359,
    "preview": "# Pods\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/pods-2/)\n  \nIn this section, we will take a look at P"
  },
  {
    "path": "docs/02-Core-Concepts/12-Practice-Test-Introduction.md",
    "chars": 180,
    "preview": "# Practice Test Introduction\n\nIn this section, we will take a look at practice test demo.\n- Take me to [Video Tutorial]("
  },
  {
    "path": "docs/02-Core-Concepts/13-Practice-Test-PODs.md",
    "chars": 4965,
    "preview": "# Practice Test - PODs\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-pods/)\n\n## Here are the "
  },
  {
    "path": "docs/02-Core-Concepts/14-ReplicaSets.md",
    "chars": 3744,
    "preview": "# ReplicaSets\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/replicasets/)\n\nIn this section, we will take a"
  },
  {
    "path": "docs/02-Core-Concepts/15-Practice-Tests-ReplicaSet.md",
    "chars": 4610,
    "preview": "# Practice Test - ReplicaSets\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-replicasets/)\n\n##"
  },
  {
    "path": "docs/02-Core-Concepts/16-Deployments.md",
    "chars": 1685,
    "preview": "# Deployments\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/deployments-3/)\n\nIn this section, we will take"
  },
  {
    "path": "docs/02-Core-Concepts/17-Practice-Tests-Deployments.md",
    "chars": 3236,
    "preview": "# Practice Test - Deployments\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-tests-deployments/)\n\nS"
  },
  {
    "path": "docs/02-Core-Concepts/18-Namespaces.md",
    "chars": 3430,
    "preview": "# Namespaces\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/namespaces/)\n  \nIn this section, we will take a"
  },
  {
    "path": "docs/02-Core-Concepts/19-Practice-Test-Namespaces.md",
    "chars": 1871,
    "preview": "# Practice Test - Namespaces\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-namespaces/)\n\nSolu"
  },
  {
    "path": "docs/02-Core-Concepts/20-Services.md",
    "chars": 2701,
    "preview": "# Kubernetes Services\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/services-3/)\n  \nIn this section we wil"
  },
  {
    "path": "docs/02-Core-Concepts/21-Services-ClusterIP.md",
    "chars": 1227,
    "preview": "# Kubernetes Services - ClusterIP\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/services-cluster-ip-2/)\n  "
  },
  {
    "path": "docs/02-Core-Concepts/22-Practice-Test-Services.md",
    "chars": 2155,
    "preview": "# Practice Test - Services\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-services/)\n\n#### Sol"
  },
  {
    "path": "docs/02-Core-Concepts/23-Imperative-Commands-with-kubectl.md",
    "chars": 184,
    "preview": "# Certification Tips - Imperative Commands with kubectl\n  - Take me to the [Certification tips page](https://kodekloud.c"
  },
  {
    "path": "docs/02-Core-Concepts/24-Practice-Test-Imperative-Commands.md",
    "chars": 2012,
    "preview": "# Practice Test - Imperative Commands\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-imperativ"
  },
  {
    "path": "docs/02-Core-Concepts/25-Attachments.md",
    "chars": 240,
    "preview": "# KodeKloud - CKA Course Documents\n  - Take me to the [Presentation Deck - 1](https://kodekloud.com/topic/attachments/)\n"
  },
  {
    "path": "docs/03-Scheduling/01-Scheduling-Section-Introduction.md",
    "chars": 128,
    "preview": "# Scheduling Section Introduction\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/scheduling-section-introdu"
  },
  {
    "path": "docs/03-Scheduling/02-Manual-Scheduling.md",
    "chars": 1730,
    "preview": "# Manual Scheduling\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/manual-scheduling/)\n  \nIn this section, "
  },
  {
    "path": "docs/03-Scheduling/03-Practice-Test-Manual-Scheduling.md",
    "chars": 1542,
    "preview": "# Practice Test - Manual Scheduling\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-manual-sche"
  },
  {
    "path": "docs/03-Scheduling/04-Labels-and-Selectors.md",
    "chars": 2677,
    "preview": "# Labels and Selectors\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/labels-and-selectors/)\n  \nIn this sec"
  },
  {
    "path": "docs/03-Scheduling/05-Practice-Test-Labels-and-Selectors.md",
    "chars": 1850,
    "preview": "# Practice Test - Labels and Selectors\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-labels-a"
  },
  {
    "path": "docs/03-Scheduling/06-Taints-and-Tolerations.md",
    "chars": 1786,
    "preview": "# Taints and Tolerations\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/taints-and-tolerations-2/)\n  \nIn th"
  },
  {
    "path": "docs/03-Scheduling/07-Practice-Test-Taints-and-Tolerations.md",
    "chars": 2969,
    "preview": "# Practice Test - Taints and Tolerations\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-taints"
  },
  {
    "path": "docs/03-Scheduling/08-Node-Selectors.md",
    "chars": 1416,
    "preview": "# Node Selectors\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/node-selectors/)\n\nIn this section, we will "
  },
  {
    "path": "docs/03-Scheduling/09-Node-Affinity.md",
    "chars": 2415,
    "preview": "# Node Affinity\n  - Take me to the [Video Tutorial](https://kodekloud.com/topic/node-affinity-2/)\n  \nIn this section, we"
  },
  {
    "path": "docs/03-Scheduling/10-Practice-Test-Node-Affinity.md",
    "chars": 3481,
    "preview": "# Practice Test - Node Affinity\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-node-affinity-2"
  },
  {
    "path": "docs/03-Scheduling/11.Taints-and-Tolerations-vs-Node-Affinity.md",
    "chars": 852,
    "preview": "# Taints and Tolerations vs Node Affinity\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/taints-and-tolerat"
  },
  {
    "path": "docs/03-Scheduling/12-Resource-Limits.md",
    "chars": 2202,
    "preview": "# Resource Limits\n  - Take me to [Video Tutorials](https://kodekloud.com/topic/resource-limits/)\n  \nIn this section we w"
  },
  {
    "path": "docs/03-Scheduling/13-Practice-Test-Resource-Limits.md",
    "chars": 1382,
    "preview": "# Practice Test - Resource Limits\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-resource-limi"
  },
  {
    "path": "docs/03-Scheduling/14-DaemonSets.md",
    "chars": 1961,
    "preview": "# DaemonSets\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/daemonsets/)\n\nIn this section, we will take a l"
  },
  {
    "path": "docs/03-Scheduling/15-Practice-Test-DaemonSets.md",
    "chars": 1931,
    "preview": "# Practice Test - DaemonSets\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-daemonsets/)\n  \nSo"
  },
  {
    "path": "docs/03-Scheduling/16-Static-Pods.md",
    "chars": 1453,
    "preview": "# Static Pods \n  - Take me to [Video Tutorial](https://kodekloud.com/topic/static-pods/)\n  \nIn this section, we will tak"
  },
  {
    "path": "docs/03-Scheduling/17-Practice-Test-StaticPods.md",
    "chars": 2543,
    "preview": "# Practice Test - Static Pods\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-static-pods/)\n  \n"
  },
  {
    "path": "docs/03-Scheduling/18-Multiple-Schedulers.md",
    "chars": 1618,
    "preview": "# Multiple Schedulers \n  - Take me to [Video Tutorial](https://kodekloud.com/topic/multiple-schedulers/)\n\nIn this sectio"
  },
  {
    "path": "docs/03-Scheduling/19-Practice-Test-Multiple-Schedulers.md",
    "chars": 1241,
    "preview": "# Practice Test - Multiple Schedulers\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-multiple-"
  },
  {
    "path": "docs/03-Scheduling/20-Configuring-Kubernetes-Schedulers.md",
    "chars": 582,
    "preview": "# Configuring Kubernetes Schedulers\n  - Take me to [video Tutorial](https://kodekloud.com/topic/configuring-kubernetes-s"
  },
  {
    "path": "docs/03-Scheduling/21-Download-Presentation-Deck.md",
    "chars": 125,
    "preview": "# Download Presentation Deck\n  - Take me to [Presentation Deck](https://kodekloud.com/topic/download-presentation-deck-2"
  },
  {
    "path": "docs/04-Logging-and-Monitoring/01-Logging-and-Monitoring-Section-Introduction.md",
    "chars": 310,
    "preview": "# Logging and Monitoring Section Introduction\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/logging-and-mo"
  },
  {
    "path": "docs/04-Logging-and-Monitoring/02-Monitor-Cluster-Components.md",
    "chars": 1119,
    "preview": "# Monitor Cluster Components\n  - Take me to [Video Tutuorials](https://kodekloud.com/topic/monitor-cluster-components/)\n"
  },
  {
    "path": "docs/04-Logging-and-Monitoring/03-Practice-Test-Monitor-Cluster-Components.md",
    "chars": 2195,
    "preview": "# Practice Test - Monitor Cluster Components\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-mo"
  },
  {
    "path": "docs/04-Logging-and-Monitoring/04-Managing-Application-Logs.md",
    "chars": 951,
    "preview": "# Managing Application Logs\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/managing-application-logs/)\n\nIn "
  },
  {
    "path": "docs/04-Logging-and-Monitoring/05-Download-Presentation-Deck.md",
    "chars": 123,
    "preview": "# Download Presentation Deck\n  - Take me to [Presentation Deck](https://kodekloud.com/topic/download-presentation-deck-3"
  },
  {
    "path": "docs/04-Logging-and-Monitoring/06-Practice-Test-Managing-Application-Logs.md",
    "chars": 738,
    "preview": "# Practice Test - Managing Application Logs\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-man"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/01-Application-Lifecycle-Management--Section-Introduction.md",
    "chars": 369,
    "preview": "# Application Lifecycle Management Section Introduction\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/appl"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/02-RollingUpdates-and-Rollback.md",
    "chars": 2467,
    "preview": "# Rolling Updates and Rollback\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/rolling-updates-and-rollbacks"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/03-Practice-Test-RollingUpdates-Rollback.md",
    "chars": 1999,
    "preview": "# Practice Test - Rolling Updates and Rollback\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/04-Commands-and-Arguments-in-Docker.md",
    "chars": 1781,
    "preview": "# Commands and Arguments in Docker\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/commands-and-arguments-in"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/05-Commands-and-Arguments-in-Kubernetes.md",
    "chars": 887,
    "preview": "# Commands and Arguments in Kubernetes\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/commands-and-argument"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/06-Practice-Test-Commands-and-Arguments.md",
    "chars": 1427,
    "preview": "# Practice Test - Commands and Arguments\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-comman"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/07.Configure-Environment-Variables-in-Applications.md",
    "chars": 926,
    "preview": "# Configure Environment Variables In Applications\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/configure-"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/08-Configure-ConfigMaps-in-Applications.md",
    "chars": 2413,
    "preview": "# Configure ConfigMaps in Applications\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/configure-configmaps-"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/09-Practice-Test-Env-Variables.md",
    "chars": 2056,
    "preview": "# Practice Test Env Variables\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-env-variables/)\n "
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/10.Secrets.md",
    "chars": 5512,
    "preview": "# Secrets\n  - Take me to [Video Tutorials](https://kodekloud.com/topic/secrets-2/)\n\nIn this section, we will take a look"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/11.Practice-Test-Secrets.md",
    "chars": 1608,
    "preview": "# Practice Test - Secrets\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-secrets/)\n\nSolutions "
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/12.Multi-Containers-PODs.md",
    "chars": 846,
    "preview": "# Multi-Container Pods\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/multi-container-pods-2/)\n\nIn this sec"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/13-Practice-Test-Multi-Container-Pods.md",
    "chars": 1525,
    "preview": "# Practice Test - Multi-Container Pods\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-multi-co"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/14-Multi-Container-Pods-Design-Patterns.md",
    "chars": 280,
    "preview": "# Multi-Container Pods Design Patterns\n  - Take me to [Design Pattern page](https://kodekloud.com/topic/multi-container-"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/15.Init-Containers.md",
    "chars": 2687,
    "preview": "# Init Containers\n- Take me to [Init-Containers](https://kodekloud.com/topic/init-containers/)\n\nIn a multi-container pod"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/16-Practice-Test-Init-Containers.md",
    "chars": 1980,
    "preview": "# Practice Test - Init-Containers\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-init-containe"
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/17.Self-Healing-Applications.md",
    "chars": 815,
    "preview": "# Self Healing Applications\n  - Take me to [Tutorial](https://kodekloud.com/topic/self-healing-applications-2/)\n\n# Self "
  },
  {
    "path": "docs/05-Application-Lifecycle-Management/18.Download-Presentation-Deck.md",
    "chars": 125,
    "preview": "# Download Presentation Deck\n  - Take me to [Presentation Deck](https://kodekloud.com/topic/download-presentation-deck-4"
  },
  {
    "path": "docs/06-Cluster-Maintenance/01-Cluster-Maintenance-Section-Introduction.md",
    "chars": 300,
    "preview": "# Cluster Maintenance Section Introduction\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/cluster-maintenan"
  },
  {
    "path": "docs/06-Cluster-Maintenance/02-OS-Upgrades.md",
    "chars": 929,
    "preview": "# OS Upgrades\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/os-upgrades/)\n  \nIn this section, we will take"
  },
  {
    "path": "docs/06-Cluster-Maintenance/03-Practice-Test-OS-Upgrades.md",
    "chars": 2324,
    "preview": "# Practice Test - OS Upgrades\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-os-upgrades/)\n  \n"
  },
  {
    "path": "docs/06-Cluster-Maintenance/04-Kubernetes-Software-Versions.md",
    "chars": 1082,
    "preview": "# Kubernetes Software Versions\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/kubernetes-software-versions/"
  },
  {
    "path": "docs/06-Cluster-Maintenance/05-Cluster-Upgrade-Introduction.md",
    "chars": 2906,
    "preview": "# Cluster Upgrade Introduction\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/cluster-upgrade-introduction/"
  },
  {
    "path": "docs/06-Cluster-Maintenance/06-Practice-Test-Cluster-Upgrade-Process.md",
    "chars": 2231,
    "preview": "# Practice Test - Cluster Upgrade Process\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-clust"
  },
  {
    "path": "docs/06-Cluster-Maintenance/07-Backup-and-Restore-Methods.md",
    "chars": 2406,
    "preview": "# Backup and Restore Methods\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/backup-and-restore-methods/)\n  "
  },
  {
    "path": "docs/06-Cluster-Maintenance/08-Working-With-ETCDCTL.md",
    "chars": 100,
    "preview": "# Working with ETCDCTL\n  - Take me [Tutorial](https://kodekloud.com/topic/working-with-etcdctl/)\n  \n"
  },
  {
    "path": "docs/06-Cluster-Maintenance/09-Practice-Test-Backup-and-Restore-Methods.md",
    "chars": 3287,
    "preview": "# Practice Test - Backup and Restore Methods\nTake me to [Practice Test](https://kodekloud.com/topic/practice-test-backup"
  },
  {
    "path": "docs/06-Cluster-Maintenance/10-Practice-Test-Backup-and-Restore-Methods-2.md",
    "chars": 7043,
    "preview": "# Practice Test - Backup and Restore Methods 2\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-"
  },
  {
    "path": "docs/06-Cluster-Maintenance/11-Download-Presentation-Deck.md",
    "chars": 123,
    "preview": "# Download Presentation Deck\n  - Take me to [Presentation Deck](https://kodekloud.com/topic/download-presentation-deck-5"
  },
  {
    "path": "docs/07-Security/01-Security-Section-Introduction.md",
    "chars": 399,
    "preview": "# Security Section Introduction\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/security-section-introductio"
  },
  {
    "path": "docs/07-Security/02-Kubernetes-Security-Primitives.md",
    "chars": 1037,
    "preview": "# Kubernetes Security Primitives\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/kubernetes-security-primiti"
  },
  {
    "path": "docs/07-Security/03-Authentication.md",
    "chars": 1750,
    "preview": "# Authentication\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/authentication/)\n  \nIn this section, we wil"
  },
  {
    "path": "docs/07-Security/04-TLS-Certificates.md",
    "chars": 362,
    "preview": "# TLS Certificates Introduction\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/tls-introduction/)\n  \nIn thi"
  },
  {
    "path": "docs/07-Security/05-TLS-Basics.md",
    "chars": 1850,
    "preview": "# TLS Basics\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/tls-basics/)\n  \nIn this section, we will take a"
  },
  {
    "path": "docs/07-Security/06-TLS-in-Kubernetes.md",
    "chars": 641,
    "preview": "# TLS in Kubernetes\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/tls-in-kubernetes/)\n  \nIn this section, "
  },
  {
    "path": "docs/07-Security/07-TLS-in-Kubernetes-Certificate-Creation.md",
    "chars": 1902,
    "preview": "# TLS in kubernetes - Certificate Creation\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/tls-in-kubernetes"
  },
  {
    "path": "docs/07-Security/08-View-Certificate-Details.md",
    "chars": 1154,
    "preview": "# View Certificate Details\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/view-certificate-details/)\n  \nIn "
  },
  {
    "path": "docs/07-Security/09-Certificate-Health-Check-Spreadsheet.md",
    "chars": 138,
    "preview": "# Certificate Health-Check Spreadsheet\n  - Take me to [Spreadsheet](https://kodekloud.com/topic/certificate-health-check"
  },
  {
    "path": "docs/07-Security/10-Practice-Test-View-Certificate-Details.md",
    "chars": 2713,
    "preview": "# Practice Test - View Certificates\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-view-certif"
  },
  {
    "path": "docs/07-Security/11-Certificate-API.md",
    "chars": 2286,
    "preview": "# Certificate API\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/certificates-api/)\n  \nIn this section, we "
  },
  {
    "path": "docs/07-Security/12-Practice-Test-Certificates-API.md",
    "chars": 1638,
    "preview": "# Practice Test - Certificates API\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-certificates"
  },
  {
    "path": "docs/07-Security/13-kubeconfig.md",
    "chars": 1686,
    "preview": "# KubeConfig \n  - Take me to [Video Tutorial](https://kodekloud.com/topic/kubeconfig/)\n\nIn this section, we will take a "
  },
  {
    "path": "docs/07-Security/14-Practice-Test-KubeConfig.md",
    "chars": 2717,
    "preview": "# Practice Test - KubeConfig\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-kubeconfig/)\n \nSol"
  },
  {
    "path": "docs/07-Security/15-API-Groups.md",
    "chars": 1407,
    "preview": "# API Groups\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/api-groups/)\n  \nIn this section, we will take a"
  },
  {
    "path": "docs/07-Security/16-Authorization.md",
    "chars": 1160,
    "preview": "# Authorization\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/authorization/)\n  \nIn this section, we will "
  },
  {
    "path": "docs/07-Security/17-RBAC.md",
    "chars": 2853,
    "preview": "# RBAC\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/role-based-access-controls/)\n\nIn this section, we wil"
  },
  {
    "path": "docs/07-Security/18-Practice-Test-RBAC.md",
    "chars": 2062,
    "preview": "# Practice Test - RBAC\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-role-based-access-contro"
  },
  {
    "path": "docs/07-Security/19-Cluster-Roles.md",
    "chars": 2046,
    "preview": "# Cluster Roles\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/cluster-roles/)\n  \nIn this section, we will "
  },
  {
    "path": "docs/07-Security/20-Practice-Test-Cluster-Roles.md",
    "chars": 1601,
    "preview": "# Practice Test - Cluster Roles\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-cluster-roles/)"
  },
  {
    "path": "docs/07-Security/21-Service-Account.md",
    "chars": 4519,
    "preview": "# Service Account\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/service-account/)\n  \nIn this section, we w"
  },
  {
    "path": "docs/07-Security/22-Practice-Test-Service-Accounts.md",
    "chars": 5285,
    "preview": "# Practice Test - Practice Test Service Accounts\n  - Take me to [Practice Test](https://uklabs.kodekloud.com/topic/pract"
  },
  {
    "path": "docs/07-Security/23-Image-Security.md",
    "chars": 1428,
    "preview": "# Image Security\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/image-security/)\n\nIn this section we will t"
  },
  {
    "path": "docs/07-Security/24-Practice-Test-Image-Security.md",
    "chars": 1569,
    "preview": "# Practice Test - Image Security\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-image-security"
  },
  {
    "path": "docs/07-Security/25-Security-Context.md",
    "chars": 1652,
    "preview": "# Security Context\n  - Take me to [Video Tutorial](https://kodekloud.com/topic/security-contexts-2/)\n  \nIn this section,"
  },
  {
    "path": "docs/07-Security/26-Practice-Test-Security-Context.md",
    "chars": 1754,
    "preview": "# Practice Test - Security Context\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-security-con"
  },
  {
    "path": "docs/07-Security/27-Network-Policies.md",
    "chars": 1578,
    "preview": "# Network Policies\n  - Take me to [Video Tutorials](https://kodekloud.com/topic/network-policies-3/)\n  \n#### Trafic flow"
  },
  {
    "path": "docs/07-Security/28-Practice-Test-Network-Policies.md",
    "chars": 1588,
    "preview": "# Practice Test - Network Policies\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-network-poli"
  },
  {
    "path": "docs/07-Security/29-kubectx-and-kubens-commands.md",
    "chars": 139,
    "preview": "# kubectx and kubens commands (Optional)\n  - Take me to [Tutorial](https://kodekloud.com/topic/kubectx-and-kubens-comman"
  },
  {
    "path": "docs/07-Security/30-Download-Presentation-Deck.md",
    "chars": 123,
    "preview": "# Download Presentation Deck\n  - Take me to [Presentation Deck](https://kodekloud.com/topic/download-presentation-deck-6"
  },
  {
    "path": "docs/08-Storage/01-Storage-Section-Introduction.md",
    "chars": 275,
    "preview": "# Storage Section Introduction\n\n  - Take me to [Introduction](https://kodekloud.com/topic/storage-section-introduction/)"
  },
  {
    "path": "docs/08-Storage/02-Introduction-to-Docker-Storage.md",
    "chars": 1039,
    "preview": "# Introduction to Docker Storage\n\n  - Take me to [Lecture](https://kodekloud.com/topic/introduction-to-docker-storage-3/"
  },
  {
    "path": "docs/08-Storage/03-Storage-in-Docker.md",
    "chars": 7902,
    "preview": "# Storage in Docker\n\n  - Take me to [Lecture](https://kodekloud.com/topic/storage-in-docker-2/)\n\nIn this section, we wil"
  },
  {
    "path": "docs/08-Storage/04-Volume-Driver-Plugins-in-Docker.md",
    "chars": 1460,
    "preview": "# Volume Driver Plugins in Docker\n\n  - Take me to [Lecture](https://kodekloud.com/topic/volume-driver-plugins-in-docker-"
  },
  {
    "path": "docs/08-Storage/05-Container.Storage-Interface.md",
    "chars": 1992,
    "preview": "# Container Storage Interface\n\n  - Take me to [Lecture](https://kodekloud.com/topic/container-storage-interface/)\n\nIn th"
  },
  {
    "path": "docs/08-Storage/06-Volumes.md",
    "chars": 2288,
    "preview": "# Volumes\n\n  - Take me to [Lecture](https://kodekloud.com/topic/volumes/)\n\nIn this section, we will take a look at **Vol"
  },
  {
    "path": "docs/08-Storage/07-Persistent-Volumes.md",
    "chars": 1584,
    "preview": "# Persistent Volumes\n\n  - Take me to [Lecture](https://kodekloud.com/topic/persistent-volumes-4/)\n\nIn this section, we w"
  },
  {
    "path": "docs/08-Storage/08-Persistent-Volume-Claims.md",
    "chars": 2385,
    "preview": "# Persistent Volume Claims\n\n  - Take me to [Lecture](https://kodekloud.com/topic/persistent-volume-claims-4/)\n\nIn this s"
  },
  {
    "path": "docs/08-Storage/09-Using-PVC-in-PODs.md",
    "chars": 1710,
    "preview": "# Using PVC in PODs\n\n  - Take me the [Lecture](https://kodekloud.com/topic/using-pvc-in-pods/)\n\nIn this section, we will"
  },
  {
    "path": "docs/08-Storage/10-Practice-Test-Persistent-Volume-Claims.md",
    "chars": 3715,
    "preview": "# Practice Test - Persistent Volume Claims\n\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-per"
  },
  {
    "path": "docs/08-Storage/11-Download-Presentation-Deck.md",
    "chars": 113,
    "preview": "# Download Presentation Deck\n\n  - [Presentation Deck](https://kodekloud.com/topic/download-presentation-deck-7/)\n"
  },
  {
    "path": "docs/08-Storage/12-Storage-Class.md",
    "chars": 2465,
    "preview": "# Storage Class\n\n  - Take me to [Lecture](https://kodekloud.com/topic/storage-class/)\n\nIn this section, we will take a l"
  },
  {
    "path": "docs/08-Storage/13-Practice-Test-Storage-Class.md",
    "chars": 2423,
    "preview": "# Practice Test - Storage Class\n  \n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-storage-clas"
  },
  {
    "path": "docs/09-Networking/01-Networking-Introduction.md",
    "chars": 481,
    "preview": "# Section Introduction\n\n  - Take me to [Introduction](https://kodekloud.com/topic/networking-introduction/)\n\nIn this sec"
  },
  {
    "path": "docs/09-Networking/02-Pre-requisite-Switching-Routing-Gateways.md",
    "chars": 1128,
    "preview": "# Pre-requisite Switching Routing Gateways\n\n  - Take me to [Lecture](https://kodekloud.com/topic/pre-requisite-switching"
  },
  {
    "path": "docs/09-Networking/03-Pre-requisite-DNS.md",
    "chars": 2720,
    "preview": "# Pre-requisite DNS\n\n  - Take me to [Lecture](https://kodekloud.com/topic/prerequsite-dns/)\n\nIn this section, we will ta"
  },
  {
    "path": "docs/09-Networking/04-Pre-requisite-CoreDNS.md",
    "chars": 1201,
    "preview": "# Pre-requisite CoreDNS\n\n  - Take me to [Lecture](https://kodekloud.com/topic/prerequisite-coredns/)\n\nIn this section, w"
  },
  {
    "path": "docs/09-Networking/05-Pre-requisite-Network-Namespace.md",
    "chars": 5768,
    "preview": "# Pre-requisite Network Namespaces\n\n  - Take me to [Lecture](https://kodekloud.com/topic/prerequsite-network-namespaces/"
  },
  {
    "path": "docs/09-Networking/06-Pre-requisite-Docker-Networking.md",
    "chars": 4641,
    "preview": "# Pre-requisite Docker Networking\n\n  - Take me to [Lecture](https://kodekloud.com/topic/prerequsite-docker-networking/)\n"
  },
  {
    "path": "docs/09-Networking/07-Pre-requisite-CNI.md",
    "chars": 914,
    "preview": "# Pre-requisite CNI\n\n  - Take me to [Lecture](https://kodekloud.com/topic/prerequsite-cni/)\n\nIn this section, we will ta"
  },
  {
    "path": "docs/09-Networking/08-Cluster-Networking.md",
    "chars": 776,
    "preview": "# Pre-requisite Cluster Networking\n\n  - Take me to [Lecture](https://kodekloud.com/topic/cluster-networking/)\n\nIn this s"
  },
  {
    "path": "docs/09-Networking/09-Practice-Test-Explore-Env.md",
    "chars": 6170,
    "preview": "# Practice Test - Explore Env\n\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-explore-environm"
  },
  {
    "path": "docs/09-Networking/10-Pod-Networking.md",
    "chars": 1474,
    "preview": "# Pod Networking\n\n  - Take me to [Lecture](https://kodekloud.com/topic/pod-networking/)\n\nIn this section, we will take a"
  },
  {
    "path": "docs/09-Networking/11-CNI-in-Kubernetes.md",
    "chars": 911,
    "preview": "# CNI in Kubernetes\n\n  - Take me to [Lecture](https://kodekloud.com/topic/cni-in-kubernetes/)\n\nIn this section, we will "
  },
  {
    "path": "docs/09-Networking/12-CNI-weave.md",
    "chars": 2231,
    "preview": "# CNI weave\n  \n  - Take me to [Lecture](https://kodekloud.com/topic/cni-weave/)\n\nIn this section, we will take a look at"
  },
  {
    "path": "docs/09-Networking/13-Practice-Test-CNI-weave.md",
    "chars": 2219,
    "preview": "# Practice Test - CNI weave\n\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-cni-weave/)\n\n#### "
  },
  {
    "path": "docs/09-Networking/14-Practice-Test-Deploy-Network-Solution.md",
    "chars": 908,
    "preview": "# Practice Test - Deploy Networking Solution\n\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-d"
  },
  {
    "path": "docs/09-Networking/15-ipam-weave.md",
    "chars": 424,
    "preview": "# IPAM weave\n\n  - Take me to [Lecture](https://kodekloud.com/topic/ipam-weave/)\n\n- IP Address Management in the Kubernet"
  },
  {
    "path": "docs/09-Networking/16-Practice-Test-Networking-weave.md",
    "chars": 2396,
    "preview": "# Practice Test Networking Weave\n\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-networking-we"
  },
  {
    "path": "docs/09-Networking/17-Service-Networking.md",
    "chars": 2445,
    "preview": "# Service Networking\n\n  - Take me to [Lecture](https://kodekloud.com/topic/service-networking/)\n\nIn this section, we wil"
  },
  {
    "path": "docs/09-Networking/18-Practice-Test-Service-Networking.md",
    "chars": 1968,
    "preview": "# Practice Test Service Networking\n\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-service-net"
  },
  {
    "path": "docs/09-Networking/19-DNS-in-kubernetes.md",
    "chars": 2723,
    "preview": "# DNS in Kubernetes\n\n  - Take me to [Lecture](https://kodekloud.com/topic/dns-in-kubernetes/)\n\nIn this section, we will "
  },
  {
    "path": "docs/09-Networking/20-CoreDNS-in-Kubernetes.md",
    "chars": 3716,
    "preview": "# CoreDNS in Kubernetes\n\n  - Take me to [Lecture](https://kodekloud.com/topic/coredns-in-kubernetes/)\n\nIn this section, "
  },
  {
    "path": "docs/09-Networking/21-Practice-Test-CoreDNS-in-Kubernetes.md",
    "chars": 2043,
    "preview": "# Practice Test CoreDNS in Kubernetes\n\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-coredns-"
  },
  {
    "path": "docs/09-Networking/22-Ingress.md",
    "chars": 4145,
    "preview": "# Ingress\n\n  - Take me to [Lecture](https://kodekloud.com/topic/ingress/)\n\nIn this section, we will take a look at **Ing"
  },
  {
    "path": "docs/09-Networking/23-Ingress-Annotations-and-rewrite-target.md",
    "chars": 1080,
    "preview": "# Ingress Annotations and rewrite-target\n\n  - Take me to [Lecture](https://kodekloud.com/topic/ingress-annotations-and-r"
  },
  {
    "path": "docs/09-Networking/24-Practice-Test-CKA-Ingress-Net-1.md",
    "chars": 5299,
    "preview": "# Practice Test CKA Ingress 1\n\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-cka-ingress-netw"
  },
  {
    "path": "docs/09-Networking/25-Practice-Test-CKA-Ingress-Net-2.md",
    "chars": 7511,
    "preview": "# Practice Test CKA Ingress 2\n\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-cka-ingress-netw"
  },
  {
    "path": "docs/09-Networking/26-Dowload-Presentation-Deck.md",
    "chars": 123,
    "preview": "# Download Presentation Deck\n\n  - [Download - Presentation Deck](https://kodekloud.com/topic/download-presentation-deck-"
  },
  {
    "path": "docs/10-Design-and-Install-Kubernetes-Cluster/01-Designing-a-Kubernetes-Cluster.md",
    "chars": 120,
    "preview": "# Designing a Kubernetes Cluster\n\n  - Take me to [Lecture](https://kodekloud.com/topic/design-a-kubernetes-cluster/)\n\n  "
  },
  {
    "path": "docs/10-Design-and-Install-Kubernetes-Cluster/02-Choosing-Kubernetes-Infrastructure.md",
    "chars": 131,
    "preview": "# Choosing a Kubernetes Infrastructure\n\n  - Take me to [Lecture](https://kodekloud.com/topic/choosing-kubernetes-infrast"
  },
  {
    "path": "docs/10-Design-and-Install-Kubernetes-Cluster/03-Configure-High-Availability.md",
    "chars": 99,
    "preview": "# Choosing a HA\n\n  - Take me to [Lecture](https://kodekloud.com/topic/configure-high-availability/)"
  },
  {
    "path": "docs/10-Design-and-Install-Kubernetes-Cluster/04-ETCD-in-HA.md",
    "chars": 78,
    "preview": "# ETCD in HA\n\n - Take me to [Lecture](https://kodekloud.com/topic/etcd-in-ha/)"
  },
  {
    "path": "docs/10-Design-and-Install-Kubernetes-Cluster/05-Important-update-kubernetes-the-hard-way.md",
    "chars": 152,
    "preview": "# Important update for Kubernetes the Hard Way\n  \n  - Take me to [Update page](https://kodekloud.com/topic/important-upd"
  },
  {
    "path": "docs/10-Design-and-Install-Kubernetes-Cluster/06-Download-Presentation-Deck.md",
    "chars": 102,
    "preview": "# Download Presentation Deck\n\n - [Download](https://kodekloud.com/topic/download-presentation-deck-9/)"
  },
  {
    "path": "docs/11-Install-Kubernetes-the-kubeadm-way/01-Introduction-to-Deployment-with-kubeadm.md",
    "chars": 488,
    "preview": "# Introduction - Kubeadm\n\nNote that this section is for your own practice only. To our knowledge there has never been an"
  },
  {
    "path": "docs/11-Install-Kubernetes-the-kubeadm-way/02-Resources.md",
    "chars": 222,
    "preview": "# Resources\n\n  - Take me to [Resources](https://kodekloud.com/topic/resources-2/)\n\nIf you have an Apple M1 or M2 (Apple "
  },
  {
    "path": "docs/11-Install-Kubernetes-the-kubeadm-way/03-Provision-VMs-with-Vagrant.md",
    "chars": 346,
    "preview": "# Provision VMs with Vagrant tool\n\n  - Take me to [Lecture](https://kodekloud.com/topic/deploy-with-kubeadm-provision-vm"
  },
  {
    "path": "docs/11-Install-Kubernetes-the-kubeadm-way/04-Demo-Deployment-with-Kubeadm.md",
    "chars": 6694,
    "preview": "# Demo - Deployment with Kubeadm tool\n\n- Take me to [Lecture](https://kodekloud.com/topic/demo-deployment-with-kubeadm/)"
  },
  {
    "path": "docs/11-Install-Kubernetes-the-kubeadm-way/05-Practice-Test-Deploy-Kubernetes-Cluster-using-Kubeadm.md",
    "chars": 5281,
    "preview": "# Practice Test - Install kubernetes cluster using kubeadm tool\n\nIf you want to build your own cluster, check these out:"
  },
  {
    "path": "docs/12-Troubleshooting/01-Troubelshooting-Section-Introduction.md",
    "chars": 176,
    "preview": "# Troubelshooting Section Introduction\n\n  - Lets understand how we can troubleshoot an [Application Failure](https://kod"
  },
  {
    "path": "docs/12-Troubleshooting/02-Application-Failure.md",
    "chars": 935,
    "preview": "# Application Failure\n  \n  - Take me to [Lecture](https://kodekloud.com/topic/application-failure/)\n\n  - In this lecture"
  },
  {
    "path": "docs/12-Troubleshooting/03-Solution-Application-Failure.md",
    "chars": 11922,
    "preview": "# Practice Test - Application Failure\n\n  - Take me to [Practice Test](https://kodekloud.com/topic/practice-test-applicat"
  },
  {
    "path": "docs/12-Troubleshooting/04-Control-Plane-Failure.md",
    "chars": 1630,
    "preview": "# Control Plane Failure\n\n  - Take me to [Lecture](https://kodekloud.com/topic/control-plane-failure/)\n  \n  - In this lec"
  },
  {
    "path": "docs/12-Troubleshooting/05-Practice-Test-Control-Plane-Failure.md",
    "chars": 152,
    "preview": "# Practice Test - Control Plane Failure\n\n  - Lets Debug the Failure of [Control Plane](https://kodekloud.com/topic/pract"
  },
  {
    "path": "docs/12-Troubleshooting/06-Solution-Control-Plane-Failure.md",
    "chars": 977,
    "preview": "# Solution Control Plane Failure\n\n  - Lets have a look at the [Practice Test](https://kodekloud.com/topic/practice-test-"
  },
  {
    "path": "docs/12-Troubleshooting/07-Worker-Node-Failure.md",
    "chars": 1025,
    "preview": "# Worker Node Failure\n\n  - Take me to the [Lecture](https://kodekloud.com/topic/worker-node-failure/)\n\n  - Lets check th"
  },
  {
    "path": "docs/12-Troubleshooting/08-Practice-Test-Worker-Node-Failure.md",
    "chars": 148,
    "preview": "# Practice Test - Worker Node Failure\n\n  - Lets Debug the Failure of [Worker Node](https://kodekloud.com/topic/practice-"
  },
  {
    "path": "docs/12-Troubleshooting/09-Solution-Worker-Node-Failure.md",
    "chars": 8269,
    "preview": "# Solution Worker Node Failure\n\n  - Lets have a look at the [Practice Test](https://kodekloud.com/topic/practice-test-wo"
  },
  {
    "path": "docs/12-Troubleshooting/10-Practice-Test-Troubleshoot-Network.md",
    "chars": 3544,
    "preview": "# Solution Troubleshoot Network\n\nLets have a look at the [Practice Test](https://kodekloud.com/topic/practice-test-troub"
  },
  {
    "path": "docs/13-Other-Topics/01-Labs-JSON-PATH.md",
    "chars": 117,
    "preview": "# Labs JSON PATH\n\n  - I want to learn JSON, Take me to [JSON PATH](https://kodekloud.com/topic/labs-json-path-3/)\n\n  "
  },
  {
    "path": "docs/13-Other-Topics/02-Pre-Requisites-JSON-PATH.md",
    "chars": 155,
    "preview": "# Pre-requisite for JSON PATH\n\n  - I want to know more about JSON PATH and its [Pre-requisite](https://kodekloud.com/top"
  },
  {
    "path": "docs/13-Other-Topics/03-Advance-Kubectl-Commands.md",
    "chars": 1475,
    "preview": "# Advance Kubectl Commands\n\n  - Take me to the [Lecture](https://kodekloud.com/topic/advanced-kubectl-commands/)\n\n  - To"
  },
  {
    "path": "docs/13-Other-Topics/04-Practice-Test-Advance-Kubectl-Commands.md",
    "chars": 1750,
    "preview": "# Practice Test for Advance Kubectl Commands\n\n  - Take me to [Advance Practice Test for Kubectl Commands](https://kodekl"
  },
  {
    "path": "docs/14-Lightning-Labs/01-Lightning-Labs-Introduction.md",
    "chars": 1171,
    "preview": "# Lightning Labs Introduction\n\n  #### Welcome to the KodeKloud CKA Lightning Labs!\n   \n  - This section has been created"
  },
  {
    "path": "docs/14-Lightning-Labs/02-Lightning-Lab-1.md",
    "chars": 9524,
    "preview": "# Lightning Lab 1\n\n  - I am ready! [Take me to Lightning Lab 1](https://kodekloud.com/topic/lightning-lab-1-2/)\n\n## Solu"
  },
  {
    "path": "docs/15-Mock-Exams/01-Introduction.md",
    "chars": 130,
    "preview": "# Mock Exams Introduction \n\n  - Take me to [Introduction of Mock Exams](https://kodekloud.com/topic/mock-exam-introducti"
  },
  {
    "path": "docs/15-Mock-Exams/02-Mock-Exam-1.md",
    "chars": 4450,
    "preview": "# Mock Exam 1\n\n  Test My Knowledge, Take me to [Mock Exam 1](https://kodekloud.com/topic/mock-exam-1-3/)\n\n  #### Solutio"
  },
  {
    "path": "docs/15-Mock-Exams/03-Mock-Exam-2.md",
    "chars": 102,
    "preview": "# Mock Exam 2\n\n  Level Up! \n  Take me to [Mock Exam 2](https://kodekloud.com/topic/mock-exam-2-3/)\n\n  "
  },
  {
    "path": "docs/15-Mock-Exams/04-CKA-MockExam-2-Solution.md",
    "chars": 6816,
    "preview": "# Mock Exam 2 Solution\n  \n  \n  1. Run the below command for solution:\n\n     <details>\n\n     ```\n     ETCDCTL_API=3 etcdc"
  },
  {
    "path": "docs/15-Mock-Exams/05-Mock-Exam-3.md",
    "chars": 110,
    "preview": "# Mock Exam 3\n\n  Wohooo! Level Up! \n  \n  Take me to [Mock Exam 3](https://kodekloud.com/topic/mock-exam-3-2/)\n"
  },
  {
    "path": "docs/15-Mock-Exams/06-CKA-MockExam-3-Solution.md",
    "chars": 3659,
    "preview": "# Mock Exam 3 Solution\n\n\n1. Run the below command for solution: \n\n     <details>\n\n     ```\n     kubectl create serviceac"
  },
  {
    "path": "docs/16-Ultimate-Mocks/02-Troubleshooting/README.md",
    "chars": 124,
    "preview": "# SECTION: Troubleshooting\n\n\n* [19 Cluster 1, Network Policy, cyan-pod-cka28-trb](./docs/19-C1-netpol-cyan-pod-cka28-trb"
  },
  {
    "path": "docs/16-Ultimate-Mocks/02-Troubleshooting/docs/11-C1-orange-pvc-cka13-trb.md",
    "chars": 1261,
    "preview": "# Bind the orange-pvc-cka13-trb\n\nFor this question, please set the context to cluster1 by running:\n\n```\nkubectl config u"
  },
  {
    "path": "docs/16-Ultimate-Mocks/02-Troubleshooting/docs/19-C1-netpol-cyan-pod-cka28-trb.md",
    "chars": 6909,
    "preview": "# Cluster 1, NetPol, cyan-pod-cka28-trb\n\nFor this question, please set the context to cluster1 by running:\n\n```\nkubectl "
  },
  {
    "path": "docs/16-Ultimate-Mocks/04-Storage/README.md",
    "chars": 84,
    "preview": "# SECTION: Storage\n\n* [10-olive-pvc-cka10-str](./docs/10-CI-olive-pvc-cka10-str.md)\n"
  },
  {
    "path": "docs/16-Ultimate-Mocks/04-Storage/docs/10-CI-olive-pvc-cka10-str.md",
    "chars": 3836,
    "preview": "# Cluster 1, Storage, olive-pvc-cka10-str\n\nFor this question, please set the context to `cluster1` by running:\n\n\n```\nkub"
  },
  {
    "path": "docs/16-Ultimate-Mocks/05-Services-Networking/README.md",
    "chars": 97,
    "preview": "# SECTION: Services/Networking\n\n* [03-C3-External-Webserver](./docs/03-C3-External-Webserver.md)\n"
  },
  {
    "path": "docs/16-Ultimate-Mocks/05-Services-Networking/docs/03-C3-External-Webserver.md",
    "chars": 5909,
    "preview": "# Cluster 3 - External Webserver\n\nNOTE: This question is also present in the Ultimate CKAD Mocks. The service name is `e"
  },
  {
    "path": "docs/16-Ultimate-Mocks/09-general/README.md",
    "chars": 73,
    "preview": "# General tips\n\n[01-cluster state](./docs/01-cluster-state-questions.md)\n"
  },
  {
    "path": "docs/16-Ultimate-Mocks/09-general/docs/01-cluster-state-questions.md",
    "chars": 8585,
    "preview": "# Cluster State Questions\n\nThis comes up in both CKA and CKAD tests and is about questions that ask you to write for ins"
  },
  {
    "path": "docs/16-Ultimate-Mocks/README.md",
    "chars": 478,
    "preview": "# CKA Ultimate Mocks\n\nNOTE: CKA Ultimate Mocks is a separate course from the main CKA course, and as such requires a sep"
  },
  {
    "path": "docs/17-tips-and-tricks/README.md",
    "chars": 299,
    "preview": "# Tips and Tricks\n\nIn this bonus section we will discuss some useful tips that can be used preparation for the exam\n\n- ["
  },
  {
    "path": "docs/17-tips-and-tricks/docs/01-server-for-testing-network-policies.md",
    "chars": 3623,
    "preview": "# Servers for testing network policies\n\nSometimes you may have a question that asks you to block ingress to a pod on all"
  }
]

// ... and 169 more files (download for full content)

About this extraction

This page contains the full source code of the kodekloudhub/certified-kubernetes-administrator-course GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 369 files (1.4 MB), approximately 340.6k tokens, and a symbol index with 2 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!