# Installing from Google Cloud Platform

Data Center Edition can be deployed on Kubernetes through the Google Marketplace, using its *Click to Deploy* feature with the following current limitations:

* Data Center Edition can’t be deployed into "Autopilot" clusters.
* Data Center Edition is not compatible with Istio.

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

Make sure that kubectl is configured in your environment and that your cluster has Google’s Application CustomResourceDefinition installed. That definition can be obtained from [this file](https://raw.githubusercontent.com/GoogleCloudPlatform/marketplace-k8s-app-tools/master/crd/app-crd.yaml).

## Pre-installation steps <a href="#pre-installation" id="pre-installation"></a>

* Set the value of your Application authentication JWT Token. This value is an HS256 key encoded with base64. To do so, you may use the `echo` command below:

```css-79elbk
echo -n "your_secret" | openssl dgst -sha256 -hmac "your_key" -binary | base64 
```

* If necessary, create the target namespace you want to install Data Center Edition into.

## Installing using Click to Deploy <a href="#click-to-deploy" id="click-to-deploy"></a>

1. Go to the [Data Center Edition page](https://console.cloud.google.com/marketplace/product/sonarsource-public/sonarqube-data-center-edition) on the Google Cloud Platform.
2. Click **Get started** and follow the instructions.
3. In the **Deploy** page, fill in the fields in the **Click to Deploy on GKE** tab: see **Installation parameters** below.
4. At the bottom of the tab, click **Deploy**.

## Installing manually <a href="#installing-manually" id="installing-manually"></a>

For manual installation or development purposes, SonarQube Server can be configured using the [mpdev CLI tool](https://github.com/GoogleCloudPlatform/marketplace-k8s-app-tools) provided by Google. See Installation parameters below for the supported parameters with key.

## Deleting the installation <a href="#deleting-installation" id="deleting-installation"></a>

To delete the installation of SonarQube Server from your cluster:

1. Delete the created Application resource.
2. Delete the PersistentVolumeClaims related to the search nodes and database (if applicable).

## Installation parameters <a href="#installation-parameters" id="installation-parameters"></a>

| **Name**                                                                           | **Description**                                                                                                                                                                                                                               | **Key**                       | **Type**    |
| ---------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- | ----------- |
| Existing Kubernetes cluster                                                        | Kubernetes cluster in which the application will be deployed.                                                                                                                                                                                 | <p><br></p>                   | <p><br></p> |
| Namespace                                                                          | Target namespace to install Data Center Edition into (The namespace must exist already, it will not be created automatically.).                                                                                                               | namespace                     | string      |
| App instance name                                                                  | Name of the application in your Kubernetes cluster                                                                                                                                                                                            | name                          | string      |
| Application authentication JWT Token                                               | The HS256 key encoded with base64: see **Pre-installation steps** above.                                                                                                                                                                      | ApplicationNode.jwtSecret     | string      |
| Connection to a database - Recommended                                             | If enabled, SonarQube Server will be connected to your PostgreSQL database. The connection parameters **JDBC URL**, **username**, and **password** will be used. Make sure that the **Embedded database** option is disabled.                 | jdbcOverwrite.enable          | boolean     |
| JDBC URL                                                                           | The JDBC URL used to connect to the database.                                                                                                                                                                                                 | jdbcOverwrite.jdbcUrl         | string      |
| JDB Username                                                                       | The username used to connect to the database.                                                                                                                                                                                                 | jdbcOverwrite.jdbcUsername    | string      |
| JDBC Password                                                                      | The password used to connect to the database.                                                                                                                                                                                                 | jdbcOverwrite.jdbcPassword    | string      |
| Application nodes replicas                                                         | The number of replicas for the Application Nodes                                                                                                                                                                                              | ApplicationNodes.replicaCount | integer     |
| Search nodes replicas                                                              | The number of replicas for the Search Nodes                                                                                                                                                                                                   | searchNodes.replicaCount      | integer     |
| Enable initSysctl privileged initContainer to setup elasticearch kernel parameters | This should be disabled and set up by your cluster administrator. Refer to this [documentation](https://github.com/SonarSource/helm-chart-sonarqube/blob/master/charts/sonarqube-dce/README.md#elasticsearch-prerequisites) for more details. | initSysctl.enabled            | boolean     |
| Enable initFs root initContainer to setup filesystem parameters                    | This is generally not required on a Google Kubernetes cluster. Refer to [this documentation](https://github.com/SonarSource/helm-chart-sonarqube/blob/master/charts/sonarqube-dce/README.md#production-use-case) for more details.            | initFs.enabled                | boolean     |
| GCP Marketplace application                                                        | This flag must be enabled in the context of the installation from GCP.                                                                                                                                                                        | gcp\_marketplace              | boolean     |
| Embedded database - For testing purposes only                                      | Not recommended for production: a test PostgreSQL database will be installed.                                                                                                                                                                 | postgresql.enabled            | boolean     |
