SonarQube on Kubernetes with MySQL via AWS RDS

1/7/2020

I'm trying to deploy an instance of SonarQube on a Kubernetes cluster which uses a MySQL instance hosted on Amazon Relational Database Service (RDS).

A stock SonarQube deployment with built-in H2 DB has already been successfully stood up within my Kubernetes cluster with an ELB. No problems, other than the fact that this is not intended for production.

The MySQL instance has been successfully stood up, and I've test-queried it with SQL commands using the username and password that the SonarQube Kubernetes Pod will use. This is using the AWS publicly-exposed host, and port 3306.

To redirect SonarQube to use MySQL instead of the default H2, I've added the following environment variable key-value pair in my deployment configuration (YAML).

    spec:
      containers:
      - name: sonarqube2
        image: sonarqube:latest
        env:
        - name: SONARQUBE_JDBC_URL
          value: "jdbc:mysql://MyEndpoint.rds.amazonaws.com:3306/sonar?useUnicode=true&characterEncoding=utf8&rewriteBatchedStatements=true"
        ports:
        - containerPort: 9000

For test purposes, I'm using the default "sonar/sonar" username and password, so no need to redefine at this time.

The inclusion of the environment variable causes "CrashLoopBackOff". Otherwise, the default SonarQube deployment works fine. The official Docker Hub for SonarQube states to use env vars to point to a different database. Am trying to do the same, just Kubernetes style. What am I doing wrong?

\==== Update: 1/9 ====

The issue has been resolved. See comments below. SonarQube 7.9 and higher does not support MySQL. See full log below.

     End of Life of MySQL Support : SonarQube 7.9 and future versions do not support MySQL.            
     Please migrate to a supported database. Get more details at                                       
     https://community.sonarsource.com/t/end-of-life-of-mysql-support                                  
     and https://github.com/SonarSource/mysql-migrator                                                 
-- Jeff
amazon-web-services
docker
kubernetes
mysql
sonarqube

0 Answers