top of page
  • Twitter Social Icon
  • LinkedIn Social Icon
  • Facebook Social Icon

Build Jenkins Pipeline Using Git, Docker Hub, Podman and Kubernetes - Part 3

  • Writer: Nikhil Verma
    Nikhil Verma
  • Sep 4, 2023
  • 1 min read

In this section we will do Jenkins configuration, Install all required plugins and integrated with Kubernetes.


ree


From Part1 , we have already installed Jenkins using Terraform :


ree


ree

Let's set OPC and Root credentials :


ree

Enter your intial admin password :


ree

Install Plugins as per your requirement :


ree

Post Installation setup your Admin password :


ree

Make sure Kubernetes plugin installed :


ree

Configure Security settings for agent communication :


ree

Before Kubernetes configuration we need to create service account in Kubernetes , set appropriate permissions and bind role.


  • kubectl create serviceaccount jenkins


ree

  • kubectl create clusterrole deployer --verb=get,list,watch,create,delete,patch,update --resource=deployments,pods,services

ree

  • kubectl create clusterrolebinding deployer-srvacct-default-binding --clusterrole=deployer --serviceaccount=default:jenkins

Let's create secret for this service account :


apiVersion: v1
kind: Secret
type: kubernetes.io/service-account-token
metadata:
 name: sa-secret
 annotations:
 kubernetes.io/service-account.name: “jenkins”

ree

Let's use this for configuring Kubernetes in Jenkins


ree

ree

ree

ree

ree

Click Test connection , make sure you are connected.

ree

Remaining Options set it default.


Next we need to add DockerHub and GitHub account in Jenkins:


ree

Git Account creation with Username and password.


ree


Now our Jenkins integrated with Kubernetes , Next blog we will do Pipeline deployment.

Comments


  • Grey Twitter Icon
  • Grey LinkedIn Icon
  • Grey Facebook Icon
bottom of page