NOTES.txt 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. {{- $prefix := .Values.controller.jenkinsUriPrefix | default "" -}}
  2. {{- $url := "" -}}
  3. 1. Get your '{{ .Values.controller.adminUser }}' user password by running:
  4. kubectl exec --namespace {{ template "jenkins.namespace" . }} -it svc/{{ template "jenkins.fullname" . }} -c jenkins -- /bin/cat /run/secrets/additional/chart-admin-password && echo
  5. {{- if .Values.controller.ingress.hostName -}}
  6. {{- if .Values.controller.ingress.tls -}}
  7. {{- $url = print "https://" .Values.controller.ingress.hostName $prefix -}}
  8. {{- else -}}
  9. {{- $url = print "http://" .Values.controller.ingress.hostName $prefix -}}
  10. {{- end }}
  11. 2. Visit {{ $url }}
  12. {{- else }}
  13. 2. Get the Jenkins URL to visit by running these commands in the same shell:
  14. {{- if contains "NodePort" .Values.controller.serviceType }}
  15. export NODE_PORT=$(kubectl get --namespace {{ template "jenkins.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "jenkins.fullname" . }})
  16. export NODE_IP=$(kubectl get nodes --namespace {{ template "jenkins.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}")
  17. {{- if .Values.controller.httpsKeyStore.enable -}}
  18. {{- $url = print "https://$NODE_IP:$NODE_PORT" $prefix -}}
  19. {{- else -}}
  20. {{- $url = print "http://$NODE_IP:$NODE_PORT" $prefix -}}
  21. {{- end }}
  22. echo {{ $url }}
  23. {{- else if contains "LoadBalancer" .Values.controller.serviceType }}
  24. NOTE: It may take a few minutes for the LoadBalancer IP to be available.
  25. You can watch the status of by running 'kubectl get svc --namespace {{ template "jenkins.namespace" . }} -w {{ template "jenkins.fullname" . }}'
  26. export SERVICE_IP=$(kubectl get svc --namespace {{ template "jenkins.namespace" . }} {{ template "jenkins.fullname" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
  27. {{- if .Values.controller.httpsKeyStore.enable -}}
  28. {{- $url = print "https://$SERVICE_IP:" .Values.controller.servicePort $prefix -}}
  29. {{- else -}}
  30. {{- $url = print "http://$SERVICE_IP:" .Values.controller.servicePort $prefix -}}
  31. {{- end }}
  32. echo {{ $url }}
  33. {{- else if contains "ClusterIP" .Values.controller.serviceType -}}
  34. {{- if .Values.controller.httpsKeyStore.enable -}}
  35. {{- $url = print "https://127.0.0.1:" .Values.controller.servicePort $prefix -}}
  36. {{- else -}}
  37. {{- $url = print "http://127.0.0.1:" .Values.controller.servicePort $prefix -}}
  38. {{- end }}
  39. echo {{ $url }}
  40. kubectl --namespace {{ template "jenkins.namespace" . }} port-forward svc/{{template "jenkins.fullname" . }} {{ .Values.controller.servicePort }}:{{ .Values.controller.servicePort }}
  41. {{- end }}
  42. {{- end }}
  43. 3. Login with the password from step 1 and the username: {{ .Values.controller.adminUser }}
  44. 4. Configure security realm and authorization strategy
  45. 5. Use Jenkins Configuration as Code by specifying configScripts in your values.yaml file, see documentation: {{ $url }}/configuration-as-code and examples: https://github.com/jenkinsci/configuration-as-code-plugin/tree/master/demos
  46. For more information on running Jenkins on Kubernetes, visit:
  47. https://cloud.google.com/solutions/jenkins-on-container-engine
  48. For more information about Jenkins Configuration as Code, visit:
  49. https://jenkins.io/projects/jcasc/
  50. {{ if (eq .Values.controller.image "jenkins/jenkins") }}
  51. NOTE: Consider using a custom image with pre-installed plugins
  52. {{- else if .Values.controller.installPlugins }}
  53. NOTE: Consider disabling `installPlugins` if your image already contains plugins.
  54. {{- end }}
  55. {{- if .Values.persistence.enabled }}
  56. {{- else }}
  57. #################################################################################
  58. ###### WARNING: Persistence is disabled!!! You will lose your data when #####
  59. ###### the Jenkins pod is terminated. #####
  60. #################################################################################
  61. {{- end }}