Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #254 from YpNo/feature/gcp_inggress_default_backend
Browse files Browse the repository at this point in the history
Add a default backend for GCE ingress controller
  • Loading branch information
rjkernick authored Feb 10, 2021
2 parents c205d6e + 40776d6 commit a77ff0c
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 2 deletions.
3 changes: 3 additions & 0 deletions charts/sonarqube/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# SonarQube Chart Changelog
All changes to this chart will be documented in this file.

## [9.5.0]
* Add Ingress default backend for GCE class

## [9.2.3]
* Added namespace to port-foward command in notes.

Expand Down
2 changes: 1 addition & 1 deletion charts/sonarqube/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: sonarqube
description: SonarQube is an open sourced code quality scanning tool
version: 9.4.1
version: 9.5.0
appVersion: 8.5.1-community
keywords:
- coverage
Expand Down
22 changes: 21 additions & 1 deletion charts/sonarqube/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,30 @@ kindly-newt 1 Mon Oct 2 15:05:44 2017 DEPLOYED sonarqube-0.1.0
$ helm delete kindly-newt
```

## Ingress Paths
## Ingress

### Path
Some cloud may need the path to be /* instead of /. Try this first if you are having issues getting traffic through the ingress.

### Default Backend

if you use GCP as a cloud provider you need to set a default backend to avoid useless default backend created by the gce controller. To add this default backend you must set "ingress.class" annotation with "gce" or "gce-internal" value.

Example:

```yaml
...
ingress:
enabled: true
hosts:
- name: sonarqube.example.com
path: "/*"
annotations:
kubernetes.io/ingress.class: "gce-internal"
kubernetes.io/ingress.allow-http: "false"
...
```

## Configuration

The following table lists the configurable parameters of the Sonarqube chart and their default values.
Expand Down
9 changes: 9 additions & 0 deletions charts/sonarqube/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ metadata:
{{- end }}
{{- end }}
spec:
{{- if .Values.ingress.annotations }}
{{- range $key, $value := .Values.ingress.annotations }}
{{- if and (eq $key "kubernetes.io/ingress.class") (contains $value "gce") }}
backend:
serviceName: {{ default $serviceName .serviceName }}
servicePort: {{ default $servicePort .servicePort }}
{{- end }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .name }}
Expand Down

0 comments on commit a77ff0c

Please sign in to comment.