k8s deployment.yaml env vscode snippet - 06-20-20

Most of my personal projects are deployed via kubernetes. I write a lot of deployment.yaml files. In order to keep them clean and checked in to version control I keep sensitive env variables in a config maps. Problem is adding values env values to deployment.yaml files is pretty painful. This makes it a little less.

placed in yaml.json 😀 what a file name!

	"env var from configmap": {
		"prefix": "env",
		"body": [
			"- name: $1",
			"  valueFrom:",
			"    configMapKeyRef:",
			"      key: $1",
			"      name: configmapname"
		"description": "env varable from config map, remember to replace configmapname with your configmap name"