305-998-7702 | 415-800-2922 info@rx-m.com

Practice Drill

Learn how to put the latest open source technology into practice with hands-on training, delivered by industry experts, aligned to your desired business outcomes

Create a Deployment with five replicas named cicd that creates pods that run the jenkins/jenkins:lts image.

Practice Drill: Answer

Create a Deployment with five replicas named cicd that creates pods that run the jenkins/jenkins:lts image.

$ kubectl create deploy cicd --image jenkins/jenkins:lts

deployment.apps/cicd created

$ kubectl scale deploy cicd --replicas=5

deployment.apps/cicd scaled

$

Or

$ kubectl create deploy cicd --image jenkins/jenkins:lts -o yaml --dry-run > cicddep.yaml

$ nano cicddep.yaml

Change the replicas key’s value to 5

$ kubectl apply -f cicddep.yaml

deployment.apps/cicd configured

$

As an additional exercise, try to change the command in the pods that the cicd deployment creates to output the jenkins logs to a file.