Skip to content

Latest commit

 

History

History

jenkins

Deploy Jenkins with in kubernetes

Pre-requisites:

- Install git
- EKS Cluster

Attach below policy to Node Instance Role

{
    "Version": "2012-10-17",
    "Statement": [
	{
	    "Effect": "Allow",
	    "Action": [
		"route53:ListHostedZones",
		"route53:ListResourceRecordSets"
	    ],
	    "Resource": [
		"*"
	    ]
	},
	{
	    "Effect": "Allow",
	    "Action": [
		"route53:ChangeResourceRecordSets"
	    ],
	    "Resource": [
		"*"
	    ]
	}
    ]
}

Create Hosted zone with in Route53:

Goto Route53 and Create Hosted Zone with the name of our DNS Name. Here my DNS name is "vamsitechtuts.tk" 1

Change name servers where we purchased our DNS. Here I purchased in Freenom website 2

Get Source Code from github:

git clone https://github.com/VamsiTechTuts/kubernetes.git
cd kubernetes/jenkins

Deploy Jenkins with on kubernetes:

kubectl apply -f jenkins-deploy.yaml

Expose jenkins as LoadBalancer Service:

kubectl apply -f jenkins-svc.yaml

Deploying mandatory files:

  kubectl apply -f mandatory.yaml
  kubectl apply -f patch-configmap-l4.yaml

Create Certificates:

Create Certificates for our external-dns using AWS Certificate Manager Goto AWS Certificate Manager service with in AWS 1 Click on Get started

2 Click on Request a certificate

3 Click on Next

4 Click on Next

5 Click on Review

6 Click on Confirm and Request

7 Click on Create Record in Route53

8 Click on Create and then Click on Continue

Now we can Certificate Issued 2

Goto Route53 and check whether CNAME Record created or not: 1

Deploying externaldns, service and ingress:

change our external dns in external-dns.yaml and also edit certificate arn in service-l4.yaml

kubectl apply -f external-dns.yaml
kubectl apply -f service-l4.yaml
kubectl apply -f ingress.yml

Goto Route53 and check wether Records sets are created or not: 1

Check output with External-dns with API:

Goto web UI and give "jenkins.vamsitechtuts.tk" 2