Skip to content

Commit

Permalink
sonar 23603 trigger 570 http route using gateway from other namespace
Browse files Browse the repository at this point in the history
* feat(httproute): support gateway in different namespace

* SONAR-23603 trigger 570 http route using gateway from other namespace

---------

Co-authored-by: Alyson Ferreira <alyson_ferreira@trimble.com>
  • Loading branch information
jCOTINEAU and alyson-ferreira-trimble authored Nov 15, 2024
1 parent 39dab7b commit 81153a3
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 18 deletions.
1 change: 1 addition & 0 deletions charts/sonarqube-dce/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ All changes to this chart will be documented in this file.
* Support Kubernetes v1.31
* Update the Chart's icon with the SonarQube Server logo
* Fix ENV variables not fetched when using extraConfig.configmaps
* Support Gateway on different namespace in HTTPRoute

## [10.7.0]
* Update Chart's version to 10.7.0
Expand Down
2 changes: 2 additions & 0 deletions charts/sonarqube-dce/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ annotations:
description: "Update the Chart's icon with the SonarQube Server logo"
- kind: fixed
description: "Fix ENV variables not fetched when using extraConfig.configmaps"
- kind: added
description: "Support Gateway on different namespace in HTTPRoute"
artifacthub.io/links: |
- name: support
url: https://community.sonarsource.com/
Expand Down
15 changes: 8 additions & 7 deletions charts/sonarqube-dce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,14 @@ The following table lists the configurable parameters of the SonarQube chart and
### HttpRoute
| Parameter | Description | Default |
| --------------------- | ------------------------------------------------------------------------------------------------------------- | ------- |
| `httproute.enabled` | Flag to enable GatewayAPI HttpRoute | `False` |
| `httproute.gateway` | Name of the gateway located in the same namespace | `None` |
| `httproute.hostnames` | List of hostnames to match the HttpRoute against | `None` |
| `httproute.labels` | (Optional) List of extra labels to add to the HttpRoute | `None` |
| `httproute.rules` | (Optional) Extra Rules block of the HttpRoute. A default one is created with SonarWebContext and service port | `None` |
| Parameter | Description | Default |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------- | ------- |
| `httproute.enabled` | Flag to enable GatewayAPI HttpRoute | `False` |
| `httproute.gateway` | Name of the gateway | `None` |
| `httproute.gatewayNamespace` | (Optional) Name of the gateway namespace when located in a different namespace | `None` |
| `httproute.hostnames` | List of hostnames to match the HttpRoute against | `None` |
| `httproute.labels` | (Optional) List of extra labels to add to the HttpRoute | `None` |
| `httproute.rules` | (Optional) Extra Rules block of the HttpRoute. A default one is created with SonarWebContext and service port | `None` |
### Elasticsearch
Expand Down
5 changes: 4 additions & 1 deletion charts/sonarqube-dce/templates/http-route.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ metadata:
spec:
parentRefs:
- name: {{ .Values.httproute.gateway }}
{{- if .Values.httproute.gatewayNamespace }}
namespace: {{ .Values.httproute.gatewayNamespace }}
{{- end }}
hostnames:
{{- with .Values.httproute.hostnames }}
{{ toYaml . }}
Expand All @@ -32,4 +35,4 @@ spec:
- name: {{ include "sonarqube.fullname" . }}
port: {{ .Values.service.externalPort }}
{{- end }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/sonarqube-dce/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ ingress-nginx:
httproute:
enabled: false
# gateway: my-gateway
# gatewayNamespace: my-gateway-namespace # optional
# labels:
# somelabel: somevalue
# hostnames:
Expand Down
1 change: 1 addition & 0 deletions charts/sonarqube/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ All changes to this chart will be documented in this file.
* Deprecate the default value of `image.tag` in favor of an empty string
* Update the Chart's icon with the SonarQube Server logo
* Set `app.kubernetes.io/name` and `app.kubernetes.io/version` as selector labels
* Support Gateway on different namespace in HTTPRoute

## [10.7.0]
* Update Chart's version to 10.7.0
Expand Down
2 changes: 2 additions & 0 deletions charts/sonarqube/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ annotations:
description: "Update the Chart's icon with the SonarQube Server logo"
- kind: fixed
description: "Set 'app.kubernetes.io/name' and 'app.kubernetes.io/version' as selector labels"
- kind: added
description: "Support Gateway on different namespace in HTTPRoute"
artifacthub.io/containsSecurityUpdates: "false"
artifacthub.io/images: |
- name: sonarqube
Expand Down
15 changes: 8 additions & 7 deletions charts/sonarqube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,13 +333,14 @@ The following table lists the configurable parameters of the SonarQube chart and

### HttpRoute

| Parameter | Description | Default |
| --------------------- | ------------------------------------------------------------------------------------------------------------- | ------- |
| `httproute.enabled` | Flag to enable GatewayAPI HttpRoute | `False` |
| `httproute.gateway` | Name of the gateway located in the same namespace | `None` |
| `httproute.hostnames` | List of hostnames to match the HttpRoute against | `None` |
| `httproute.labels` | (Optional) List of extra labels to add to the HttpRoute | `None` |
| `httproute.rules` | (Optional) Extra Rules block of the HttpRoute. A default one is created with SonarWebContext and service port | `None` |
| Parameter | Description | Default |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------- | ------- |
| `httproute.enabled` | Flag to enable GatewayAPI HttpRoute | `False` |
| `httproute.gateway` | Name of the gateway | `None` |
| `httproute.gatewayNamespace` | (Optional) Name of the gateway namespace when located in a different namespace | `None` |
| `httproute.hostnames` | List of hostnames to match the HttpRoute against | `None` |
| `httproute.labels` | (Optional) List of extra labels to add to the HttpRoute | `None` |
| `httproute.rules` | (Optional) Extra Rules block of the HttpRoute. A default one is created with SonarWebContext and service port | `None` |

### Probes

Expand Down
5 changes: 4 additions & 1 deletion charts/sonarqube/templates/http-route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ metadata:
spec:
parentRefs:
- name: {{ .Values.httproute.gateway }}
{{- if .Values.httproute.gatewayNamespace }}
namespace: {{ .Values.httproute.gatewayNamespace }}
{{- end }}
hostnames:
{{- with .Values.httproute.hostnames }}
{{ toYaml . }}
Expand All @@ -29,4 +32,4 @@ spec:
- name: {{ include "sonarqube.fullname" . }}
port: {{ .Values.service.externalPort }}
{{- end }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/sonarqube/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ ingress-nginx:
httproute:
enabled: false
# gateway: my-gateway
# gatewayNamespace: my-gateway-namespace # optional
# labels:
# somelabel: somevalue
# hostnames:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,7 @@ metadata:
spec:
parentRefs:
- name: my-gateway
namespace: my-gateway-namespace
hostnames:
- sonarqube.your-org.com
rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ metadata:
spec:
parentRefs:
- name: my-gateway
namespace: my-gateway-namespace
hostnames:
- sonarqube.your-org.com
rules:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
httproute:
enabled: true
gateway: my-gateway
gatewayNamespace: my-gateway-namespace
hostnames:
- sonarqube.your-org.com
rules:
Expand All @@ -10,4 +11,4 @@ httproute:
value: /
backendRefs:
- name: http-routes-default-values.yaml-sonarqube
port: 9000
port: 9000
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
httproute:
enabled: true
gateway: my-gateway
gatewayNamespace: my-gateway-namespace
hostnames:
- sonarqube.your-org.com
rules:
Expand All @@ -10,4 +11,4 @@ httproute:
value: /
backendRefs:
- name: http-routes-default-values.yaml-sonarqube
port: 9000
port: 9000

0 comments on commit 81153a3

Please sign in to comment.