From the course: Certified Kubernetes Application Developer (CKAD) Cert Prep

Unlock this course with a free trial

Join today to access over 24,700 courses taught by industry experts.

Lesson 12 lab solution: Using ConfigMaps and secrets

Lesson 12 lab solution: Using ConfigMaps and secrets - Kubernetes Tutorial

From the course: Certified Kubernetes Application Developer (CKAD) Cert Prep

Lesson 12 lab solution: Using ConfigMaps and secrets

- So kubectl create deploy secret lab --image is mariadb and kubectl create secret generic --from literal is ROOT_PASSWORD is supersecret. Oh, I'm forgetting a name so that makes sense. Supersecret is the name. That's better. And then we need to assign it kubectl set env --help pipe less, 'cause this syntax is slightly complex and what we need is, well this in fact. With the --prefix option, which we see here, - -prefix is, well that's something I can remember. So I'm copying this behind a hash and I'm using kubectl set env -- from is secret/supersecret on deploy/secretlab - -prefix is MARIADB_. There we can see that it's updated and kubectl get all - -selector app is secretlab is going to show us that the pod is currently running. And the fact that it is running is sufficient proof. That's all we needed to do for this lab.

Contents