Kubernetes Tutorial



Reference:
Link:-

Annotations:
https://kubernetes.io/docs/reference/glossary/?all=true#term-annotation


Kubernetes Fundamentals

  1. Chapter 1. Course Introduction
  2. Chapter 2. Basics of Kubernetes
  3. Chapter 3. Kubernetes Architecture
  4. Chapter 4. Installation and Configuration
  5. Chapter 6. API Objects
  6. Chapter 7. Managing State with Deployments
  7. Chapter 8. Services
  8. Chapter 9. Volumes and Data
  9. Chapter 10. Ingress
  10. Chapter 11. Scheduling
  11. Chapter 12. Logging and Troubleshooting
  12. Chapter 13. Custom Resource Definitions
  13. Chapter 14. Kubernetes Federations
  14. Chapter 15. Helm
  15. Chapter 16. Security





What is Kubernetes?

Kubernetes is an open-source system for automating deployment, scaling, and management of containerised applications.

Kubernetes ("k8s" for short), was a project originally started at, and designed by Google, and is heavily influenced by Google's large scale cluster management system

simply, k8s gives you a platform for managing and running your applications at scale across multiple physically (or virtual) machines.

Installing Minikube and Kubectl

To make things easy, we're going to use minikube on our local machine to run a single-node kubernetes cluster. Minikube is a handy tool that starts a virtual machine and bootstraps the cluster for you

Firstly, if you don't have VirtualBox, go download and install it. While minikube works with other virtualisation platforms, Ive found VirtualBox to be the most reliable.

Next, we need to install not only minikube, but also kubectl which will be used to interact with our k8s cluster. To do so, run the script below:


#!/bin/bash ARCH=$(uname | awk '{print tolower($0)}') TARGET_VERSION="v0.15.0" MINIKUBE_URL="https://storage.googleapis.com/minikube/releases/${TARGET_VERSION}/minikube-${ARCH}-amd64" KUBECTL_VER="v1.5.1" KUBECTL_URL="http://storage.googleapis.com/kubernetes-release/release/${KUBECTL_VER}/bin/${ARCH}/amd64/kubectl" echo "installing latest kubectl..." curl -Lo kubectl $KUBECTL_URL && chmod +x kubectl && sudo mv kubectl /usr/local/bin/ echo "installing latest minikube..." curl -Lo minikube $MINIKUBE_URL && chmod +x minikube && sudo mv minikube /usr/local/bin/ ISO_URL="https://storage.googleapis.com/minikube/iso/minikube-v1.0.1.iso" minikube start \ --vm-driver=virtualbox \ --iso-url=$ISO_URL echo "starting minikube dashboard..." minikube dashboard


If everything has worked correctly, the kubernetes dashboard should open in your browser.


















Using kubectl

When minikube starts, it will automatically set the context for kubectl. If you run kubectl get nodes you should see something like this:


kubectl get nodes
NAME       STATUS    AGE
minikube   Ready     2m


kubectl get nodes
NAME       STATUS    AGE
minikube   Ready     2m

Same with if you run kubectl get pods --all-namespaces:
kubectl get pods --all-namespaces
NAMESPACE     NAME                          READY     STATUS    RESTARTS   AGE
kube-system   kube-addon-manager-minikube   1/1       Running   0          3m
kube-system   kube-dns-v20-qkzgg            3/3       Running   0          3m
kube-system   kubernetes-dashboard-1hs02    1/1       Running   0          3m

While the dashboard is useful for visualising pods and deployments, we'll primarily be using kubectl to interact with our cluster.


















Comments

Post a Comment

Popular posts from this blog

GitHub Administration