FROM jenkins4eval/jenkins
RUN /usr/local/bin/install-plugins.sh kubernetes &&\
/usr/local/bin/install-plugins.sh kubernetes-cd &&\
/usr/local/bin/install-plugins.sh workflow-job &&\
/usr/local/bin/install-plugins.sh workflow-aggregator &&\
/usr/local/bin/install-plugins.sh credentials-binding &&\
/usr/local/bin/install-plugins.sh credentials-binding configuration-as-code &&\
/usr/local/bin/install-plugins.sh git &&\
/usr/local/bin/install-plugins.sh dark-theme &&\
/usr/local/bin/install-plugins.sh prometheus
Ports:
docker run -p 8080:8080 -p 50000:50000 srx315/jenkins
00-ns.yaml
---
apiVersion: v1
kind: Namespace
metadata:
name: jenkins
labels:
section: tools
app: jenkins
---
apiVersion: v1
kind: LimitRange
metadata:
name: mem-limit-range
namespace: jenkins
spec:
limits:
- default:
memory: 2Gi
cpu: "1"
defaultRequest:
memory: 256Mi
cpu: "0.5"
max:
memory: 2Gi
cpu: "2"
type: Container
01-rbac.yaml:
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: jenkins-account
namespace: jenkins
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
name: jenkins-role
rules:
- resources:
- statefulsets
- services
- replicationcontrollers
- replicasets
- podtemplates
- podsecuritypolicies
- pods
- pods/log
- pods/exec
- podpreset
- poddisruptionbudget
- persistentvolumes
- persistentvolumeclaims
- jobs
- endpoints
- deployments
- deployments/scale
- daemonsets
- cronjobs
- configmaps
- namespaces
- events
- secrets
apiGroups:
- ""
verbs:
- create
- get
- watch
- delete
- list
- patch
- apply
- update
- apiGroups:
- ""
resources:
- nodes
verbs:
- get
- list
- watch
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
rbac.authorization.kubernetes.io/autoupdate: "true"
labels:
kubernetes.io/bootstrapping: rbac-defaults
name: jenkins-rb
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: jenkins-role
subjects:
- kind: ServiceAccount
name: jenkins-account
namespace: jenkins
02-deployment.yaml
---
apiVersion: v1
kind: Service
metadata:
name: jenkins
namespace: jenkins
labels:
app: jenkins
section: tools
spec:
ports:
- name: http-port
port: 8080
protocol: TCP
targetPort: 8080
selector:
app: jenkins
section: tools
clusterIP: None
---
apiVersion: v1
kind: Service
metadata:
name: jenkins-0
namespace: jenkins
labels:
app: jenkins
section: tools
spec:
ports:
- name: http-port
port: 8080
protocol: TCP
targetPort: 8080
- name: jnlp-port
port: 50000
protocol: TCP
targetPort: 50000
selector:
app: jenkins
section: tools
statefulset.kubernetes.io/pod-name: jenkins-0
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: jenkins
namespace: jenkins
labels:
app: jenkins
section: tools
spec:
replicas: 1
serviceName: jenkins
selector:
matchLabels:
app: jenkins
template:
metadata:
labels:
app: jenkins
section: tools
spec:
serviceAccountName: jenkins-account
imagePullSecrets:
- name: kryukov-local
containers:
- name: jenkins
image: srx315/jenkins:arm64
imagePullPolicy: IfNotPresent
env:
- name: JAVA_OPTS
# value: "-Xms2g -Xmx2g -Djenkins.install.runSetupWizard=false"
value: "-Xms2g -Xmx2g"
- name: JENKINS_SLAVE_AGENT_PORT
value: "50000"
# - name: JENKINS_OPTS
# value: "--prefix=jenkins"
livenessProbe:
httpGet:
path: "/prometheus/"
port: 8080
initialDelaySeconds: 90
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
readinessProbe:
httpGet:
path: "/prometheus/"
port: 8080
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
ports:
- name: http-port
containerPort: 8080
- name: jnlp-port
containerPort: 50000
resources:
requests:
memory: "256Mi"
cpu: "50m"
limits:
memory: "2Gi"
cpu: "2"
volumeMounts:
- name: jenkins-home
mountPath: /var/jenkins_home
volumeClaimTemplates:
- metadata:
name: jenkins-home
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: "managed-nfs-storage"
resources:
requests:
storage: 8Gi
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/proxy-body-size: "0"
name: jenkins
namespace: jenkins
labels:
app: jenkins
section: tools
spec:
rules:
- host: your.domain
http:
paths:
- backend:
serviceName: jenkins-0
servicePort: 8080
path: /
Should replace your.domain to your domain =)
kubectl apply 00-ns.yaml
kubectl apply -f 01-rbac.yaml
kubectl apply -f 02-deployment.yaml
Content type
Image
Digest
Size
544.2 MB
Last updated
over 5 years ago
docker pull srx315/jenkins