A Helm chart for KubeRocketCI Sonar Operator
Homepage: https://docs.kuberocketci.io/
Sonar Operator is a KubeRocketCI operator that is responsible for configuring SonarQube.
NOTE: Operator is platform-independent, that is why there is a unified instruction for deploying.
- Linux machine or Windows Subsystem for Linux instance with Helm 3 installed;
- Cluster admin access to the cluster;
In order to install the KubeRocketCI Sonar Operator, follow the steps below:
-
To add the Helm EPAMEDP Charts for local client, run "helm repo add":
helm repo add epamedp https://epam.github.io/edp-helm-charts/stable
-
Choose available Helm chart version:
helm search repo epamedp/sonar-operator -l NAME CHART VERSION APP VERSION DESCRIPTION epamedp/sonar-operator 3.1.1 3.1.1 A Helm chart for KubeRocketCI Sonar Operator
NOTE: It is highly recommended to use the latest released version.
-
Deploy operator:
Full available chart parameters available in deploy-templates/README.md:
-
Install operator in the arbitrary (
sonar-operator
) namespace with the helm command; find below the installation command example:helm install sonar-operator epamedp/sonar-operator --version <chart_version> --namespace sonar
-
Check the
sonar
namespace that should contain operator deployment with your operator in a running status.
-
Login into Sonarqube and create user. Attach permissions to user such as quality gates, profiles, user managment etc. Insert user credentials into Kubernetes secret.
apiVersion: v1 kind: Secret metadata: name: sonar-access type: Opaque data: username: dXNlcg== # base64-encoded value of "user" password: cGFzcw== # base64-encoded value of "pass"
-
Create Custom Resource
kind: Sonar
with Sonar instance URL and secret created on the previous step:apiVersion: edp.epam.com/v1alpha1 kind: Sonar metadata: name: sonar-sample spec: url: https://sonar.example.com # Sonar URL secret: sonar-access # Secret name
Wait for the
.status
field withstatus.connected: true
-
Create Quality Gate using Custom Resources SonarQualityGate:
apiVersion: edp.epam.com/v1alpha1 kind: SonarQualityGate metadata: name: qualityGate-sample spec: sonarRef: name: sonar-sample # the name of `kind: Sonar` name: qualityGate-sample default: true conditions: new_coverage: op: LT error: "80"
apiVersion: edp.epam.com/v1alpha1 kind: SonarQualityProfile metadata: name: qualityProfile-sample spec: sonarRef: name: sonar-sample # the name of `kind: Sonar` name: qualityProfile-sample language: java default: true rules: checkstyle:com.puppycrawl.tools.checkstyle.checks.OuterTypeFilenameCheck: severity: 'MAJOR'
Inspect CR templates folder for more examples
In order to develop the operator, first set up a local environment. For details, please refer to the Local Development page.
Development versions are also available, please refer to the snapshot helm chart repository page.
Name | Url | |
---|---|---|
epmd-edp | SupportEPMD-EDP@epam.com | https://solutionshub.epam.com/solution/kuberocketci |
sergk | https://github.com/SergK |
Key | Type | Default | Description |
---|---|---|---|
affinity | object | {} |
|
annotations | object | {} |
|
extraVolumeMounts | list | [] |
Additional volumeMounts to be added to the container |
extraVolumes | list | [] |
Additional volumes to be added to the pod |
image.repository | string | "epamedp/sonar-operator" |
KubeRocketCI sonar-operator Docker image name. The released image can be found on Dockerhub |
image.tag | string | nil |
KubeRocketCI sonar-operator Docker image tag. The released image can be found on Dockerhub |
imagePullPolicy | string | "IfNotPresent" |
|
name | string | "sonar-operator" |
component name |
nodeSelector | object | {} |
|
resources.limits.memory | string | "192Mi" |
|
resources.requests.cpu | string | "50m" |
|
resources.requests.memory | string | "64Mi" |
|
tolerations | list | [] |