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

Update k8s Ingress to v1 and add optional ingressClassName #675

Merged
merged 4 commits into from
Apr 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ In addition to the README's [Harness Upgrade Instructions], please note these sp

## Upgrading from 1.2.x to 1.3.x

### Kubernetes Ingress v1
Cloud Kubernetes providers such as Digitial Ocean will be forcing upgrades of Kubernetes to 1.22 in a few months, and will obsolete, amongst other things, Ingress extensions/v1beta1 and networking.k8s.io/v1beta1 apiVersions.

This release includes an upgrade from networking.k8s.io/v1beta1 to networking.k8s.io/v1 apiVersion of Ingress resources to handle that.

Care is needed to ensure GitOps cluster deploy tools can handle this, which includes ArgoCD needing to be at least version 1.8, due to a bug in applying networking.k8s.io/v1 Ingresses failing.

### MySQL

We are switching back to Docker Inc's official mysql for arm64 computers, as it now supports arm64 on 8.0-oracle tag. This was also done because Oracle's mysql-server repository changed it's image publishing structure to no longer be multi-platform images.
Expand Down
19 changes: 11 additions & 8 deletions src/_base/helm/app/templates/application/webapp/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ if and (index .Values.services .Values.ingress.target_service "enabled") (eq .Values.ingress.type "standard") }}
apiVersion: networking.k8s.io/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
{{- with .Values.ingress.annotations }}
Expand All @@ -13,17 +13,20 @@ metadata:
app.service: {{ .Values.resourcePrefix }}webapp
name: {{ .Values.resourcePrefix }}webapp
spec:
{{- with (pick .Values.ingress "ingressClassName" "tls") }}
{{- . | toYaml | nindent 2 }}
{{- end }}
rules:
- host: {{ index .Values.services "php-base" "environment" "APP_HOST" }}
http:
paths:
- backend:
serviceName: {{ .Values.resourcePrefix }}{{ .Values.ingress.target_service }}
servicePort: 80
{{- if .Values.ingress.tls }}
tls:
{{- toYaml .Values.ingress.tls | nindent 4 }}
{{- end }}
- path: /
pathType: Prefix
backend:
service:
name: {{ .Values.resourcePrefix }}{{ .Values.ingress.target_service }}
port:
number: 80
status:
loadBalancer: {}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ if and (index .Values.services .Values.ingress.target_service "enabled") (eq .Values.ingress.type "standard") }}
apiVersion: networking.k8s.io/v1beta1
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
{{- with .Values.ingress.annotations }}
Expand All @@ -21,8 +21,10 @@ spec:
http:
paths:
- backend:
serviceName: {{ $.Values.resourcePrefix }}{{ $.Values.ingress.target_service }}
servicePort: 80
service:
name: {{ $.Values.resourcePrefix }}{{ $.Values.ingress.target_service }}
port:
number: 80
{{- end }}
{{- end }}
{{- end }}
Expand Down