Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KANSUP74-12 add ingressClass config #163

Merged
merged 7 commits into from
Oct 2, 2024
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
chronology things are added/fixed/changed and - where possible - links to the PRs involved.

### Changes

[v0.8.0]

* **Potentially breaking change**: changed `alfresco-ingress` definition & default values to enable usage of `ingressClassName` property in favour of `kubernetes.io/ingress.class` annotation.

**⚠️ This may particularly impact aws deployments using alb**

[v0.7.5]
* added general.hibernate to set all replicas to 0

Expand Down
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,28 @@ nginx rules to redirect the normal pages to a 503 maintenance page.
* Default: None
* Description: The host that points to the alfresco cluster for the syncService service

#### `ingress.ingressClass`

* Required: false
* Default: `nginx`
* Description: Reference name for the ingressClass to be used.
Replacement for `kubernetes.io/ingress.class` annotation since it's deprecation in k8s 1.18.
Set to `null` to allow usage of `kubernetes.io/ingress.class` in the `ingress.ingressAnnotations` dict.

#### `ingress.ingressAnnotations`

* Required: false
* Default:
```
kubernetes.io/ingress.class: "nginx"
kubernetes.io/ingress.class: "nginx"
cert-manager.io/cluster-issuer: "letsencrypt-production"
```
* Description: Annotations for ingress
* Description: Annotations for ingress.
* Remarks:
* The default value of `kubernetes.io/ingress.class: "nginx"` will be filtered
out if the `ingress.ingressClass` is set (This includes the default value).
The `kubernetes.io/ingress.class` is deprecated since k8s v1.18, but some setups still rely on it.
Hence it can still be set and used if `ingress.ingressClass` is set to `null`.

#### `ingress.additionalPaths`

Expand Down
2 changes: 2 additions & 0 deletions local-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ ingress:
host: test
protocol: http
kubernetes.io/ingress.class: {}
# enabling the line below will cause the ingress.class annotation to be rendered instead of the ingressClass property
# ingressClass: null
acs:
resources:
requests:
Expand Down
17 changes: 15 additions & 2 deletions xenit-alfresco/templates/ingress/alfresco-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,23 @@ metadata:
name: alfresco-ingress
namespace: {{ .Release.Namespace | quote }}
annotations:
{{- if .Values.ingress.ingressAnnotations}}
{{ toYaml .Values.ingress.ingressAnnotations | nindent 4 }}
{{- if .Values.ingress.ingressAnnotations }}
{{- /*
See https://kubernetes.io/docs/concepts/services-networking/ingress/#deprecated-annotation
Remove kubernetes.io/ingress.class annotation if ingressClass is set
ingressClass can be removed from defaults by setting ingressClass: null in values override
Tied to spec.ingressClassName
*/ -}}
{{- range $key, $value := .Values.ingress.ingressAnnotations }}
{{- if not ( and ($.Values.ingress.ingressClass) (eq $key "kubernetes.io/ingress.class")) }}
{{ $key }}: {{ $value }}
{{- end }}
{{- end }}
{{- end }}
spec:
{{- if .Values.ingress.ingressClass }}
ingressClassName: {{ .Values.ingress.ingressClass }}
{{- end }}
{{- if eq .Values.ingress.protocol "https" }}
tls:
- hosts:
Expand Down
1 change: 1 addition & 0 deletions xenit-alfresco/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ general:
selfManaged: false

ingress:
ingressClass: "nginx"
protocol: 'https'
ingressAnnotations:
kubernetes.io/ingress.class: "nginx"
Expand Down
Loading