Completek8s Classroomnotes 15/Sep/2023

Kubernetes Workloads

Activity 1: Create a Replica Set for nopCommerce

  • Lets create a replicaset for nopCommerce shaikkhajaibrahim/nopcommerceaug23 and a service with cluster ip and some external accessibility like nodeport
    Preview
  • Refer Here for the changes committed
  • Now apply the changes by using following commands
 kubectl apply -f activity1/
 kubectl config set-context --current --namespace=activity1
 kubectl get svc
 kubectl get rs

Preview
* Now we need to patch a node in k8s cluster. As an admin you are expected to cordon and drain
* Safely brining down a node
* Lets mark the node cordon for k8s cluster to stop scheduling workloads on node

kubectl cordon node-2

Preview
* Now drain by ignoring daemonsets

 kubectl drain --ignore-daemonsets node-2

Preview
* Do your patching
* Uncordon the node

kubectl uncordon node-2

Preview

  • Lets say we have 10 pods in replicaset running and we always need atleast 80% to be running for better customer experience. Now in these situations how to handle maintenenance

Pod Disruption Budget

  • Refer Here for the changes done to configure 80% minimum availability for replicas in the case of disruptions
    Preview

Scenario

  • We need to put restriction on namespace to restrict how many pvc claims, loadbalancers, nodeports
  • We have ResourceQuota Object
  • Refer Here for ResourceQuota
  • Lets apply a resource quota to number of services < 2, nodeports < 2 and pods < 10
  • Refer Here for the changes
  • Apply all the manifests and check for status of quotas
    Preview
    Preview
  • In this the number of pods cannot exceed 10 due to quota
    Preview

Leave a Reply

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

About continuous learner

devops & cloud enthusiastic learner