How to get temporary password for Jenkins in google cloud

Viewed 620

Below is screenshot of reference but not able to get exact what need to get temporary password from mention path.

These are guidelines given :

Next steps

Prerequisites You'll need the following tools in your environment:

gcloud: if gcloud has not been configured yet, then configure gcloud by following the gcloud Quickstart. kubectl: set kubectl to a specific cluster by following the steps at container get-credentials. sed Accessing your Jenkins instance NOTE: For HTTPS, you must accept a temporary TLS certificate.

Read a temporary password:

$(kubectl -ndefault get pod -oname | sed -n /\\/jenkins-job-jenkins/s.pods\\?/..p) \
cat /var/jenkins_home/secrets/initialAdminPassword

Identify the HTTPS endpoint:

echo https://$(kubectl -ndefault get ingress -l "app.kubernetes.io/name=jenkins-job" -ojsonpath="{.items[0].status.loadBalancer.ingress[0].ip}")/

Navigate to the endpoint.

Configuring your Jenkins instance Follow the on-screen instructions to fully configure your Jenkins instance:

Install plugins Create a first admin user Set your Jenkins URL (you can choose to start with the default URL and change it later) Start using your fresh Jenkins installation! For further information, refer to the Jenkins website or this project GitHub page. enter image description here

1 Answers

I put a step by step instruction as follow:

  • Under Kubernetes engine goto Workloads tab then on the right side click on your jenkins Stateful Set.

  • You will route to the Stateful Set details page.

  • Under Managed pods click on your pod name.

  • On Pod details page you can find KUBECTL on the top right, Click on KUBECTL > Exec > jenkins-master

  • Cloud shell terminal should open and two row of command will be paste into it.

  • The very end of command should be ended with jenkins-master -- ls

Replace ls with cat /var/jenkins_home/secrets/initialAdminPassword then press enter.

  • Outcome will be your Administrator password, you may copy and paste it into "Unlock Jenkins" page!

Good luck!

Related