$ helm repo add jenkinsci https://charts.jenkins.io $ helm repo update
$ helm show values jenkinsci/jenkins > jenkins-values.yaml
jekins-values.yaml
수정... jenkinsUriPrefix: "/jenkins" # 주석 해제 ...
...
serviceType: ClusterIP # NodePort로 수정
nodePort: 32766 # 추가
...
$ helm install jenkins jenkinsci/jenkins --create-namespace --namespace jenkins -f jenkins-values.yaml
jekins-values.yaml
파일 수정 후, 변경된 설정으로 젠킨스 재실행
$ helm upgrade jenkins jenkinsci/jenkins --namespace jenkins -f jenkins-values.yaml
admin
의 비밀번호 얻기$ kubectl exec --namespace jenkins -it svc/jenkins -c jenkins -- /bin/cat /run/secrets/additional/chart-admin-password && echo
$ helm delete -n jenkins jenkins
Jenkins 관리 > Manage Credencials > System > Global credentials (unrestricted) > Add Credencials 클릭
kubectl logs -f jenkins-0 -c init -n jenkins
NAME: jenkins
LAST DEPLOYED: Sun Jul 2 14:44:33 2023
NAMESPACE: jenkins
STATUS: deployed
REVISION: 1
NOTES:
1. Get your 'admin' user password by running:
kubectl exec --namespace jenkins -it svc/jenkins -c jenkins -- /bin/cat /run/secrets/additional/chart-admin-password && echo
2. Get the Jenkins URL to visit by running these commands in the same shell:
export NODE_PORT=$(kubectl get --namespace jenkins -o jsonpath="{.spec.ports[0].nodePort}" services jenkins)
export NODE_IP=$(kubectl get nodes --namespace jenkins -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
3. Login with the password from step 1 and the username: admin
4. Configure security realm and authorization strategy
5. Use Jenkins Configuration as Code by specifying configScripts in your values.yaml file, see documentation: http://$NODE_IP:$NODE_PORT/configuration-as-code and examples: https://github.com/jenkinsci/configuration-as-code-plugin/tree/master/demos
For more information on running Jenkins on Kubernetes, visit:
https://cloud.google.com/solutions/jenkins-on-container-engine
For more information about Jenkins Configuration as Code, visit:
https://jenkins.io/projects/jcasc/