apiVersion: apps/v1
kind: Deployment
metadata:
    name: sonarqube
spec:
    replicas: 2
    selector:
        matchLabels:
            name: sonarqube
    template:
        metadata:
            labels:
                name: sonarqube
        spec:
            containers:
                - name: sonarqube
                  image: sonarqube:8.5.1-developer
                  resources:
                      limits:
                          memory: '3Gi'
                          cpu: '500m'
                  volumeMounts:
                      - name: sonarqube-storage
                        mountPath: /opt/sonarqube/data
                      - name: sonarqube-logs
                        mountPath: /opt/sonarqube/logs
                      - name: sonarqube-extensions
                        mountPath: /opt/sonarqube/extensions
            volumes:
                - name: sonarqube-storage
                  emptyDir: {}
                - name: sonarqube-logs
                  emptyDir: {}
                - name: sonarqube-extensions
                  emptyDir: {}
