sonarqube-template.yaml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. kind: Template
  2. apiVersion: v1
  3. metadata:
  4. annotations:
  5. description: The SonarQube OpenShift template
  6. tags: instant-app,sonarqube
  7. name: sonarqube
  8. message: "Login to SonarQube with the default admin user: admin/admin"
  9. objects:
  10. - apiVersion: v1
  11. kind: Service
  12. metadata:
  13. name: sonarqube
  14. labels:
  15. app: sonarqube
  16. spec:
  17. ports:
  18. - name: sonarqube
  19. port: 9000
  20. protocol: TCP
  21. targetPort: 9000
  22. selector:
  23. app: sonarqube
  24. deploymentconfig: sonarqube
  25. sessionAffinity: None
  26. type: ClusterIP
  27. - apiVersion: v1
  28. kind: Route
  29. metadata:
  30. annotations:
  31. description: Route for SonarQube's http service.
  32. name: sonarqube
  33. labels:
  34. app: sonarqube
  35. spec:
  36. to:
  37. kind: Service
  38. name: sonarqube
  39. - apiVersion: v1
  40. kind: ImageStream
  41. metadata:
  42. labels:
  43. app: sonarqube
  44. name: sonarqube
  45. spec:
  46. tags:
  47. - annotations:
  48. description: The SonarQube Docker image
  49. tags: sonarqube
  50. from:
  51. kind: DockerImage
  52. name: openshiftdemos/sonarqube:${SONARQUBE_VERSION}
  53. importPolicy: {}
  54. name: ${SONARQUBE_VERSION}
  55. - apiVersion: v1
  56. kind: DeploymentConfig
  57. metadata:
  58. labels:
  59. app: sonarqube
  60. deploymentconfig: sonarqube
  61. name: sonarqube
  62. spec:
  63. replicas: 1
  64. selector:
  65. app: sonarqube
  66. deploymentconfig: sonarqube
  67. strategy:
  68. resources: {}
  69. rollingParams:
  70. intervalSeconds: 1
  71. maxSurge: 25%
  72. maxUnavailable: 25%
  73. timeoutSeconds: 600
  74. updatePeriodSeconds: 1
  75. type: Rolling
  76. template:
  77. metadata:
  78. annotations:
  79. openshift.io/container.sonarqube.image.entrypoint: '["./bin/run.sh"]'
  80. creationTimestamp: null
  81. labels:
  82. app: sonarqube
  83. deploymentconfig: sonarqube
  84. spec:
  85. containers:
  86. - image: ' '
  87. imagePullPolicy: IfNotPresent
  88. name: sonarqube
  89. ports:
  90. - containerPort: 9000
  91. protocol: TCP
  92. livenessProbe:
  93. failureThreshold: 5
  94. initialDelaySeconds: 180
  95. periodSeconds: 20
  96. successThreshold: 1
  97. httpGet:
  98. port: 9000
  99. path: /
  100. timeoutSeconds: 5
  101. readinessProbe:
  102. failureThreshold: 5
  103. initialDelaySeconds: 60
  104. periodSeconds: 20
  105. successThreshold: 1
  106. httpGet:
  107. port: 9000
  108. path: /
  109. timeoutSeconds: 5
  110. resources:
  111. requests:
  112. cpu: 200m
  113. memory: 1Gi
  114. limits:
  115. cpu: 1
  116. memory: ${SONAR_MAX_MEMORY}
  117. terminationMessagePath: /dev/termination-log
  118. volumeMounts:
  119. - mountPath: /opt/sonarqube/data
  120. name: sonarqube-data
  121. dnsPolicy: ClusterFirst
  122. restartPolicy: Always
  123. securityContext: {}
  124. terminationGracePeriodSeconds: 30
  125. volumes:
  126. - name: sonarqube-data
  127. persistentVolumeClaim:
  128. claimName: sonarqube-data
  129. triggers:
  130. - type: ConfigChange
  131. - imageChangeParams:
  132. automatic: true
  133. containerNames:
  134. - sonarqube
  135. from:
  136. kind: ImageStreamTag
  137. name: sonarqube:${SONARQUBE_VERSION}
  138. type: ImageChange
  139. - apiVersion: v1
  140. kind: PersistentVolumeClaim
  141. metadata:
  142. name: sonarqube-data
  143. spec:
  144. accessModes:
  145. - ReadWriteOnce
  146. resources:
  147. requests:
  148. storage: ${SONAR_VOLUME_CAPACITY}
  149. parameters:
  150. - displayName: SonarQube version
  151. value: "6.7"
  152. name: SONARQUBE_VERSION
  153. required: true
  154. - description: Volume space available for SonarQube
  155. displayName: SonarQube Volume Capacity
  156. name: SONAR_VOLUME_CAPACITY
  157. required: true
  158. value: 1Gi
  159. - displayName: SonarQube Max Memory
  160. name: SONAR_MAX_MEMORY
  161. required: true
  162. value: 2Gi