Skip to content

Commit

Permalink
docs: Add the Quick Start section to the README (#16)
Browse files Browse the repository at this point in the history
Jira EPMDEDP-13411
Related #16

Change-Id: I3d04504d521fc6507cdfb869fba297938909b68e
  • Loading branch information
Mykola Serdiuk committed Mar 28, 2024
1 parent 80b5e55 commit b1b7333
Show file tree
Hide file tree
Showing 3 changed files with 260 additions and 8 deletions.
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ _**NOTE:** Operator is platform-independent, that is why there is a unified inst

1. Linux machine or Windows Subsystem for Linux instance with [Helm 3](https://helm.sh/docs/intro/install/) installed;
2. Cluster admin access to the cluster;
3. EDP project/namespace is deployed by following the [Install EDP](https://epam.github.io/edp-install/operator-guide/install-edp/) instruction.

## Installation

Expand All @@ -34,8 +33,8 @@ In order to install the EDP Sonar Operator, follow the steps below:
```bash
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 EDP Sonar Operator
epamedp/sonar-operator 3.1.0 3.1.0 A Helm chart for EDP Sonar Operator
epamedp/sonar-operator 3.0.0 3.0.0 A Helm chart for EDP Sonar Operator
```

_**NOTE:** It is highly recommended to use the latest released version._
Expand All @@ -47,14 +46,14 @@ In order to install the EDP Sonar Operator, follow the steps below:
4. Install operator in the arbitrary (`sonar-operator`) namespace with the helm command; find below the installation command example:

```bash
helm install sonar-operator epamedp/sonar-operator --version <chart_version> --namespace sonar-operator
helm install sonar-operator epamedp/sonar-operator --version <chart_version> --namespace sonar
```

5. Check the `sonar-operator` namespace that should contain operator deployment with your operator in a running status.
5. Check the `sonar` namespace that should contain operator deployment with your operator in a running status.

## Quick Start

1. Insert newly created user credentials into Kubernetes secret:
1. Login into Sonarqube and create user. Attach permissions to user such as quality gates, profiles, user managment etc. Insert user credentials into Kubernetes secret.

```yaml
apiVersion: v1
Expand All @@ -75,8 +74,8 @@ In order to install the EDP Sonar Operator, follow the steps below:
metadata:
name: sonar-sample
spec:
url: https://sonar.example.com/ # Sonar URL
secret: sonar-access # Secret name
url: https://sonar.example.com # Sonar URL
secret: sonar-access # Secret name
```

Wait for the `.status` field with `status.connected: true`
Expand Down
120 changes: 119 additions & 1 deletion deploy-templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,125 @@ A Helm chart for EDP Sonar Operator

**Homepage:** <https://epam.github.io/edp-install/>

## Overview

Sonar Operator is an EDP operator that is responsible for configuring SonarQube.

_**NOTE:** Operator is platform-independent, that is why there is a unified instruction for deploying._

## Prerequisites

1. Linux machine or Windows Subsystem for Linux instance with [Helm 3](https://helm.sh/docs/intro/install/) installed;
2. Cluster admin access to the cluster;

## Installation

In order to install the EDP Sonar Operator, follow the steps below:

1. To add the Helm EPAMEDP Charts for local client, run "helm repo add":

```bash
helm repo add epamedp https://epam.github.io/edp-helm-charts/stable
```

2. Choose available Helm chart version:

```bash
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 EDP Sonar Operator
epamedp/sonar-operator 3.1.0 3.1.0 A Helm chart for EDP Sonar Operator
```

_**NOTE:** It is highly recommended to use the latest released version._

3. Deploy operator:

Full available chart parameters available in [deploy-templates/README.md](deploy-templates/README.md):

4. Install operator in the arbitrary (`sonar-operator`) namespace with the helm command; find below the installation command example:

```bash
helm install sonar-operator epamedp/sonar-operator --version <chart_version> --namespace sonar
```

5. Check the `sonar` namespace that should contain operator deployment with your operator in a running status.

## Quick Start

1. Login into Sonarqube and create user. Attach permissions to user such as quality gates, profiles, user managment etc. Insert user credentials into Kubernetes secret.

```yaml
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"
```

2. Create Custom Resource `kind: Sonar` with Sonar instance URL and secret created on the previous step:

```yaml
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 with `status.connected: true`

4. Create Quality Gate using Custom Resources SonarQualityGate:

```yaml
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"
```

```yaml
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](./deploy-templates/_crd_examples/) for more examples

## Local Development

In order to develop the operator, first set up a local environment. For details, please refer to the [Local Development](https://epam.github.io/edp-install/developer-guide/local-development/) page.

Development versions are also available, please refer to the [snapshot helm chart repository](https://epam.github.io/edp-helm-charts/snapshot/) page.

### Related Articles

- [Install EDP](https://epam.github.io/edp-install/operator-guide/install-edp/)

## Maintainers

| Name | Email | Url |
Expand Down Expand Up @@ -34,4 +153,3 @@ A Helm chart for EDP Sonar Operator
| resources.requests.cpu | string | `"50m"` | |
| resources.requests.memory | string | `"64Mi"` | |
| tolerations | list | `[]` | |

135 changes: 135 additions & 0 deletions deploy-templates/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{{ template "chart.header" . }}
{{ template "chart.deprecationWarning" . }}

{{ template "chart.badgesSection" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

## Overview

Sonar Operator is an EDP operator that is responsible for configuring SonarQube.

_**NOTE:** Operator is platform-independent, that is why there is a unified instruction for deploying._

## Prerequisites

1. Linux machine or Windows Subsystem for Linux instance with [Helm 3](https://helm.sh/docs/intro/install/) installed;
2. Cluster admin access to the cluster;

## Installation

In order to install the EDP Sonar Operator, follow the steps below:

1. To add the Helm EPAMEDP Charts for local client, run "helm repo add":

```bash
helm repo add epamedp https://epam.github.io/edp-helm-charts/stable
```

2. Choose available Helm chart version:

```bash
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 EDP Sonar Operator
epamedp/sonar-operator 3.1.0 3.1.0 A Helm chart for EDP Sonar Operator
```

_**NOTE:** It is highly recommended to use the latest released version._

3. Deploy operator:

Full available chart parameters available in [deploy-templates/README.md](deploy-templates/README.md):

4. Install operator in the arbitrary (`sonar-operator`) namespace with the helm command; find below the installation command example:

```bash
helm install sonar-operator epamedp/sonar-operator --version <chart_version> --namespace sonar
```

5. Check the `sonar` namespace that should contain operator deployment with your operator in a running status.

## Quick Start

1. Login into Sonarqube and create user. Attach permissions to user such as quality gates, profiles, user managment etc. Insert user credentials into Kubernetes secret.

```yaml
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"
```

2. Create Custom Resource `kind: Sonar` with Sonar instance URL and secret created on the previous step:

```yaml
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 with `status.connected: true`

4. Create Quality Gate using Custom Resources SonarQualityGate:

```yaml
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"
```

```yaml
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](./deploy-templates/_crd_examples/) for more examples

## Local Development

In order to develop the operator, first set up a local environment. For details, please refer to the [Local Development](https://epam.github.io/edp-install/developer-guide/local-development/) page.

Development versions are also available, please refer to the [snapshot helm chart repository](https://epam.github.io/edp-helm-charts/snapshot/) page.

### Related Articles

- [Install EDP](https://epam.github.io/edp-install/operator-guide/install-edp/)

{{ template "chart.maintainersSection" . }}

{{ template "chart.sourcesSection" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}

0 comments on commit b1b7333

Please sign in to comment.