NOTES.txt 3.82 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
1. Get your '{{ .Values.master.adminUser }}' user password by running:
  printf $(kubectl get secret --namespace {{ template "jenkins.namespace" . }} {{ template "jenkins.fullname" . }} -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo

{{- if .Values.master.ingress.hostName }}

2. Visit http://{{ .Values.master.ingress.hostName }}
{{- else }}
2. Get the Jenkins URL to visit by running these commands in the same shell:
{{- if contains "NodePort" .Values.master.serviceType }}
  export NODE_PORT=$(kubectl get --namespace {{ template "jenkins.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "jenkins.fullname" . }})
  export NODE_IP=$(kubectl get nodes --namespace {{ template "jenkins.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}")
  echo http://$NODE_IP:$NODE_PORT/login

{{- else if contains "LoadBalancer" .Values.master.serviceType }}
  NOTE: It may take a few minutes for the LoadBalancer IP to be available.
        You can watch the status of by running 'kubectl get svc --namespace {{ template "jenkins.namespace" . }} -w {{ template "jenkins.fullname" . }}'
  export SERVICE_IP=$(kubectl get svc --namespace {{ template "jenkins.namespace" . }} {{ template "jenkins.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
{{- if .Values.master.httpsKeyStore.enable }}
  echo https://$SERVICE_IP:{{ .Values.master.servicePort }}/login
{{- else }}
  echo http://$SERVICE_IP:{{ .Values.master.servicePort }}/login
{{- end }}

{{- else if contains "ClusterIP"  .Values.master.serviceType }}
  export POD_NAME=$(kubectl get pods --namespace {{ template "jenkins.namespace" . }} -l "app.kubernetes.io/component={{ .Values.master.componentName }}" -l "app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
  echo http://127.0.0.1:{{ .Values.master.servicePort }}
  kubectl --namespace {{ template "jenkins.namespace" . }} port-forward $POD_NAME {{ .Values.master.servicePort }}:{{ .Values.master.servicePort }}

{{- end }}
{{- end }}

3. Login with the password from step 1 and the username: {{ .Values.master.adminUser }}
{{ if .Values.master.JCasC.enabled }}
4. Use Jenkins Configuration as Code by specifying configScripts in your values.yaml file, see documentation: http://{{ .Values.master.ingress.hostName }}/configuration-as-code and examples: https://github.com/jenkinsci/configuration-as-code-plugin/tree/master/demos
{{- end }}

For more information on running Jenkins on Kubernetes, visit:
https://cloud.google.com/solutions/jenkins-on-container-engine
{{- if .Values.master.JCasC.enabled }}
For more information about Jenkins Configuration as Code, visit:
https://jenkins.io/projects/jcasc/
{{- end }}

{{- if .Values.persistence.enabled }}
{{- else }}
#################################################################################
######   WARNING: Persistence is disabled!!! You will lose your data when   #####
######            the Jenkins pod is terminated.                            #####
#################################################################################
{{- end }}

{{- if .Values.master.imageTag }}
#################################################################################
######   WARNING: `master.imageTag` will be obsoleted soon!!!               #####
######            It has been renamed to `master.tag`.                      #####
#################################################################################
{{- end }}

{{- if .Values.agent.imageTag }}
#################################################################################
######   WARNING: `agent.imageTag` will be obsoleted soon!!!                #####
######            It has been renamed to `agent.tag`.                       #####
#################################################################################
{{- end }}