Skip to content

hendersonmersedes/Kubernetes

Repository files navigation

Kubernetes

Study notes and lab work in preparation for the CKA exam

Resources

My CKA Study Sheet

Download Your Copy Here

Why Containers?

  • Containers are independent environments with their own networking and mounts just like VMs but they share the same Kernel.
  • Containers allows you to modify components without having to modify the underlying OS.
  • Docker containerizes applications to ship and run them. Docker containers are lightweight and fast.
  • Docker image - a package or template used to create containers.

What is Kubernetes?

  • Kubernetes or K8s, is an open source container orchestrator tool
  • Helps you manage thousands of applications
  • Provides high availability, scalability, and disaster recovery
  • Can be deployed on either physical or virtual machines
  • Places containers into Pods to run on Nodes.

Kubernetes Architecture

  • Control Plane - Manages the cluster and the nodes that are used to host the running applications
    • API Server - This is the entry point to K8s cluster
    • Controller Manager - keeps tracks of whats happening in the cluster
    • Scheduler - decides on which node the new pod should be scheduled.
    • etcd - key value store for backup and recovery
    • cloud-controller-manger - allows you to link a cluster into a cloud provider's API

  • Node: Virtual or physical machine managed by the control plane.Components of the node: kubelet, container runtime, kube-proxy. The name of a Node, must be a valid DNS subdomain name. You can create and modify node objects using kubectl.
    • Master Node & Worker Node
      • Worker Node: Hosts containers, CRI-O, kubelet
      • Master Node: kube-apiserver, etcd, controller, scheduler
    • Container Runtime Interface (CRI) - plugin interface which enables the kubelet to use a wide variety of container runtimes. One is needed on each node in your cluster.
    • kubelet - agent that runs on each node
    • kube-proxy - network proxy that runs on each node in your cluster. The proxy maintains network runs on nodes and allows communication to Pods fron inside and outside of the cluster
    • kubectl - deploys and manages applications on a K8s cluster.



KodeKloud Lab

  • Log into the Google cloud platform and navigate to the Kubernetes Engine.
  • Since this was my first time creating a resource in GCP, I was given a low cost Cluster to use.
  • Once you're on the Kubernetes Engine console, The creator tool walks you through setting up your first cluster. After 5-10 min, you will have successfully created the Kubernetes cluster.
  • Select your cluster and right-click on the 3 dots at the far right-hand side of the screen. Choose "CONNECT"
  • A new window will pop up asking for command-line access or cloud console. Select "Run in Cloud Shell"
  • The command line will pop up with the command already entered to run the cluster. Press "ENTER". After the command runs, run the command "kubectl get nodes" to list the nodes in your cluster.
  • Not pictured: We are going to use "git clone" to clone the GitHub repository that has all of our YAML files and then navigate to the folder where the files are stored.
  • After navigating to the correct directory, we're going to use "kubectl get deployments, svc". This will show us the status of the Pods.
  • Minimize the cloud shell and open up the side bar to check on Services. From here we can also see the status of the Pods.
  • After clicking on the IP addresses for your PODs, a new window opens and you should be taken to your application.

There you have it! Your first successful Kubernetes cluster in Google Cloud.

Releases

No releases published

Packages

No packages published