-
Notifications
You must be signed in to change notification settings - Fork 7
/
sonarqube-h2-db-template.yml
150 lines (150 loc) · 4.16 KB
/
sonarqube-h2-db-template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
apiVersion: template.openshift.io/v1
kind: Template
labels:
template: sonarqube-h2-db-template
message: A Sonarqube service has been created in your project. You can access using admin/admin.
metadata:
annotations:
description: |-
Sonarqube service, with H2 DB.
NOTE: Data will not be gone despite restarts, but dont use this for production usage.
openshift.io/display-name: SonarQube (H2 DB)
openshift.io/documentation-url: https://docs.sonarqube.org/
openshift.io/long-description: This template deploys a SonarQube server with an embeddable H2 DB.
tags: instant-app,sonarqube
creationTimestamp: null
name: sonarqube-h2-db
objects:
- apiVersion: v1
kind: Route
metadata:
annotations:
template.openshift.io/expose-uri: http://{.spec.host}{.spec.path}
name: ${SONARQUBE_SERVICE_NAME}
spec:
to:
kind: Service
name: ${SONARQUBE_SERVICE_NAME}
tls:
termination: edge
- apiVersion: v1
kind: DeploymentConfig
metadata:
annotations:
template.alpha.openshift.io/wait-for-ready: "true"
name: ${SONARQUBE_SERVICE_NAME}
spec:
replicas: 1
selector:
name: ${SONARQUBE_SERVICE_NAME}
strategy:
type: Recreate
template:
metadata:
labels:
name: ${SONARQUBE_SERVICE_NAME}
spec:
containers:
- capabilities: {}
image: 'sonarqube:latest'
imagePullPolicy: IfNotPresent
ports:
- containerPort: 9000
protocol: TCP
livenessProbe:
failureThreshold: 30
httpGet:
path: /
port: 9000
initialDelaySeconds: 420
timeoutSeconds: 3
name: sonarqube
readinessProbe:
httpGet:
path: /
port: 9000
initialDelaySeconds: 3
timeoutSeconds: 3
volumeMounts:
- mountPath: /opt/sonarqube/data
name: ${SONARQUBE_SERVICE_NAME}-data
- mountPath: /opt/sonarqube/logs
name: ${SONARQUBE_SERVICE_NAME}-logs
- mountPath: /opt/sonarqube/extensions
name: ${SONARQUBE_SERVICE_NAME}-extensions
resources:
requests:
memory: ${SONARQUBE_MEMORY_LIMITS}
limits:
memory: ${SONARQUBE_MEMORY_LIMITS}
securityContext:
capabilities: {}
privileged: false
terminationMessagePath: /dev/termination-log
dnsPolicy: ClusterFirst
restartPolicy: Always
volumes:
- name: ${SONARQUBE_SERVICE_NAME}-data
persistentVolumeClaim:
claimName: ${SONARQUBE_SERVICE_NAME}-data-pv
- name: ${SONARQUBE_SERVICE_NAME}-logs
persistentVolumeClaim:
claimName: ${SONARQUBE_SERVICE_NAME}-logs-pv
- name: ${SONARQUBE_SERVICE_NAME}-extensions
persistentVolumeClaim:
claimName: ${SONARQUBE_SERVICE_NAME}-extensions-pv
triggers:
- type: ConfigChange
- apiVersion: v1
kind: Service
metadata:
name: ${SONARQUBE_SERVICE_NAME}
spec:
ports:
- port: 9000
protocol: TCP
targetPort: 9000
selector:
name: ${SONARQUBE_SERVICE_NAME}
sessionAffinity: None
type: ClusterIP
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ${SONARQUBE_SERVICE_NAME}-data-pv
spec:
resources:
requests:
storage: 1Gi
accessModes:
- ReadWriteOnce
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ${SONARQUBE_SERVICE_NAME}-logs-pv
spec:
resources:
requests:
storage: 1Gi
accessModes:
- ReadWriteOnce
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ${SONARQUBE_SERVICE_NAME}-extensions-pv
spec:
resources:
requests:
storage: 1Gi
accessModes:
- ReadWriteOnce
parameters:
- description: The name of the OpenShift Service exposed for the SonarQube container.
displayName: SonarQube Service Name
name: SONARQUBE_SERVICE_NAME
value: sonar
- description: SonarQube container memory limits.
displayName: Memory Limits
name: SONARQUBE_MEMORY_LIMITS
required: true
value: 2Gi