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 5 lab solution: Managing pods

Lesson 5 lab solution: Managing pods

- A lab solution. So how do we do that? Well, kubectl create ns microservice. But I'm not going to press Enter right now, I'm going to add --dry-run is client -o yaml > lab5.yaml. And then I'm going to use kubectl run microdb - -image is mariadb - -env MARIADB_ROOT_PASSWORD is password - n microservice - -dry-run is client, and -o yaml. And all of that we are going to write to the lab5.yaml. But we need a double redirect. Single redirect in Linux command line redirection means, create a file with this name, and if it already exists, overwrite it. Double redirect is for appendant, and I want to add this, the output of this command to the end. Let's check on the contents of this file, where we can see, what? It's a little bit hard to see, but you really do see two different parts in the configuration file. Now I'm going to add some separators. So the --- is a common separator in YAML that identifies the start of your YAML code. And I need that on top of the namespace, and I also need it…

Contents