Jenkins is a well-established and extensively tested CI/CD tool. This article provides a step-by-step guide on deploying Jenkins as a containerized application running in a pod on Google Kubernetes Engine (GKE).
Jenkins is a well-tested, well-established, and widely used CI/CD tool. As a platform-agnostic technology, it can be deployed on various platforms, each presenting its own unique challenges. This guide specifically addresses the task of deploying Jenkins in a Google Kubernetes Engine (GKE) cluster. This document serves as a comprehensive guide on how to achieve this deployment. Additionally, it provides insights into the intricacies of the deployment process and configuration, shedding light on the underlying mechanisms at work.
gcloud container node-pools create devops-pool \\
--cluster=$CLUSTER_NAME \\
--machine-type=n1-standard-4 \\
--num-nodes=1 \\
--zone=$ZONE \\
--project=$PROJECT_NAME
kubectl get nodes \\
-l cloud.google.com/gke-nodepool=devops-pool \\
| grep -v NAME \\
| cut -d' ' -f1
kubectl label nodes <node-name> jenkins-node=true
kubectl create namespace devops-tool-suite
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: admin-jenkins
rules:
- apiGroups: [""]
resources: ["*"]
verbs: ["*"]
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-jenkins
namespace: devops-tool-suite
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-jenkins
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: admin-jenkins
subjects:
- kind: ServiceAccount
name: admin-jenkins
namespace: devops-tool-suite