DevOps Classroomnotes 13/May/2023

Topics

  • AKS
  • EKS
  • Helm/Kustomize
  • ingress
  • hpa

Managed K8s

  • Managed K8s cluster will manage master nodes i.e. we don’t have explicit access to master nodes
  • so cluster administrational activities such as
    • backing up k8s cluster
    • upgrading k8s cluster
    • cloud controller manager configurations to
      • have access to native cloud networks
      • have csi implementations specific to cloud provider
      • have cni implemenations specific to cloud provider
  • Cloud providers charge hourly for cluster and they give sla’s

AKS cluster creation and features

EKS Cluster

  • Elastic kubernetes Services is a managed k8s from aws
  • EKS cluster can be created in many ways
    • aws console
    • aws cli
    • terraform
    • eksctl this will be used
  • Features Refer Here
  • Create a linux instance, install aws cli, create iam credentials
  • install kubectl Refer Here
  • we had followed direct installation Refer Here
  • Install eksctl Refer Here
# for ARM systems, set ARCH to: `arm64`, `armv6` or `armv7`
ARCH=amd64
PLATFORM=$(uname -s)_$ARCH

curl -sLO "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz"

# (Optional) Verify checksum
curl -sL "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check

tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz

sudo mv /tmp/eksctl /usr/local/bin

  • Create a file called as cluster.yaml with the following content
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: basic-cluster
  region: us-west-2

nodeGroups:
  - name: basic
    instanceType: t2.large
    desiredCapacity: 2
    volumeSize: 20
    ssh:
      allow: true # will use ~/.ssh/id_rsa.pub as the default ssh key
  • Execute ssh-keygen ssh-keygen
  • Now execute the command eksctl create cluster -f cluster.yaml
  • After creation execute
kubectl get nodes
kubectl get pods --all-namespaces

Preview

Helm

  • Helm is a package manager for k8s
  • In helm we have repositories where charts are defined
  • An helm chart is analogus to package (apt package)
  • install helm Refer Here
  • Manifests are static in nature, to add reusability and dynamic nature to manifests we have two options

    • helm:
      • this uses templated approach
      • this was present from earlier days of k8s
    • kustomize:
      • this uses override approach
      • this is natively supported in kubectl (recent additions)
  • Refer Here for the basic chart created
    Preview

Kustomize

  • Kustomize is a tool where we can natively manage configurations
  • Refer Here for kustomize
  • Natively manage dynamic configurations to k8s manifests
  • Lets write a k8s manifest
    • to deploy shaikkhajaibrahim/dashboardservice:1.0.0 which runs on 80 port
    • create a service file exposed as LoadBalancer
  • Refer Here for manifests
  • Refer Here for tutorial from vultr to use kustomize
  • Refer Here for the manifest folder structure
  • Now lets add name prefix per environment
  • Refer Here for nameprefix docs.
  • Refer Here for the changes done
    Preview
  • Refer Here for labels per env
  • Refer Here for kustomize examples

Problem – 1

  • Creating a Load Balancer for every service shoots up cloud costs
  • I would like to perform
    • path based routing
    • hostname based routing
  • Solution:
    • Ingress which provides external access to k8s services

Questions

  1. How to check logs of pods
  2. What are events in k8s
  3. why should i use k8s
  4. What are stateful sets?
  5. What is purpose of headless service?
  6. What is CSI ?
  7. What is CNI ?
  8. What is the last problem which you faced in k8s ?
  9. How to use external vault in k8s
  10. How to backup k8s cluster?
  11. How to upgrade the k8s cluster?
  12. what is draining the node vs cordon the node?
  13. Can we implement custom dns in k8s?
  14. What is default dns in k8s?
  15. communication between two services in different namespaces
  16. How to auto scale nodes in aks/eks? cluster node autoscaler
  17. List down atleast 10 most common k8s failures?

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Floating Social Media Icons by Acurax Wordpress Designers

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube