Helm/Jenkins: Difference between revisions
Jump to navigation
Jump to search
(Created page with "==References== {| | valign="top" | * [https://stackoverflow.com/questions/75596795/ Helm » Pass YAML/JSON using <code>stdin</code>] * [https://helm.sh/docs/helm/helm_repo_remove/ Helm » Repo » Remove] * [https://helm.sh/docs/chart_template_guide/values_files/ Helm » Values Files] * [https://helm.sh/docs/helm/helm_upgrade/ Helm » Upgrade] * [https://helm.sh/docs/helm/helm_rollback/ Helm » Rollback] * [https://helm.sh/docs/helm/helm_history/ Helm » History] * [https...") |
No edit summary |
||
(38 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
helm repo add jenkins https://charts.jenkins.io | |||
helm repo update && helm repo list | |||
kubectl config get-contexts | |||
==Config== | |||
<syntaxhighlight lang="properties"> | |||
export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml" | |||
export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml" | |||
export KUBECONFIG="${HOME}/.kube/config" | |||
</syntaxhighlight> | |||
==Install== | |||
<syntaxhighlight lang="yaml"> | |||
kubectl create namespace jenkins | |||
helm show values jenkins/jenkins|less | |||
cat <<YML | helm install -n jenkins jenkins jenkins/jenkins --version 5.1.26 -f - | |||
controller: | |||
installPlugins: false | |||
additionalPlugins: | |||
- octopusdeploy:3.1.6 | |||
ingress: | |||
enabled: true | |||
hostName: jenkins.k8s.local | |||
resourceRootUrl: jenkins.k8s.local | |||
tls: | |||
- secretName: jenkins.k8s.local.tls | |||
hosts: | |||
- jenkins.k8s.local | |||
JCasC: | |||
securityRealm: |- | |||
local: | |||
allowsSignup: false | |||
enableCaptcha: false | |||
users: | |||
- id: admin | |||
name: Admin | |||
password: sadaqah! | |||
- id: academia | |||
name: Academia | |||
password: sadaqah! | |||
authorizationStrategy: |- | |||
loggedInUsersCanDoAnything: | |||
allowAnonymousRead: false | |||
configScripts: | |||
this-is-where-i-configure-the-executors: | | |||
jenkins: | |||
numExecutors: 5 | |||
YML | |||
</syntaxhighlight> | |||
==Uninstall== | |||
<syntaxhighlight lang="bash"> | |||
helm uninstall -n jenkins jenkins | |||
kubectl delete namespace jenkins | |||
</syntaxhighlight> | |||
==Playground== | |||
{| | |||
| valign="top" | | |||
<syntaxhighlight lang="bash"> | |||
helm upgrade --install -f values.yaml jenkins jenkins/jenkins | |||
helm upgrade --install jenkins jenkins/jenkins | |||
helm show values jenkins/jenkins|less | |||
</syntaxhighlight> | |||
| valign="top" | | |||
<syntaxhighlight lang="bash"> | |||
kubectl exec -n jenkins -it svc/jenkins -c jenkins -- ls -lah /var|grep jenkins | |||
kubectl exec -n jenkins -it svc/jenkins -c jenkins -- ls -lah /var | |||
kubectl exec -n jenkins -it svc/jenkins -c jenkins -- bash | |||
</syntaxhighlight> | |||
|- | |||
| colspan="2" | | |||
---- | |||
|- | |||
| valign="top" | | |||
<syntaxhighlight lang="bash"> | |||
kubectl delete all --all -n jenkins | |||
kubectl delete ing --all -n jenkins | |||
kubectl delete sts --all -n jenkins | |||
</syntaxhighlight> | |||
| valign="top" | | |||
<syntaxhighlight lang="bash"> | |||
kubectl delete svc --all -n jenkins | |||
kubectl delete pvc --all -n jenkins | |||
kubectl delete pv --all -n jenkins | |||
</syntaxhighlight> | |||
|- | |||
| colspan="2" | | |||
---- | |||
|- | |||
| valign="top" | | |||
<syntaxhighlight lang="bash"> | |||
kubectl rollout restart deploy jenkins -n jenkins | |||
kubectl rollout restart sts jenkins -n jenkins | |||
kubectl logs -f jenkins-0 -c init -n jenkins | |||
kubectl logs -f jenkins-0 -n jenkins | |||
</syntaxhighlight> | |||
| valign="top" | | |||
<syntaxhighlight lang="bash"> | |||
kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten | |||
kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten | |||
kubectl config --kubeconfig=${HOME}/.kube/gcp-kubeconfig.yaml view --flatten | |||
kubectl config --kubeconfig=${HOME}/.kube/config view --flatten | |||
</syntaxhighlight> | |||
|} | |||
==References== | ==References== | ||
{| | {| | ||
| valign="top" | | | valign="top" | | ||
* [https://stackoverflow.com/questions/75596795/ Helm » Pass YAML/JSON using <code>stdin</code>] | * [https://stackoverflow.com/questions/75596795/ Helm » Pass YAML/JSON using <code>stdin</code>] | ||
* [https:// | * [https://www.jenkins.io/doc/book/installing/offline/ Helm » Jenkins » Install Offline] | ||
* [ | * [[Helm/Prometheus Stack|Helm » Prometheus Stack]] | ||
* [https://octopus.com/blog/jenkins-helm-install-guide Helm » Jenkins » Install] | |||
* [[Helm/Cert Manager|Helm » Cert Manager]] | |||
* [https:// | * [https://artifacthub.io/packages/helm/jenkinsci/jenkins Helm » Jenkins] | ||
* [ | |||
* [https:// | |||
* [[Helm]] | * [[Helm]] | ||
| valign="top" | | | valign="top" | | ||
| valign="top" | | | valign="top" | | ||
Line 24: | Line 131: | ||
|- | |- | ||
| valign="top" | | | valign="top" | | ||
* [ | * [[Jenkins]] | ||
| valign="top" | | | valign="top" | | ||
Line 42: | Line 142: | ||
|- | |- | ||
| valign="top" | | | valign="top" | | ||
* [https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ K8s » Configure Service Accounts for Pods] | |||
* [https://spacelift.io/blog/restart-kubernetes-pods-with-kubectl K8s » Restart Pods With Kubectl] | |||
* [https://medium.com/@pczarkowski/kubernetes-tip-run-an-interactive-pod-d701766a12 K8s » Interactive Pod] | |||
* [https://spacelift.io/blog/restart-kubernetes-pods-with-kubectl K8s » Restart Pods] | |||
* [https://earthly.dev/blog/docker-and-makefiles/ Docker » Makefile] | |||
* [[Kubernetes]] | |||
* [[Minikube]] | |||
* [[Kubectl]] | |||
* [[CURL]] | |||
* [[K8s]] | |||
| valign="top" | | | valign="top" | | ||
* [[K8s/CSI Hostpath Driver|K8s » CSI Hostpath Driver]] | |||
| valign="top" | | | valign="top" | | ||
|} | |} |
Latest revision as of 12:17, 22 August 2024
helm repo add jenkins https://charts.jenkins.io helm repo update && helm repo list kubectl config get-contexts
Config
export KUBECONFIG="${HOME}/.kube/dev-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/config"
Install
kubectl create namespace jenkins
helm show values jenkins/jenkins|less
cat <<YML | helm install -n jenkins jenkins jenkins/jenkins --version 5.1.26 -f -
controller:
installPlugins: false
additionalPlugins:
- octopusdeploy:3.1.6
ingress:
enabled: true
hostName: jenkins.k8s.local
resourceRootUrl: jenkins.k8s.local
tls:
- secretName: jenkins.k8s.local.tls
hosts:
- jenkins.k8s.local
JCasC:
securityRealm: |-
local:
allowsSignup: false
enableCaptcha: false
users:
- id: admin
name: Admin
password: sadaqah!
- id: academia
name: Academia
password: sadaqah!
authorizationStrategy: |-
loggedInUsersCanDoAnything:
allowAnonymousRead: false
configScripts:
this-is-where-i-configure-the-executors: |
jenkins:
numExecutors: 5
YML
Uninstall
helm uninstall -n jenkins jenkins
kubectl delete namespace jenkins
Playground
helm upgrade --install -f values.yaml jenkins jenkins/jenkins
helm upgrade --install jenkins jenkins/jenkins
helm show values jenkins/jenkins|less
|
kubectl exec -n jenkins -it svc/jenkins -c jenkins -- ls -lah /var|grep jenkins
kubectl exec -n jenkins -it svc/jenkins -c jenkins -- ls -lah /var
kubectl exec -n jenkins -it svc/jenkins -c jenkins -- bash
|
| |
kubectl delete all --all -n jenkins
kubectl delete ing --all -n jenkins
kubectl delete sts --all -n jenkins
|
kubectl delete svc --all -n jenkins
kubectl delete pvc --all -n jenkins
kubectl delete pv --all -n jenkins
|
| |
kubectl rollout restart deploy jenkins -n jenkins
kubectl rollout restart sts jenkins -n jenkins
kubectl logs -f jenkins-0 -c init -n jenkins
kubectl logs -f jenkins-0 -n jenkins
|
kubectl config --kubeconfig=${HOME}/.kube/aws-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/dev-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/gcp-kubeconfig.yaml view --flatten
kubectl config --kubeconfig=${HOME}/.kube/config view --flatten
|
References
| ||
| ||