til Migrate Kubernetes PVC to another PVC Recently I have been testing different storage backends (like Rancher Longhorn, Rook, NFS, etc.) for Kubernetes. Since I'm switching pretty frequently, I needed a simple way to migrate or copy data from one pvc to another. 1. Make sure both PVCs are
til Delete a kubernetes pod stuck in 'Terminating' state Occasionally you may run into a pod that is hung in Terminating state. Sometimes this pod may be on an unresponsive node or just doesn't exist anymore, but the kube api server doesn't know yet. To forcefully terminate the pod,
til Delete all pods in a Kubernetes Namespace Quickly delete all pods (or other resources) in a Kubernetes namespace.
til Copy a Kubernetes secret to a different namespace Kubernetes secrets [https://kubernetes.io/docs/concepts/configuration/secret/] are only accessible in the namespace they're created in. A quick one-liner to copy a secret from namespaceA to namespaceB is: kubectl get secrets <secret_name> --export --namespace=<namespaceA>
til Copy files/directories from one Kubernetes pod to another Kubernetes pod Recently I have been experimenting with different ways to handle storage in Kubernetes; this usually requires me to rsync data from one storage backend to another. My goto solution was to mount both storage backend PVs in the same pod and use rsync, but
til Enable caching using nginx-ingress proxy_cache_path [https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_path] needs to be configured globally for the nginx-ingress-controller, which means creating or updating the nginx-configuration config map [https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#http-snippet] : ---
til Increasing the max post/upload/body size in nginx-ingress There's a proxy-body-size [https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/nginx-configuration/annotations.md#custom-max-body-size] option that can be configured via an annotation on ingress objects. This option maps to client_max_body_size [http://nginx.org/en/docs/http/ngx_