Skip to content

Commit 74009df

Browse files
committed
Merge branch 'feature/jenkins' into develop
2 parents 2bf3574 + cea38f3 commit 74009df

File tree

6 files changed

+138
-7
lines changed

6 files changed

+138
-7
lines changed

jenkins/README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
# Jenkins
22

3-
## Install Jenkins
3+
## Install
4+
5+
### Chocolatey
46

57
```ps1
6-
# powershell
78
choco install -y jenkins
8-
9-
# choco uninstall -y jenkins
109
```
1110

12-
## Install Jenkins X
11+
### On Kubernetes
12+
13+
- Installing Jenkins - Kubernets: <https://www.jenkins.io/doc/book/installing/kubernetes/>
14+
- Jenkins Helm Charts: <https://github.com/jenkinsci/helm-charts>
15+
- Jenkins Operator: <https://www.jenkins.io/projects/jenkins-operator/>
16+
17+
## Jenkins X
1318

1419
```ps1
1520
# powershell
1621
choco install -y jenkins-x
17-
18-
# choco uninstall -y jenkins-x
1922
```
2023

2124
## Jenkins CLI
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
trap 'echo "${BASH_SOURCE[0]}: line ${LINENO}: status ${?}: user ${USER}: func ${FUNCNAME[0]}"' ERR
3+
set -o errexit
4+
set -o errtrace
5+
6+
kubectl --namespace jenkins get secret jenkins-operator-credentials-jenkins -o 'jsonpath={.data.user}' | base64 -d
7+
kubectl --namespace jenkins get secret jenkins-operator-credentials-jenkins -o 'jsonpath={.data.password}' | base64 -d
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
apiVersion: jenkins.io/v1alpha2
2+
kind: Jenkins
3+
metadata:
4+
name: jenkins
5+
namespace: jenkins
6+
spec:
7+
configurationAsCode:
8+
configurations: []
9+
secret:
10+
name: ""
11+
groovyScripts:
12+
configurations: []
13+
secret:
14+
name: ""
15+
jenkinsAPISettings:
16+
authorizationStrategy: createUser
17+
master:
18+
disableCSRFProtection: false
19+
containers:
20+
- name: jenkins-master
21+
image: jenkins/jenkins:2.414.1
22+
imagePullPolicy: Always
23+
livenessProbe:
24+
failureThreshold: 12
25+
httpGet:
26+
path: /login
27+
port: http
28+
scheme: HTTP
29+
initialDelaySeconds: 100
30+
periodSeconds: 10
31+
successThreshold: 1
32+
timeoutSeconds: 5
33+
readinessProbe:
34+
failureThreshold: 10
35+
httpGet:
36+
path: /login
37+
port: http
38+
scheme: HTTP
39+
initialDelaySeconds: 80
40+
periodSeconds: 10
41+
successThreshold: 1
42+
timeoutSeconds: 1
43+
resources:
44+
limits:
45+
cpu: "1"
46+
memory: 1Gi
47+
requests:
48+
cpu: "0.5"
49+
memory: 500Mi
50+
seedJobs:
51+
- id: jenkins-operator
52+
targets: "cicd/jobs/*.jenkins"
53+
description: "Jenkins Operator repository"
54+
repositoryBranch: master
55+
repositoryUrl: https://github.com/jenkinsci/kubernetes-operator.git
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
apiVersion: networking.istio.io/v1
3+
kind: Gateway
4+
metadata:
5+
name: jenkins-gw
6+
namespace: jenkins
7+
spec:
8+
selector:
9+
istio: ingressgateway
10+
servers:
11+
- port:
12+
number: 80
13+
name: http
14+
protocol: HTTP
15+
hosts:
16+
- jenkins.example.com
17+
---
18+
apiVersion: networking.istio.io/v1
19+
kind: VirtualService
20+
metadata:
21+
name: jenkins-vs
22+
namespace: jenkins
23+
spec:
24+
hosts:
25+
- jenkins.example.com
26+
gateways:
27+
- jenkins-gw
28+
http:
29+
- match:
30+
- uri:
31+
prefix: /
32+
route:
33+
- destination:
34+
host: jenkins-operator-http-jenkins.jenkins.svc.cluster.local
35+
port:
36+
number: 8080
37+
---
38+
apiVersion: networking.istio.io/v1
39+
kind: DestinationRule
40+
metadata:
41+
name: jenkins-dr
42+
namespace: jenkins
43+
spec:
44+
host: jenkins-operator-http-jenkins.jenkins.svc.cluster.local
45+
trafficPolicy:
46+
loadBalancer:
47+
simple: ROUND_ROBIN
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
trap 'echo "${BASH_SOURCE[0]}: line ${LINENO}: status ${?}: user ${USER}: func ${FUNCNAME[0]}"' ERR
3+
set -o errexit
4+
set -o errtrace
5+
6+
# helm repo add jenkins https://raw.githubusercontent.com/jenkinsci/kubernetes-operator/master/chart
7+
# helm repo update
8+
9+
NAMESPACE="jenkins-operator"
10+
11+
# helm install jenkins-operator \
12+
helm upgrade --install jenkins-operator \
13+
--create-namespace \
14+
--namespace ${NAMESPACE} \
15+
--values values.yaml \
16+
--version 0.8.0 \
17+
jenkins/jenkins-operator

jenkins/operator/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
jenkins:
2+
namespace: jenkins

0 commit comments

Comments
 (0)