Category: Kubernetes
-
Kubernetes – Patch number of replicas for HPA
Patch minimum/maximum number of replicas in HPA can be done easily by using kubectl patch command Patch minReplicas For example, minReplicas to 2 Patch maxReplicas For example, maxReplicas to 4 To work with multiple HPA Again, wrap it in basic for loop
-
Kubernetes – Fix Pod status stuck at Terminating or ContainerCreating
The issue of Pod status stuck at Terminating or ContainerCreating can be happened in various root-cause. One of the most reason is the ETCD have invalid or outdate list of lease. This will cause a connection refused (randomly) issue when Kubernetes’s pod try to connect Kubernetes API server. To fix that, you need kubectl and…
-
Kubernetes – Scale Up/Down Deployment
Play with an attribute named replicas to scale up/down your deployment. To scale down To scale up To work with multiple deployment Wrap it in basic for loop. This example will scaled down all deployment in the default namespace.