Multiple environments (Staging, QA, production, etc) with Kubernetes

Multiple Clusters Considerations Take a look at this blog post from Vadim Eisenberg (IBM / Istio): Checklist: pros and cons of using multiple Kubernetes clusters, and how to distribute workloads between them. I’d like to highlight some of the pros/cons: Reasons to have multiple clusters Separation of production/development/test: especially for testing a new version of … Read more

How can I debug “ImagePullBackOff”?

You can use the ‘describe pod‘ syntax For OpenShift use: oc describe pod <pod-id> For vanilla Kubernetes: kubectl describe pod <pod-id> Examine the events of the output. In my case it shows Back-off pulling image unreachableserver/nginx:1.14.22222 In this case the image unreachableserver/nginx:1.14.22222 can not be pulled from the Internet because there is no Docker registry … Read more

Restart pods when configmap updates in Kubernetes?

The current best solution to this problem (referenced deep in https://github.com/kubernetes/kubernetes/issues/22368 linked in the sibling answer) is to use Deployments, and consider your ConfigMaps to be immutable. When you want to change your config, create a new ConfigMap with the changes you want to make, and point your deployment at the new ConfigMap. If the … Read more

How to switch namespace in kubernetes

I like my answers short, to the point and with references to official documentation: Answer: kubectl config set-context –current –namespace=my-namespace From: https://kubernetes.io/docs/reference/kubectl/cheatsheet/ # permanently save the namespace for all subsequent kubectl commands in that context. kubectl config set-context –current –namespace=ggckad-s2

Namespace “stuck” as Terminating, How I removed it

Assuming you’ve already tried to force-delete resources like: Pods stuck at terminating status, and your at your wits’ end trying to recover the namespace… You can force-delete the namespace (perhaps leaving dangling resources): ( NAMESPACE=your-rogue-namespace kubectl proxy & kubectl get namespace $NAMESPACE -o json |jq ‘.spec = {“finalizers”:[]}’ >temp.json curl -k -H “Content-Type: application/json” -X … Read more

Service located in another namespace

I stumbled over the same issue and found a nice solution which does not need any static ip configuration: You can access a service via it’s DNS name (as mentioned by you): servicename.namespace.svc.cluster.local You can use that DNS name to reference it in another namespace via a local service: kind: Service apiVersion: v1 metadata: name: … Read more

Kubernetes pod gets recreated when deleted

You need to delete the deployment, which should in turn delete the pods and the replica sets https://github.com/kubernetes/kubernetes/issues/24137 To list all deployments: kubectl get deployments –all-namespaces Then to delete the deployment: kubectl delete -n NAMESPACE deployment DEPLOYMENT Where NAMESPACE is the namespace it’s in, and DEPLOYMENT is the name of the deployment. If NAMESPACE is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)