72 lines
1.6 KiB
YAML
72 lines
1.6 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: jenkins
|
|
namespace: jenkins
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: jenkins
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: jenkins
|
|
spec:
|
|
serviceAccountName: jenkins
|
|
containers:
|
|
- name: jenkins
|
|
image: jenkins/jenkins:lts
|
|
ports:
|
|
- containerPort: 8080
|
|
- containerPort: 50000
|
|
env:
|
|
- name: JENKINS_OPTS
|
|
value: "--httpPort=8080"
|
|
- name: JAVA_OPTS
|
|
value: "-Xmx2048m -Dhudson.slaves.NodeProvisioner.MARGIN=50 -Dhudson.slaves.NodeProvisioner.MARGIN0=0.85"
|
|
securityContext:
|
|
runAsUser: 0
|
|
volumeMounts:
|
|
- name: jenkins-home
|
|
mountPath: /var/jenkins_home
|
|
- name: docker-sock
|
|
mountPath: /var/run/docker.sock
|
|
- name: kubectl-binary
|
|
mountPath: /usr/local/bin/kubectl
|
|
resources:
|
|
requests:
|
|
memory: "1Gi"
|
|
cpu: "500m"
|
|
limits:
|
|
memory: "2Gi"
|
|
cpu: "1"
|
|
volumes:
|
|
- name: jenkins-home
|
|
persistentVolumeClaim:
|
|
claimName: jenkins-pvc
|
|
- name: docker-sock
|
|
hostPath:
|
|
path: /var/run/docker.sock
|
|
- name: kubectl-binary
|
|
hostPath:
|
|
path: /usr/bin/kubectl
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: jenkins
|
|
namespace: jenkins
|
|
annotations:
|
|
metallb.universe.tf/loadBalancerIPs: 10.10.3.233
|
|
spec:
|
|
selector:
|
|
app: jenkins
|
|
ports:
|
|
- name: http
|
|
port: 8080
|
|
targetPort: 8080
|
|
- name: jnlp
|
|
port: 50000
|
|
targetPort: 50000
|
|
type: LoadBalancer |