From d4742416b64b3783a5f580b1810799cbfdf4bf1d Mon Sep 17 00:00:00 2001 From: Eugene Venter Date: Tue, 27 Aug 2024 18:39:35 +1200 Subject: [PATCH] fix ingress class implementation and documentation --- docs/pages/configuration/ingress.mdx | 19 +++++++++---------- docs/pages/configuration/reference.mdx | 4 ++-- templates/ingress.yaml | 8 ++++---- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/docs/pages/configuration/ingress.mdx b/docs/pages/configuration/ingress.mdx index 0d3cdee..dfe1a18 100644 --- a/docs/pages/configuration/ingress.mdx +++ b/docs/pages/configuration/ingress.mdx @@ -125,7 +125,7 @@ ingress: serviceName: my-custom-k8s-service servicePort: 8000 ``` -**Explanation:** +**Explanation:** This example configuration would only create an ingress for a service called `my-custom-k8s-service` and forward the traffic from `my-static-host.tld` to port `8000` of this service. @@ -176,12 +176,12 @@ ingress: - host: my-static-host2.tld ``` -## `ingressClass` -The `ingressClass` option expects a string with a Kubernetes ingress class used for a cert-manager annotation. +## `ingressClassName` +The `ingressClassName` option expects a string with a Kubernetes ingress class used for a cert-manager annotation. -#### Default Value For `ingressClass` +#### Default Value For `ingressClassName` ```yaml -ingressClass: nginx +ingressClassName: nginx ``` #### Example: Custom Ingress Class @@ -192,7 +192,7 @@ service: ports: - port: 3000 ingress: - ingressClass: traefik + ingressClassName: traefik tls: true rules: - host: my-static-host.tld @@ -217,12 +217,12 @@ ingress: - host: my-static-host.tld - host: my-static-host2.tld ``` -**Explanation:** +**Explanation:** Instead of the default name `frontend`, the ingress of this component would be named `custom-ingress-name`. ## `labels` -The `labels` option expects a map with Kubernetes labels. +The `labels` option expects a map with Kubernetes labels. By default, the component chart sets a couple of labels following the best practices described in the Kubernetes documentation: - `app.kubernetes.io/name: devspace-app` @@ -258,7 +258,7 @@ ingress: ## `annotations` -The `annotations` option expects a map with Kubernetes annotations. +The `annotations` option expects a map with Kubernetes annotations. By default, the component chart sets a couple of annotations following the best practices described in the Kubernetes documentation: - `helm.sh/chart: component-chart-vX.Y.Z` @@ -290,4 +290,3 @@ ingress: annotation1: annotation-value-1 annotation2: annotation-value-2 ``` - diff --git a/docs/pages/configuration/reference.mdx b/docs/pages/configuration/reference.mdx index 55e0dbb..c1cd9a8 100644 --- a/docs/pages/configuration/reference.mdx +++ b/docs/pages/configuration/reference.mdx @@ -70,11 +70,11 @@ ingress: # struct | Ingress for component rules: # struct[] | Array of ingress rules for component - host: my-hostname.tld # string | Hostname for ingress rule path: / # string | Host path for ingress rule (default: /) - servicePort: + servicePort: serviceName: tls: true # boolean OR string | True (for auto-generated secert name) or name of secret with SSL certificate (default: false) tlsClusterIssuer: lets-encrypt-http-issuer # string | Name of tls cluster issuer (letsencrypt, cert-manager) - ingressClass: nginx # string | Ingress class for certificate provisioning + ingressClassName: nginx # string | Ingress class for certificate provisioning name: my-ingress # string | Name of the ingress (optional, default: name of component release) labels: # map | Map of additional labels (optional) labelName1: labelValue1 diff --git a/templates/ingress.yaml b/templates/ingress.yaml index b844ec4..9abb8f2 100644 --- a/templates/ingress.yaml +++ b/templates/ingress.yaml @@ -61,8 +61,8 @@ metadata: certmanager.k8s.io/cluster-issuer: {{ $.Values.ingress.tlsClusterIssuer | default "lets-encrypt-http-issuer" | quote }} {{- end }} {{- if $addIngressClass }} - acme.cert-manager.io/http01-ingress-class: {{ $.Values.ingress.ingressClass | default "nginx" | quote }} - certmanager.k8s.io/http01-ingress-class: {{ $.Values.ingress.ingressClass | default "nginx" | quote }} + acme.cert-manager.io/http01-ingress-class: {{ $.Values.ingress.ingressClassName | default "nginx" | quote }} + certmanager.k8s.io/http01-ingress-class: {{ $.Values.ingress.ingressClassName | default "nginx" | quote }} {{- end }} {{- end }} {{- else }} @@ -116,7 +116,7 @@ spec: {{- else }} pathType: ImplementationSpecific {{- end }} - + {{- end }} {{- if ne (printf "%s" $tlsSecretName) "" }} tls: @@ -131,4 +131,4 @@ spec: {{- end }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} \ No newline at end of file