Setting up Jenkins master

Install Jenkins

helm install cicd jenkinsci/jenkins --set rbac.create=true,master.servicePort=80,master.serviceType=LoadBalancer,master.JCasC.enabled=false,master.enableXmlConfig=true

The output of this command will give you some additional information such as the admin password and the way to get the host name of the ELB that was provisioned.

Let’s give this some time to provision and while we do let’s watch for Jenkins master pod to boot.

kubectl get pods -w

You should see a pod that starts with the name cicd-jenkins- in init, pending or running state.

Once the pod status changes to running, we can get the load balancer address which will allow us to login to the Jenkins dashboard.

export SERVICE_IP=$(kubectl get svc --namespace default cicd-jenkins --template "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}")
echo "Jenkins running at : http://$SERVICE_IP/login"

The expected result should be similar to:

This service was configured with a LoadBalancer, so an AWS Elastic Load Balancer (ELB) is launched by Kubernetes for the service.

It can take up to several minutes for the ELB to be created and DNS updated. During this time the link above may display a “site unreachable” message. To check if the instances are in service, follow this deep link to the load balancer console. On the load balancer select the instances tab and ensure that the instance status is listed as “InService” before proceeding to the next page in the workshop.

Open a new tab and browse to the address of the ELB that you got in the last step.

Jenkins Login

From here we can log in using:

Username Password
admin command from below
printf $(kubectl get secret --namespace default cicd-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo

The output of this command will give you the default password for your admin user. Log into the Jenkins login screen using these credentials. Make note of this password, because you will need to use it several times throughout the workshop.

Now that our Jenkins master is working, move to the next step in the workshop to set up Jenkins agents.