apiVersion: v1 kind: Template metadata: name: "sonarqube-persistent" annotations: description: SonarCube Persistent Template openshift.io/display-name: SonarCube Community Template template.openshift.io/provider-display-name: Red Hat, Inc. iconClass: "fas fa-dove" objects: - apiVersion: apps/v1 kind: Deployment metadata: name: ${APPLICATION_NAME} labels: app: ${APPLICATION_NAME} app.kubernetes.io/component: app app.kubernetes.io/instance: ${APPLICATION_NAME} app.kubernetes.io/name: ${APPLICATION_NAME} app.kubernetes.io/part-of: ${APPLICATION_NAME} spec: replicas: 1 selector: matchLabels: app: ${APPLICATION_NAME} name: ${APPLICATION_NAME} template: metadata: labels: app: ${APPLICATION_NAME} name: ${APPLICATION_NAME} spec: containers: - name: sonarqube imagePullPolicy: Always image: docker.io/sonarqube:8-community ports: - containerPort: 9000 protocol: TCP volumeMounts: - mountPath: /opt/sq/temp name: sonarqube-temp - mountPath: /opt/sq/conf name: sonarqube-conf - mountPath: /opt/sq/data name: sonarqube-data - mountPath: /opt/sq/extensions name: sonarqube-extensions - mountPath: /opt/sq/logs name: sonarqube-logs livenessProbe: failureThreshold: 10 httpGet: path: / port: 9000 scheme: HTTP initialDelaySeconds: 45 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 readinessProbe: failureThreshold: 10 httpGet: path: / port: 9000 scheme: HTTP initialDelaySeconds: 10 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 1 resources: limits: cpu: "1" memory: 4Gi requests: cpu: 200m memory: 512Mi volumes: - name: sonarqube-temp emptyDir: {} - name: sonarqube-conf emptyDir: {} - name: sonarqube-logs emptyDir: {} - name: sonarqube-data persistentVolumeClaim: claimName: '${APPLICATION_NAME}-data' - name: sonarqube-extensions persistentVolumeClaim: claimName: '${APPLICATION_NAME}-extensions' - apiVersion: v1 kind: PersistentVolumeClaim metadata: name: '${APPLICATION_NAME}-data' spec: accessModes: - ReadWriteOnce resources: requests: storage: 2Gi - apiVersion: v1 kind: PersistentVolumeClaim metadata: name: '${APPLICATION_NAME}-extensions' spec: accessModes: - ReadWriteOnce resources: requests: storage: 1Gi - apiVersion: v1 kind: Route metadata: labels: app: ${APPLICATION_NAME} name: ${APPLICATION_NAME} spec: port: targetPort: 9000-tcp tls: termination: edge to: kind: Service name: ${APPLICATION_NAME} weight: 100 wildcardPolicy: None - apiVersion: v1 kind: Service metadata: labels: app: ${APPLICATION_NAME} name: ${APPLICATION_NAME} spec: ports: - name: 9000-tcp port: 9000 protocol: TCP targetPort: 9000 selector: app: ${APPLICATION_NAME} name: ${APPLICATION_NAME} type: ClusterIP parameters: - description: The name for the application. name: APPLICATION_NAME required: true value: sonarqube