I’ve a Kubernetes cluster running Django on DEBUG=True
using ConfigMap and some other secrets using K8’s secrets. The problem I’m having is that even if I rollout the server it keeps having debug true values, and when I inspect the container, the env
shows that it’s in False.
Any idea why this is happening, and how to solve it?
EDIT:
Here’s the deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend-app
labels:
app: backend
spec:
replicas: 2
selector:
matchLabels:
app: backend
template:
metadata:
labels:
app: backend
spec:
containers:
- image: <dockerhub_username>/<image>:latest
name: backend
envFrom:
- secretRef:
name: backend-secret
- configMapRef:
name: backend-config
ports:
- containerPort: 8000
name: gunicorn
When I execute kubectl exec -it my-container -- printenv
it shows the desired value but it seems the server is missing it.
2
Answers
Just figured it out. I mistakenly was recreating secrets to rollout the deployment while the problem was in configmap, I was not reconfiguring it. Thanks @pwoltschk for the help
so if you redeployed your ConfigMap and afterwards redeployed your pods it will work, except the pods don’t take the value from the configmap.
First, ensure that you have updated the cm correctly and redeployed the pods
If this does not work then we know that there is something within the pod or how you consume the cm because It don#t take the value from the cm.
For a better answer please paste your pod/deployment definition file here.
From that point, we have two possibilities.