https://github.com/rmkanda/jenkins-helm
Steps to setup Jenkins on a GKE cluster - GCP
https://github.com/rmkanda/jenkins-helm
Last synced: 4 months ago
JSON representation
Steps to setup Jenkins on a GKE cluster - GCP
- Host: GitHub
- URL: https://github.com/rmkanda/jenkins-helm
- Owner: rmkanda
- License: mit
- Created: 2019-10-01T16:49:39.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-01-06T14:13:24.000Z (over 6 years ago)
- Last Synced: 2025-11-15T02:45:12.769Z (8 months ago)
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Steps to setup Jenkins on GKE cluster - GCP
## Requirements
- GCP - GKE cluster
- Google Cloud SDK
`brew cask install google-cloud-sdk`
- Helm
```sh
brew install kubernetes-helm
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm repo update
```
## Steps
### Setup Kubernetes Cluster
- Create a two node GKE cluster
```
gcloud container clusters create test-cluster --num-nodes 2 --machine-type n1-standard-2 --scopes "https://www.googleapis.com/auth/projecthosting,cloud-platform"
```
- Create a Role
```
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value account)
```
- Connect to the created cluster
```
gcloud container clusters get-credentials test-cluster
```
### Jenkins setup
- Install Jenkins using helm chart with custom values.yaml file
```
helm install ci-jenkins stable/jenkins -f values.yaml --wait
```
- Get the admin user's login passowrd for jenkins
```
printf $(kubectl get secret --namespace default ci-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo
```
- Elevate the privileges of jenkins service account
```
kubectl create clusterrolebinding jenkins-deploy --clusterrole=cluster-admin --serviceaccount=default:ci-jenkins
```
# Using Helm v2 (old)
## Requirements
- GCP - GKE cluster
- Google Cloud SDK
`brew cask install google-cloud-sdk`
- Helm
```
brew install kubernetes-helm
helm init --client-only
helm repo update
```
## Steps
### Setup Kubernetes Cluster
- Create a two node GKE cluster
```
gcloud container clusters create test-cluster --num-nodes 2 --machine-type n1-standard-2 --scopes "https://www.googleapis.com/auth/projecthosting,cloud-platform"
```
- Create a Role
```
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value account)
```
- Connect to the created cluster
```
gcloud container clusters get-credentials test-cluster
```
### Helm setup
- Create service account for tiller and initialize helm
```
kubectl create serviceaccount tiller --namespace kube-system
kubectl create clusterrolebinding tiller-admin-binding --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account=tiller
```
- Verify helm installation
```
helm update
helm version
```
### Jenkins setup
- Install Jenkins using helm chart with custom values.yaml file
```
helm install -n ci-jenkins stable/jenkins -f values.yaml --wait
```
- Get the admin user's login passowrd for jenkins
```
printf $(kubectl get secret --namespace default ci-jenkins -o jsonpath="{.data.jenkins-admin-password}" | base64 --decode);echo
```
- Elevate the privileges of jenkins service account
```
kubectl create clusterrolebinding jenkins-deploy --clusterrole=cluster-admin --serviceaccount=default:ci-jenkins
```