Skip to content

Administering our production environment

Jonathan Stray edited this page Dec 4, 2018 · 26 revisions

Setting up Kubernetes, or deploying

See here

List running pods

kubectl -n production get pods or kubectl -n staging get pods

Reboot a server

To reboot a server, from the Google Cloud project console, navigate to the pod (not deployment) that is having problems, and delete the pod (not the deployment)

To reboot the Wordpress database, gcloud compute ssh [wordpress]; systemctl restart apache2; systemctl restart mysql

Viewing logs

Go to the deployment page on Google Cloud Console and click "container logs"

Or to view at the console, kubectl -n production logs -f [container id]

To view many containers that run in the same pod, e.g. all web servers, kubectl -n production logs -f -lapp=frontend-app

Changing environment variables

Environment variables are set per-pod in individual yaml files, e.g. frontend-deployment.yaml

To view current values, you can do kubectl -n production exec -it frontend-deployment-644866b6d4-fcmh7 env for a particular pod.

Many environment variables are secrets, which can be set through kubectl like this: kubectl edit secret cjw-intercom-secret --namespace production or through Google Cloud console