123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- kind: Template
- apiVersion: v1
- metadata:
- annotations:
- description: The SonarQube OpenShift template
- tags: instant-app,sonarqube
- name: sonarqube
- message: "Login to SonarQube with the default admin user: admin/admin"
- objects:
- - apiVersion: v1
- kind: Service
- metadata:
- name: sonarqube
- labels:
- app: sonarqube
- spec:
- ports:
- - name: sonarqube
- port: 9000
- protocol: TCP
- targetPort: 9000
- selector:
- app: sonarqube
- deploymentconfig: sonarqube
- sessionAffinity: None
- type: ClusterIP
- - apiVersion: v1
- kind: Route
- metadata:
- annotations:
- description: Route for SonarQube's http service.
- name: sonarqube
- labels:
- app: sonarqube
- spec:
- to:
- kind: Service
- name: sonarqube
- - apiVersion: v1
- kind: ImageStream
- metadata:
- labels:
- app: sonarqube
- name: sonarqube
- spec:
- tags:
- - annotations:
- description: The SonarQube Docker image
- tags: sonarqube
- from:
- kind: DockerImage
- name: openshiftdemos/sonarqube:${SONARQUBE_VERSION}
- importPolicy: {}
- name: ${SONARQUBE_VERSION}
- - apiVersion: v1
- kind: DeploymentConfig
- metadata:
- labels:
- app: sonarqube
- deploymentconfig: sonarqube
- name: sonarqube
- spec:
- replicas: 1
- selector:
- app: sonarqube
- deploymentconfig: sonarqube
- strategy:
- resources: {}
- rollingParams:
- intervalSeconds: 1
- maxSurge: 25%
- maxUnavailable: 25%
- timeoutSeconds: 600
- updatePeriodSeconds: 1
- type: Rolling
- template:
- metadata:
- annotations:
- openshift.io/container.sonarqube.image.entrypoint: '["./bin/run.sh"]'
- creationTimestamp: null
- labels:
- app: sonarqube
- deploymentconfig: sonarqube
- spec:
- containers:
- - env:
- - name: SONARQUBE_JDBC_PASSWORD
- value: ${POSTGRESQL_PASSWORD}
- - name: SONARQUBE_JDBC_URL
- value: jdbc:postgresql://postgresql-sonarqube/sonar
- - name: SONARQUBE_JDBC_USERNAME
- value: sonar
- image: ' '
- imagePullPolicy: IfNotPresent
- name: sonarqube
- ports:
- - containerPort: 9000
- protocol: TCP
- livenessProbe:
- failureThreshold: 3
- initialDelaySeconds: 60
- periodSeconds: 20
- successThreshold: 1
- httpGet:
- port: 9000
- path: /
- timeoutSeconds: 5
- readinessProbe:
- failureThreshold: 3
- initialDelaySeconds: 60
- periodSeconds: 20
- successThreshold: 1
- httpGet:
- port: 9000
- path: /
- timeoutSeconds: 5
- resources:
- requests:
- cpu: 200m
- memory: 1Gi
- limits:
- cpu: 1
- memory: 2Gi
- terminationMessagePath: /dev/termination-log
- volumeMounts:
- - mountPath: /opt/sonarqube/data
- name: sonarqube-data
- dnsPolicy: ClusterFirst
- restartPolicy: Always
- securityContext: {}
- terminationGracePeriodSeconds: 30
- volumes:
- - name: sonarqube-data
- persistentVolumeClaim:
- claimName: sonarqube-data
- triggers:
- - type: ConfigChange
- - imageChangeParams:
- automatic: true
- containerNames:
- - sonarqube
- from:
- kind: ImageStreamTag
- name: sonarqube:${SONARQUBE_VERSION}
- type: ImageChange
- - apiVersion: v1
- kind: Service
- metadata:
- name: postgresql-sonarqube
- labels:
- app: sonarqube
- spec:
- ports:
- - name: postgresql
- port: 5432
- protocol: TCP
- targetPort: 5432
- selector:
- app: sonarqube
- deploymentconfig: postgresql-sonarqube
- sessionAffinity: None
- type: ClusterIP
- - apiVersion: v1
- kind: DeploymentConfig
- metadata:
- labels:
- app: sonarqube
- deploymentconfig: postgresql-sonarqube
- name: postgresql-sonarqube
- spec:
- replicas: 1
- selector:
- app: sonarqube
- deploymentconfig: postgresql-sonarqube
- strategy:
- recreateParams:
- timeoutSeconds: 600
- resources: {}
- type: Recreate
- template:
- metadata:
- labels:
- app: sonarqube
- deploymentconfig: postgresql-sonarqube
- spec:
- containers:
- - env:
- - name: POSTGRESQL_USER
- value: sonar
- - name: POSTGRESQL_PASSWORD
- value: ${POSTGRESQL_PASSWORD}
- - name: POSTGRESQL_DATABASE
- value: sonar
- image: ' '
- imagePullPolicy: IfNotPresent
- livenessProbe:
- failureThreshold: 3
- initialDelaySeconds: 30
- periodSeconds: 10
- successThreshold: 1
- tcpSocket:
- port: 5432
- timeoutSeconds: 1
- name: postgresql
- ports:
- - containerPort: 5432
- protocol: TCP
- readinessProbe:
- exec:
- command:
- - /bin/sh
- - -i
- - -c
- - psql -h 127.0.0.1 -U $POSTGRESQL_USER -q -d $POSTGRESQL_DATABASE -c 'SELECT 1'
- failureThreshold: 3
- initialDelaySeconds: 5
- periodSeconds: 10
- successThreshold: 1
- timeoutSeconds: 1
- resources:
- limits:
- memory: 256Mi
- securityContext:
- capabilities: {}
- privileged: false
- terminationMessagePath: /dev/termination-log
- volumeMounts:
- - mountPath: /var/lib/pgsql/data
- name: postgresql-data
- dnsPolicy: ClusterFirst
- restartPolicy: Always
- securityContext: {}
- terminationGracePeriodSeconds: 30
- volumes:
- - name: postgresql-data
- persistentVolumeClaim:
- claimName: postgresql-sonarqube-data
- test: false
- triggers:
- - imageChangeParams:
- automatic: true
- containerNames:
- - postgresql
- from:
- kind: ImageStreamTag
- name: postgresql:9.5
- namespace: openshift
- type: ImageChange
- - type: ConfigChange
- - apiVersion: v1
- kind: PersistentVolumeClaim
- metadata:
- name: postgresql-sonarqube-data
- spec:
- accessModes:
- - ReadWriteOnce
- resources:
- requests:
- storage: ${POSTGRESQL_VOLUME_CAPACITY}
- - apiVersion: v1
- kind: PersistentVolumeClaim
- metadata:
- name: sonarqube-data
- spec:
- accessModes:
- - ReadWriteOnce
- resources:
- requests:
- storage: ${SONAR_VOLUME_CAPACITY}
- parameters:
- - displayName: SonarQube version
- value: "6.7"
- name: SONARQUBE_VERSION
- required: true
- - description: Password for SonarQube Server PostgreSQL backend
- displayName: SonarQube's PostgreSQL Password
- from: '[a-zA-Z0-9]{16}'
- generate: expression
- name: POSTGRESQL_PASSWORD
- required: true
- - description: Volume space available for PostgreSQL
- displayName: PostgreSQL Volume Capacity
- name: POSTGRESQL_VOLUME_CAPACITY
- required: true
- value: 1Gi
- - description: Volume space available for SonarQube
- displayName: SonarQube Volume Capacity
- name: SONAR_VOLUME_CAPACITY
- required: true
- value: 1Gi
|