feat(helm): add support for networking.k8s.io/v1

This commit is contained in:
Alexander Babel 2021-09-07 15:10:28 +02:00 committed by Rory Z
parent a6e335e715
commit ef0bdf641a
4 changed files with 34 additions and 2 deletions

View File

@ -14,7 +14,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes # 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. # to the chart and its templates, including the app version.
version: 4.3.0 version: 4.4.0
# This is the version number of the application being deployed. This version number should be # This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. # incremented each time you make changes to the application.

View File

@ -66,11 +66,13 @@ The following table lists the configurable parameters of the emqx chart and thei
| `service.externalIPs` | ExternalIPs for the service | [] | | `service.externalIPs` | ExternalIPs for the service | [] |
| `service.annotations` | Service annotations | {}(evaluated as a template)| | `service.annotations` | Service annotations | {}(evaluated as a template)|
| `ingress.dashboard.enabled` | Enable ingress for EMQX Dashboard | false | | `ingress.dashboard.enabled` | Enable ingress for EMQX Dashboard | false |
| `ingress.dashboard.ingressClassName` | Set the ingress class for EMQX Dashboard | |
| `ingress.dashboard.path` | Ingress path for EMQX Dashboard | / | | `ingress.dashboard.path` | Ingress path for EMQX Dashboard | / |
| `ingress.dashboard.hosts` | Ingress hosts for EMQX Mgmt API | dashboard.emqx.local | | `ingress.dashboard.hosts` | Ingress hosts for EMQX Mgmt API | dashboard.emqx.local |
| `ingress.dashboard.tls` | Ingress tls for EMQX Mgmt API | [] | | `ingress.dashboard.tls` | Ingress tls for EMQX Mgmt API | [] |
| `ingress.dashboard.annotations` | Ingress annotations for EMQX Mgmt API | {} | | `ingress.dashboard.annotations` | Ingress annotations for EMQX Mgmt API | {} |
| `ingress.mgmt.enabled` | Enable ingress for EMQX Mgmt API | false | | `ingress.mgmt.enabled` | Enable ingress for EMQX Mgmt API | false |
| `ingress.dashboard.ingressClassName` | Set the ingress class for EMQX Mgmt API | |
| `ingress.mgmt.path` | Ingress path for EMQX Mgmt API | / | | `ingress.mgmt.path` | Ingress path for EMQX Mgmt API | / |
| `ingress.mgmt.hosts` | Ingress hosts for EMQX Mgmt API | api.emqx.local | | `ingress.mgmt.hosts` | Ingress hosts for EMQX Mgmt API | api.emqx.local |
| `ingress.mgmt.tls` | Ingress tls for EMQX Mgmt API | [] | | `ingress.mgmt.tls` | Ingress tls for EMQX Mgmt API | [] |

View File

@ -1,5 +1,7 @@
{{- if .Values.ingress.dashboard.enabled -}} {{- if .Values.ingress.dashboard.enabled -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1beta1
{{- else -}} {{- else -}}
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
@ -17,15 +19,28 @@ metadata:
{{- toYaml .Values.ingress.dashboard.annotations | nindent 4 }} {{- toYaml .Values.ingress.dashboard.annotations | nindent 4 }}
{{- end }} {{- end }}
spec: spec:
{{- if and .Values.ingress.dashboard.ingressClassName (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.dashboard.ingressClassName }}
{{- end }}
rules: rules:
{{- range $host := .Values.ingress.dashboard.hosts }} {{- range $host := .Values.ingress.dashboard.hosts }}
- host: {{ $host }} - host: {{ $host }}
http: http:
paths: paths:
- path: / - path: /
{{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: ImplementationSpecific
{{- end }}
backend: backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ include "emqx.fullname" $ }}
port:
number: {{ $.Values.service.dashboard }}
{{- else }}
serviceName: {{ include "emqx.fullname" $ }} serviceName: {{ include "emqx.fullname" $ }}
servicePort: {{ $.Values.service.dashboard }} servicePort: {{ $.Values.service.dashboard }}
{{- end }}
{{- end -}} {{- end -}}
{{- if .Values.ingress.dashboard.tls }} {{- if .Values.ingress.dashboard.tls }}
tls: tls:
@ -52,15 +67,28 @@ metadata:
{{- toYaml .Values.ingress.mgmt.annotations | nindent 4 }} {{- toYaml .Values.ingress.mgmt.annotations | nindent 4 }}
{{- end }} {{- end }}
spec: spec:
{{- if and .Values.ingress.mgmt.ingressClassName (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.mgmt.ingressClassName }}
{{- end }}
rules: rules:
{{- range $host := .Values.ingress.mgmt.hosts }} {{- range $host := .Values.ingress.mgmt.hosts }}
- host: {{ $host }} - host: {{ $host }}
http: http:
paths: paths:
- path: / - path: /
{{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
pathType: ImplementationSpecific
{{- end }}
backend: backend:
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
service:
name: {{ include "emqx.fullname" $ }}
port:
number: {{ $.Values.service.mgmt }}
{{- else }}
serviceName: {{ include "emqx.fullname" $ }} serviceName: {{ include "emqx.fullname" $ }}
servicePort: {{ $.Values.service.mgmt }} servicePort: {{ $.Values.service.mgmt }}
{{- end }}
{{- end -}} {{- end -}}
{{- if .Values.ingress.mgmt.tls }} {{- if .Values.ingress.mgmt.tls }}
tls: tls:

View File

@ -128,6 +128,7 @@ ingress:
## ingress for EMQX Dashboard ## ingress for EMQX Dashboard
dashboard: dashboard:
enabled: false enabled: false
# ingressClassName: nginx
annotations: {} annotations: {}
# kubernetes.io/ingress.class: nginx # kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true" # kubernetes.io/tls-acme: "true"
@ -139,6 +140,7 @@ ingress:
## ingress for EMQX Mgmt API ## ingress for EMQX Mgmt API
mgmt: mgmt:
enabled: false enabled: false
# ingressClassName: nginx
annotations: {} annotations: {}
# kubernetes.io/ingress.class: nginx # kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true" # kubernetes.io/tls-acme: "true"