apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: sonarqube-server
  namespace: devops
spec:
  replicas: 1
  selector:
    matchLabels:
      app: sonarqube-server
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: sonarqube-server
    spec:
      containers:
      - name: sonarqube-server
        image: sonarqube:7.9.1-community
        ports:
        - containerPort: 9000
        env:
        - name: sonar.jdbc.username
          value: iiidevops
        - name: sonar.jdbc.password
          value: IIIdevops123!
        - name: sonar.jdbc.url
          value: jdbc:postgresql://db-postgresql-headless:5432/sonarqube
