From 191095948c96f7b83d37e21c8500d3f284c87cb9 Mon Sep 17 00:00:00 2001 From: justusbunsi Date: Fri, 17 Jun 2022 13:28:15 +0200 Subject: [PATCH] Allow changing port in Helm Chart Signed-off-by: Steven Kriegler --- CHANGELOG.md | 4 ++++ helm/Chart.yaml | 2 +- helm/README.md | 27 ++++++++++++++------------- helm/templates/deployment.yaml | 6 ++++-- helm/values.yaml | 3 +++ 5 files changed, 26 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7224e70..d33dfda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ - Add `GITEA_SQ_BOT_PORT` environment variable +### ☸️ Helm Chart + +- Add `.Values.app.listeningPort` parameter + ## v0.2.0 ### 🤖 Application diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 13162e1..6061391 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: gitea-sonarqube-bot description: A Helm Chart for running a bot to communicate between both Gitea and SonarQube type: application -version: 0.2.0 +version: 0.2.1 appVersion: "v0.2.0" home: https://codeberg.org/justusbunsi/gitea-sonarqube-bot/ maintainers: diff --git a/helm/README.md b/helm/README.md index 20ba017..a7cb6cf 100644 --- a/helm/README.md +++ b/helm/README.md @@ -53,19 +53,20 @@ You can find a full changelog in the [main repository](https://codeberg.org/just ### App parameters -| Name | Description | Value | -| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | -| `app.configLocationOverride` | Override the default location of the configuration file (`/home/bot/config/config.yaml`). **Available since Chart version `0.2.0`. Requires at least image tag `v0.2.0`**. (See values file for details) | `""` | -| `app.configuration.gitea.url` | Endpoint of your Gitea instance. Must be expandable by '/api/v1' to form the API base path as shown in Swagger UI. | `""` | -| `app.configuration.gitea.token.value` | Gitea token as plain text. Can be replaced with `file` key containing path to file. | `""` | -| `app.configuration.sonarqube.url` | Endpoint of your SonarQube instance. Must be expandable by '/api' to form the API base path. | `""` | -| `app.configuration.sonarqube.token.value` | SonarQube token as plain text. Can be replaced with `file` key containing path to file. | `""` | -| `app.configuration.sonarqube.additionalMetrics` | Setting this option you can extend that default list by your own metrics. | `[]` | -| `app.configuration.projects[0].sonarqube.key` | Project key inside SonarQube | `""` | -| `app.configuration.projects[0].gitea.owner` | Repository owner inside Gitea | `""` | -| `app.configuration.projects[0].gitea.name` | Repository name inside Gitea | `""` | -| `volumes` | If token and webhook secrets shall be provided via file, volumes and volume mounts can be configured to setup the environment accordingly | `[]` | -| `volumeMounts` | If token and webhook secrets shall be provided via file, volumes and volume mounts can be configured to setup the environment accordingly | `[]` | +| Name | Description | Value | +| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | +| `app.configLocationOverride` | Override the default location of the configuration file (`/home/bot/config/config.yaml`). **Available since Chart version `0.2.0`. Requires at least image tag `v0.2.0`**. (See values file for details) | `""` | +| `app.listeningPort` | Port the application will listening on inside the pod container. **Available since Chart version `0.2.1`. Requires at least image tag `v0.2.1`**. | `3000` | +| `app.configuration.gitea.url` | Endpoint of your Gitea instance. Must be expandable by '/api/v1' to form the API base path as shown in Swagger UI. | `""` | +| `app.configuration.gitea.token.value` | Gitea token as plain text. Can be replaced with `file` key containing path to file. | `""` | +| `app.configuration.sonarqube.url` | Endpoint of your SonarQube instance. Must be expandable by '/api' to form the API base path. | `""` | +| `app.configuration.sonarqube.token.value` | SonarQube token as plain text. Can be replaced with `file` key containing path to file. | `""` | +| `app.configuration.sonarqube.additionalMetrics` | Setting this option you can extend that default list by your own metrics. | `[]` | +| `app.configuration.projects[0].sonarqube.key` | Project key inside SonarQube | `""` | +| `app.configuration.projects[0].gitea.owner` | Repository owner inside Gitea | `""` | +| `app.configuration.projects[0].gitea.name` | Repository name inside Gitea | `""` | +| `volumes` | If token and webhook secrets shall be provided via file, volumes and volume mounts can be configured to setup the environment accordingly | `[]` | +| `volumeMounts` | If token and webhook secrets shall be provided via file, volumes and volume mounts can be configured to setup the environment accordingly | `[]` | ### Security parameters diff --git a/helm/templates/deployment.yaml b/helm/templates/deployment.yaml index 481b9d3..b5b84c4 100644 --- a/helm/templates/deployment.yaml +++ b/helm/templates/deployment.yaml @@ -31,14 +31,16 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if .Values.app.configLocationOverride }} env: + {{- if .Values.app.configLocationOverride }} - name: GITEA_SQ_BOT_CONFIG_PATH value: "{{ .Values.app.configLocationOverride }}" {{- end}} + - name: GITEA_SQ_BOT_PORT + value: "{{ .Values.app.listeningPort }}" ports: - name: http - containerPort: 3000 + containerPort: {{ .Values.app.listeningPort }} protocol: TCP livenessProbe: httpGet: diff --git a/helm/values.yaml b/helm/values.yaml index 377758b..d42d99e 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -57,6 +57,9 @@ app: # Setting this will also change the mount point for `.Values.app.configuration` to the directory part of the override value. configLocationOverride: "" + # @param app.listeningPort Port the application will listening on inside the pod container. **Available since Chart version `0.2.1`. Requires at least image tag `v0.2.1`**. + listeningPort: 3000 + # This object represents the [config.yaml](https://codeberg.org/justusbunsi/gitea-sonarqube-bot/src/branch/main/config/config.example.yaml) provided to the application. configuration: # Gitea related configuration. Necessary for adding/updating comments on repository pull requests