Skip to content

Commit

Permalink
SONAR-23665 change ingress class name default logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jCOTINEAU authored Nov 20, 2024
1 parent e510db5 commit e6e40ff
Show file tree
Hide file tree
Showing 16 changed files with 3,187 additions and 2 deletions.
1 change: 1 addition & 0 deletions charts/sonarqube-dce/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All changes to this chart will be documented in this file.
* 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
* Change `ingress.ingressClassName` default, set it to `nginx` if `nginx.enabled` or `ingress-nginx.enabled`

## [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 @@ -39,6 +39,8 @@ annotations:
description: "Fix ENV variables not fetched when using extraConfig.configmaps"
- kind: added
description: "Support Gateway on different namespace in HTTPRoute"
- kind: changed
description: "Change `ingress.ingressClassName` default, set it to `nginx` if `nginx.enabled` or `ingress-nginx.enabled`"
artifacthub.io/links: |
- name: support
url: https://community.sonarsource.com/
Expand Down
2 changes: 1 addition & 1 deletion charts/sonarqube-dce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ The following table lists the configurable parameters of the SonarQube chart and
| `ingress.hosts[0].serviceName` | Optional field to override the default serviceName of a path | `None` |
| `ingress.hosts[0].servicePort` | Optional field to override the default servicePort of a path | `None` |
| `ingress.tls` | Ingress secrets for TLS certificates | `[]` |
| `ingress.ingressClassName` | Optional field to configure ingress class name | `None` |
| `ingress.ingressClassName` | Optional field to configure ingress class name | `None` OR `nginx` if `nginx.enabled` or `ingress-nginx.enabled` |
| `ingress.annotations` | Field to add extra annotations to the ingress | {`nginx.ingress.kubernetes.io/proxy-body-size: "64m"`} if `ingress-nginx.enabled=true or nginx.enabled=true` |
### InitContainers
Expand Down
2 changes: 2 additions & 0 deletions charts/sonarqube-dce/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ metadata:
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- else if or (.Values.nginx).enabled (index .Values "ingress-nginx" "enabled") }}
ingressClassName: "nginx"
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
Expand Down
1 change: 1 addition & 0 deletions charts/sonarqube/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All changes to this chart will be documented in this file.
* 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
* Change `ingress.ingressClassName` default, set it to `nginx` if `nginx.enabled` or `ingress-nginx.enabled`

## [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 @@ -50,6 +50,8 @@ annotations:
description: "Set 'app.kubernetes.io/name' and 'app.kubernetes.io/version' as selector labels"
- kind: added
description: "Support Gateway on different namespace in HTTPRoute"
- kind: changed
description: "Change `ingress.ingressClassName` default, set it to `nginx` if `nginx.enabled` or `ingress-nginx.enabled`"
artifacthub.io/containsSecurityUpdates: "false"
artifacthub.io/images: |
- name: sonarqube
Expand Down
2 changes: 1 addition & 1 deletion charts/sonarqube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ The following table lists the configurable parameters of the SonarQube chart and
| `ingress.hosts[0].serviceName` | Optional field to override the default serviceName of a path | `None` |
| `ingress.hosts[0].servicePort` | Optional field to override the default servicePort of a path | `None` |
| `ingress.tls` | Ingress secrets for TLS certificates | `[]` |
| `ingress.ingressClassName` | Optional field to configure ingress class name | `None` |
| `ingress.ingressClassName` | Optional field to configure ingress class name | `None` OR `nginx` if `nginx.enabled` or `ingress-nginx.enabled` |
| `ingress.annotations` | Field to add extra annotations to the ingress | {`nginx.ingress.kubernetes.io/proxy-body-size: "64m"`} if `ingress-nginx.enabled=true or nginx.enabled=true` |

### HttpRoute
Expand Down
2 changes: 2 additions & 0 deletions charts/sonarqube/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ metadata:
spec:
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- else if or (.Values.nginx).enabled (index .Values "ingress-nginx" "enabled") }}
ingressClassName: "nginx"
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,7 @@ metadata:
kubernetes.io/tls-acme: "true"
nginx.ingress.kubernetes.io/proxy-body-size: "8m"
spec:
ingressClassName: user-based
rules:
- host: sonarqube.your-org.com
http:
Expand Down
Loading

0 comments on commit e6e40ff

Please sign in to comment.