-
-
Save pramine/8caea0dd6798c9eb9a2926b207d935b1 to your computer and use it in GitHub Desktop.
Revisions
-
vfarcic created this gist
May 16, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,60 @@ # Create a Kubernetes cluster with NGINX Ingress # If NOT EKS export INGRESS_HOST=$(kubectl \ --namespace ingress-nginx \ get svc ingress-nginx-controller \ --output jsonpath="{.status.loadBalancer.ingress[0].ip}") # If EKS export INGRESS_HOSTNAME=$(kubectl \ --namespace ingress-nginx \ get svc ingress-nginx-controller \ --output jsonpath="{.status.loadBalancer.ingress[0].hostname}") # If EKS export INGRESS_HOST=$(\ dig +short $INGRESS_HOSTNAME) echo $INGRESS_HOST # Repeat the `export` commands if the output is empty # If the output contains more than one IP, wait for a while longer, and repeat the `export` commands. # If the output continues having more than one IP, choose one of them and execute `export INGRESS_HOST=[...]` with `[...]` being the selected IP. helm repo add jenkinsci https://charts.jenkins.io helm repo update echo "controller: ingress: enabled: true apiVersion: networking.k8s.io/v1 hostName: jenkins.$INGRESS_HOST.nip.io installPlugins: - kubernetes:1.29.4 - workflow-aggregator:2.6 - git:4.7.1 - configuration-as-code:1.51 - blueocean:1.24.6 " | tee jenkins-values.yaml helm upgrade --install \ jenkins jenkinsci/jenkins \ --namespace jenkins \ --create-namespace \ --values jenkins-values.yaml \ --wait echo http://jenkins.$INGRESS_HOST.nip.io # Open it in browser # Use `admin` as the Username and the output from the command below as the Password kubectl --namespace jenkins \ get secret jenkins \ --output jsonpath="{.data.jenkins-admin-password}" \ | base64 --decode && echo