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
- 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
* 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
* Now drain by ignoring daemonsets
kubectl drain --ignore-daemonsets node-2
* Do your patching
* Uncordon the node
kubectl uncordon node-2
- 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
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
andpods < 10
- Refer Here for the changes
- Apply all the manifests and check for status of quotas
- In this the number of pods cannot exceed 10 due to quota