diff --git a/README.md b/README.md index e2d378b..f6ade1e 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ Kubernetes is an open‑source platform that automates the deployment, scaling, - [kubectl](#kubectl) - [Helper pods](#helper-pods) - [network testing](#network-testing) - - [Set Replicas](#set-replicas) - [Resources](#resources) - [Services Accounts](#services-accounts) - [Secrets](#secrets) @@ -29,6 +28,8 @@ Kubernetes is an open‑source platform that automates the deployment, scaling, - [nodes](#nodes) - [taint nodes](#taint-nodes) - [control plane - NoSchedule](#control-plane---noschedule) +- [statefulset](#statefulset) + - [statefulset - Set Replicas](#statefulset---set-replicas) - [Deployment](#deployment) - [Deployment - Set Replicas](#deployment---set-replicas) - [Deployment - Restart](#deployment---restart) @@ -288,16 +289,6 @@ nslookup google.com kubectl delete pod dns-test --namespace tests ``` -### Set Replicas - -**Set deployment replicas to 0:** - -```bash -kubectl patch deployment \ - -n \ - -p '{"spec":{"replicas":0}}' -``` - ### Resources **List all resources:** @@ -444,16 +435,30 @@ MASTER_NODE_NAME="master-node-name" kubectl taint nodes ${MASTER_NODE_NAME} node-role.kubernetes.io/control-plane=:NoSchedule ``` +## statefulset + +### statefulset - Set Replicas + +```bash +kubectl patch statefulset \ + -p '{"spec":{"replicas":0}}' +``` + ## Deployment ### Deployment - Set Replicas ``` bash -DEPLOYMENT_NAME="deployment name" +DEPLOYMENT_NAME="???" # example with 0 to "disable" deployment kubectl scale deployment ${DEPLOYMENT_NAME} --replicas=0 ``` +```bash +kubectl patch deployment \ + -p '{"spec":{"replicas":0}}' +``` + ### Deployment - Restart **example restart coredns:**