Selaa lähdekoodia

Merge pull request #7715 from Rory-Z/feat/helm-ingress-pathType

feat(helm): the pathType of ingress can be made configurable via values
JianBo He 3 vuotta sitten
vanhempi
commit
4567552fe8

+ 8 - 1
deploy/charts/emqx/README.md

@@ -69,6 +69,7 @@ The following table lists the configurable parameters of the emqx chart and thei
 | `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.pathType` | Ingress pathType for EMQX Dashboard |	`ImplementationSpecific`
 | `ingress.dashboard.hosts` | Ingress hosts for EMQX Mgmt API |	dashboard.emqx.local |
 | `ingress.dashboard.tls` | Ingress tls for EMQX Mgmt API |	[] |
 | `ingress.dashboard.annotations` | Ingress annotations for EMQX Mgmt API |	{} |
@@ -80,4 +81,10 @@ The following table lists the configurable parameters of the emqx chart and thei
 | `ingress.mgmt.annotations` | Ingress annotations for EMQX Mgmt API |	{} |
 | `metrics.enable` | If set to true, [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator) needs to be installed, and emqx_prometheus needs to enable | false |
 | `metrics.type` | Now we only supported "prometheus" | "prometheus" |
-| `emqxConfig` | Emqx configuration item, see the [documentation](https://hub.docker.com/r/emqx/emqx) | |
+
+## EMQX specific settings
+The following table lists the configurable [EMQX](https://www.emqx.io/)-specific parameters of the chart and their default values.
+Parameter  | Description | Default Value
+---        |  ---        | ---
+`emqxConfig` | Map of [configuration](https://www.emqx.io/docs/en/latest/configuration/configuration.html) items expressed as [environment variables](https://www.emqx.io/docs/en/v4.3/configuration/environment-variable.html) (prefix can be omitted) or using the configuration files [namespaced dotted notation](https://www.emqx.io/docs/en/latest/configuration/configuration.html) | `nil`
+`emqxLicenseSecretName` | Name of the secret that holds the license information | `nil`

+ 1 - 51
deploy/charts/emqx/templates/ingress.yaml

@@ -29,7 +29,7 @@ spec:
       paths:
       - path: /
         {{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
-        pathType: ImplementationSpecific
+        pathType: {{ .Values.ingress.dashboard.pathType | default "ImplementationSpecific" }}
         {{- end }}
         backend:
           {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
@@ -48,53 +48,3 @@ spec:
   {{- end }}
 ---
 {{- end }}
-{{- if .Values.ingress.mgmt.enabled -}}
-{{- 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
-{{- else -}}
-apiVersion: extensions/v1beta1
-{{- end }}
-kind: Ingress
-metadata:
-  name: {{ printf "%s-%s" (include "emqx.fullname" .) "mgmt" }}
-  labels:
-    app.kubernetes.io/name: {{ include "emqx.name" . }}
-    helm.sh/chart: {{ include "emqx.chart" . }}
-    app.kubernetes.io/instance: {{ .Release.Name }}
-    app.kubernetes.io/managed-by: {{ .Release.Service }}
-  {{- if .Values.ingress.mgmt.annotations }}
-  annotations:
-    {{- toYaml .Values.ingress.mgmt.annotations | nindent 4 }}
-  {{- end }}
-spec:
-{{- if and .Values.ingress.mgmt.ingressClassName (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
-  ingressClassName: {{ .Values.ingress.mgmt.ingressClassName }}
-{{- end }}
-  rules:
-  {{- range $host := .Values.ingress.mgmt.hosts }}
-  - host: {{ $host }}
-    http:
-      paths:
-      - path: /
-        {{- if (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
-        pathType: ImplementationSpecific
-        {{- end }}
-        backend:
-          {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
-          service:
-            name: {{ include "emqx.fullname" $ }}
-            port:
-              number: {{ $.Values.service.mgmt }}
-          {{- else }}
-          serviceName: {{ include "emqx.fullname" $ }}
-          servicePort: {{ $.Values.service.mgmt }}
-          {{- end }}
-  {{- end -}}
-  {{- if .Values.ingress.mgmt.tls }}
-  tls:
-    {{- toYaml .Values.ingress.mgmt.tls | nindent 4 }}
-  {{- end }}
----
-{{- end }}

+ 1 - 12
deploy/charts/emqx/values.yaml

@@ -174,22 +174,11 @@ ingress:
       # kubernetes.io/ingress.class: nginx
       # kubernetes.io/tls-acme: "true"
     path: /
+    pathType: ImplementationSpecific
     hosts:
     - dashboard.emqx.local
     tls: []
 
-  ## ingress for EMQX Mgmt API
-  mgmt:
-    enabled: false
-    # ingressClassName: nginx
-    annotations: {}
-      # kubernetes.io/ingress.class: nginx
-      # kubernetes.io/tls-acme: "true"
-    path: /
-    hosts:
-    - api.emqx.local
-    tls: []
-
 podSecurityContext:
   enabled: true
   fsGroup: 1000