Skip to content

Commit

Permalink
Made ingressClassName configurable (#20)
Browse files Browse the repository at this point in the history
* Made ingressClassName configurable

* remove default ingressclassname

* Added customAnnotations configuration variable for ingress

* Added customAnnotations options for all geoweb charts

---------

Co-authored-by: Jussi Liukkonen <[email protected]>
  • Loading branch information
Jusaa and Jussi Liukkonen authored Sep 13, 2023
1 parent 9872c36 commit 5e24ff5
Show file tree
Hide file tree
Showing 20 changed files with 74 additions and 24 deletions.
2 changes: 1 addition & 1 deletion charts/geoweb-cap-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.2.2
version: 1.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
4 changes: 3 additions & 1 deletion charts/geoweb-cap-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ The following table lists the configurable parameters of the CAP backend chart a
| `cap.svcPort` | Port used for service | `80` |
| `cap.containerPort` | Port used for container | `8080` |
| `cap.replicas` | Amount of replicas deployed | `1` |
| `ingress.name` | Name of the ingress controller in use | `nginx-ingress-controller` |
| `ingress.name` | Name of the ingress controller in use | `nginx-ingress-controller` |
| `ingress.ingressClassName` | Set ingressClassName parameter to not use default ingressClass | |
| `ingress.customAnnotations` | Custom annotations for ingress, for example <pre>customAnnotations:<br> traefik.annotation: exampleValue</pre> Overrides default nginx annotations if set | |
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ kind: Ingress
metadata:
name: {{ .Values.ingress.name }}-{{ .Values.cap.name }}
annotations:
{{- if .Values.ingress.customAnnotations }}
{{- with .Values.ingress.customAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- else }}
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-methods: "DELETE, PUT, GET, POST, OPTIONS, PATCH, HEAD"
{{- end }}
spec:
ingressClassName: nginx
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
rules:
- host: {{ .Values.cap.url }}
http:
Expand Down
2 changes: 1 addition & 1 deletion charts/geoweb-cap-backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ cap:
replicas: 1

ingress:
name: nginx-ingress-controller # Sync with nginx-ingress-controller/values.yaml
name: nginx-ingress-controller
4 changes: 2 additions & 2 deletions charts/geoweb-frontend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.2.3
version: 2.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "v6.1.1"
appVersion: "v7.0.0"
6 changes: 4 additions & 2 deletions charts/geoweb-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ The following table lists the configurable parameters of the GeoWeb frontend cha

| Parameter | Description | Default |
| - | - | - |
| `versions.frontend` | Possibility to override application version | `v6.1.1` |
| `versions.frontend` | Possibility to override application version | `v7.0.0` |
| `frontend.name` | Name of frontend | `geoweb` |
| `frontend.registry` | Registry to fetch image | `registry.gitlab.com/opengeoweb/opengeoweb` |
| `frontend.commitHash` | Adds commitHash annotation to the deployment | |
Expand Down Expand Up @@ -163,4 +163,6 @@ The following table lists the configurable parameters of the GeoWeb frontend cha
| `frontend.awsAccessKeySecret` | AWS_SECRET_ACCESS_KEY for authenticating to S3 | |
| `frontend.awsDefaultRegion` | Region where your S3 bucket is located | |
| `ingress.name` | Name of the ingress controller in use | `nginx-ingress-controller` |
| `ingress.rules` | Extra nginx configuration rules, like cache headers | See reference in `values.yaml` |
| `ingress.ingressClassName` | Set ingressClassName parameter to not use default ingressClass | |
| `ingress.rules` | Extra nginx configuration rules, like cache headers | See reference in `values.yaml` |
| `ingress.customAnnotations` | Custom annotations for ingress, for example <pre>customAnnotations:<br> traefik.annotation: exampleValue</pre> Overrides default nginx annotations and `frontend.auth_secret`, `frontend.auth_secretName` and `ingress.rules` can't be used if set | |
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ kind: Ingress
metadata:
name: {{ .Values.ingress.name }}-{{ .Values.frontend.name }}
annotations:
{{- if .Values.ingress.customAnnotations }}
{{- with .Values.ingress.customAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- else }}
{{- if .Values.frontend.auth_secret }}
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: {{ .Values.frontend.auth_secretName }}
Expand All @@ -16,8 +21,11 @@ metadata:
nginx.ingress.kubernetes.io/configuration-snippet: |
{{- .Values.ingress.rules | nindent 6 }}
{{- end }}
{{- end }}
spec:
ingressClassName: nginx
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
rules:
- host: {{ .Values.frontend.url }}
http:
Expand Down
2 changes: 1 addition & 1 deletion charts/geoweb-frontend/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
versions:
frontend: "v6.1.1"
frontend: "v7.0.0"

frontend:
name: geoweb
Expand Down
2 changes: 1 addition & 1 deletion charts/geoweb-opmet-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.2.2
version: 2.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
4 changes: 3 additions & 1 deletion charts/geoweb-opmet-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,6 @@ The following table lists the configurable parameters of the Opmet backend chart
| `opmet.publisher.port` | Port used for publisher | `8090`|
| `opmet.publisher.DESTINATION` | Folder inside publisher container where TACs are stored | `/app/output` |
| `opmet.publisher.volumeOptions` | yaml including the definition of the volume where TACs are published to, for example: <pre>hostPath:<br>&nbsp;&nbsp; path: /test/path</pre> or <pre>emptyDir:<br>&nbsp;&nbsp;</pre>| `emptyDir:` |
| `ingress.name` | Name of the ingress controller in use | `nginx-ingress-controller` |
| `ingress.name` | Name of the ingress controller in use | `nginx-ingress-controller` |
| `ingress.ingressClassName` | Set ingressClassName parameter to not use default ingressClass | |
| `ingress.customAnnotations` | Custom annotations for ingress, for example <pre>customAnnotations:<br> traefik.annotation: exampleValue</pre> Overrides default nginx annotations if set | |
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ kind: Ingress
metadata:
name: {{ .Values.ingress.name }}-{{ .Values.opmet.name }}
annotations:
{{- if .Values.ingress.customAnnotations }}
{{- with .Values.ingress.customAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- else }}
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-methods: "DELETE, PUT, GET, POST, OPTIONS, PATCH, HEAD"
{{- end }}
spec:
ingressClassName: nginx
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
rules:
- host: {{ .Values.opmet.url }}
http:
Expand Down
2 changes: 1 addition & 1 deletion charts/geoweb-opmet-backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ opmet:
OPMET_BACKEND_HOST: localhost:8000

ingress:
name: nginx-ingress-controller # Sync with nginx-ingress-controller/values.yaml
name: nginx-ingress-controller
2 changes: 1 addition & 1 deletion charts/geoweb-presets-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.4.1
version: 2.5.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
4 changes: 3 additions & 1 deletion charts/geoweb-presets-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,6 @@ The following table lists the configurable parameters of the Presets backend cha
| `presets.awsAccessKeyId` | AWS_ACCESS_KEY_ID for authenticating to S3 | |
| `presets.awsAccessKeySecret` | AWS_SECRET_ACCESS_KEY for authenticating to S3 | |
| `presets.awsDefaultRegion` | Region where your S3 bucket is located | |
| `ingress.name` | Name of the ingress controller in use | `nginx-ingress-controller` |
| `ingress.name` | Name of the ingress controller in use | `nginx-ingress-controller` |
| `ingress.ingressClassName` | Set ingressClassName parameter to not use default ingressClass | |
| `ingress.customAnnotations` | Custom annotations for ingress, for example <pre>customAnnotations:<br> traefik.annotation: exampleValue</pre> Overrides default nginx annotations if set | |
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ kind: Ingress
metadata:
name: {{ .Values.ingress.name }}-{{ .Values.presets.name }}
annotations:
{{- if .Values.ingress.customAnnotations }}
{{- with .Values.ingress.customAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- else }}
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-methods: "DELETE, PUT, GET, POST, OPTIONS, PATCH, HEAD"
{{- end }}
spec:
ingressClassName: nginx
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
rules:
- host: {{ .Values.presets.url }}
http:
Expand Down
2 changes: 1 addition & 1 deletion charts/geoweb-presets-backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ presets:
volumeSize: 100Mi

ingress:
name: nginx-ingress-controller # Sync with nginx-ingress-controller/values.yaml
name: nginx-ingress-controller
4 changes: 2 additions & 2 deletions charts/geoweb-warnings-backend/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.0.3"
appVersion: "0.0.4"
6 changes: 4 additions & 2 deletions charts/geoweb-warnings-backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The following table lists the configurable parameters of the Warnings backend ch

| Parameter | Description | Default |
| - | - | - |
| `versions.warnings` | Possibility to override application version | `0.0.3` |
| `versions.warnings` | Possibility to override application version | `0.0.4` |
| `warnings.name` | Name of backend | `warnings` |
| `warnings.registry` | Registry to fetch image | `registry.gitlab.com/opengeoweb/backend-services/warnings-backend` |
| `warnings.commitHash` | Adds commitHash annotation to the deployment | |
Expand All @@ -83,4 +83,6 @@ The following table lists the configurable parameters of the Warnings backend ch
| `warnings.nginx.OAUTH2_USERINFO` | Userinfo endpoint to retrieve consented claims, or assertions, about the logged in end-user | - |
| `warnings.nginx.WARNINGS_BACKEND_HOST` | Address where nginx accesses the backend | `0.0.0.0:8080` |
| `warnings.nginx.NGINX_PORT_HTTP` | Port used for nginx | `80` |
| `ingress.name` | Name of the ingress controller in use | `nginx-ingress-controller` |
| `ingress.name` | Name of the ingress controller in use | `nginx-ingress-controller` |
| `ingress.ingressClassName` | Set ingressClassName parameter to not use default ingressClass | |
| `ingress.customAnnotations` | Custom annotations for ingress, for example <pre>customAnnotations:<br> traefik.annotation: exampleValue</pre> Overrides default nginx annotations if set | |
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,21 @@ kind: Ingress
metadata:
name: {{ .Values.ingress.name }}-{{ .Values.warnings.name }}
annotations:
{{- if .Values.ingress.customAnnotations }}
{{- with .Values.ingress.customAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- else }}
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
nginx.ingress.kubernetes.io/rewrite-target: /$1
nginx.ingress.kubernetes.io/enable-cors: "true"
nginx.ingress.kubernetes.io/cors-allow-methods: "DELETE, PUT, GET, POST, OPTIONS, PATCH, HEAD"
{{- end }}
spec:
ingressClassName: nginx
{{- if .Values.ingress.ingressClassName }}
ingressClassName: {{ .Values.ingress.ingressClassName }}
{{- end }}
rules:
- host: {{ .Values.warnings.url }}
http:
Expand Down
2 changes: 1 addition & 1 deletion charts/geoweb-warnings-backend/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
versions:
warnings: "0.0.3"
warnings: "0.0.4"

warnings:
name: warnings
Expand Down

0 comments on commit 5e24ff5

Please sign in to comment.