From the course: Certified Kubernetes Administrator (CKA) Cert Prep

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Managing application initialization

Managing application initialization

- All right, next task is about application initialization. So you need to create a deployment with the name lab153deploy which runs the Nginx image, but waits 30 seconds before starting the actual Pod. I hope you know what's going on here. That should be an init container. So let's do it. And again, let's use the same approach that we used before, which is documentation in YAML file. So I'm looking for init container, scrolling down a little bit and here we can see an example of an init container. I don't want to copy the entire command, just this will be enough. Then kubectl create deploy lab153deploy - -image=nginx --dry-run =client -o yaml > lab153deploy.yaml. Then I'm using vim lab153deploy. And we can see the different properties. Well, we need the container. The container... And at the same level we need the init container. Oops, that was wrong. That will be right here. So I'm pasting the code that I just copied from the documentation and fixing my indentation. Init container…

Contents