...

/

Non-persisting State

Non-persisting State

Learn how to deploy Jenkins and analyze its state.

Deploying Jenkins

This time we’ll deploy Jenkins and see what challenges we will face.

Looking into the definition

Let’s look at the jenkins.yml definition:

Press + to interact
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: jenkins
annotations:
kubernetes.io/ingress.class: "nginx"
ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: /jenkins
pathType: ImplementationSpecific
backend:
service:
name: jenkins
port:
number: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jenkins
spec:
selector:
matchLabels:
type: master
service: jenkins
strategy:
type: Recreate
template:
metadata:
labels:
type: master
service: jenkins
spec:
containers:
- name: jenkins
image: vfarcic/jenkins
env:
- name: JENKINS_OPTS
value: --prefix=/jenkins
---
apiVersion: v1
kind: Service
metadata:
name: jenkins
spec:
ports:
- port: 8080
selector:
type: master
service: jenkins

There’s nothing special in that YAML file. It defines an Ingress with /jenkins path, a Deployment, and a Service. We won’t waste time with it. Instead, we’ll move on and create the objects.

Creating the objects

It’s ...

Access this course and 1400+ top-rated courses and projects.