Migrate Ingress resources to networking.k8s.io/v1

This change updates the helm-toolkit and ingress charts to migrate
Ingress resources to the networking.k8s.io/v1 API version, available
since v1.19. [0]

0: https://kubernetes.io/docs/reference/using-api/deprecation-guide/#ingress-v122

Change-Id: Ic6bd6d158b1294da26c165797c90107831dcb508
This commit is contained in:
Phil Sphicas
2021-10-07 17:18:37 -07:00
parent f38880b26e
commit f4972121bc
6 changed files with 141 additions and 60 deletions

View File

@@ -15,7 +15,7 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Helm-Toolkit description: OpenStack-Helm Helm-Toolkit
name: helm-toolkit name: helm-toolkit
version: 0.2.23 version: 0.2.24
home: https://docs.openstack.org/openstack-helm home: https://docs.openstack.org/openstack-helm
icon: https://www.openstack.org/themes/openstack/images/project-mascots/OpenStack-Helm/OpenStack_Project_OpenStackHelm_vertical.png icon: https://www.openstack.org/themes/openstack/images/project-mascots/OpenStack-Helm/OpenStack_Project_OpenStackHelm_vertical.png
sources: sources:

View File

@@ -62,7 +62,7 @@ examples:
{{- include "helm-toolkit.manifests.ingress" ( dict "envAll" . "backendServiceType" "key-manager" "backendPort" "b-api" "endpoint" "public" ) -}} {{- include "helm-toolkit.manifests.ingress" ( dict "envAll" . "backendServiceType" "key-manager" "backendPort" "b-api" "endpoint" "public" ) -}}
return: | return: |
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: barbican name: barbican
@@ -76,25 +76,34 @@ examples:
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
- host: barbican.default - host: barbican.default
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
- host: barbican.default.svc.cluster.local - host: barbican.default.svc.cluster.local
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: barbican-namespace-fqdn name: barbican-namespace-fqdn
@@ -112,11 +121,14 @@ examples:
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: barbican-cluster-fqdn name: barbican-cluster-fqdn
@@ -134,9 +146,12 @@ examples:
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
- values: | - values: |
network: network:
api: api:
@@ -182,7 +197,7 @@ examples:
{{- include "helm-toolkit.manifests.ingress" ( dict "envAll" . "backendServiceType" "key-manager" "backendPort" "b-api" "endpoint" "public" ) -}} {{- include "helm-toolkit.manifests.ingress" ( dict "envAll" . "backendServiceType" "key-manager" "backendPort" "b-api" "endpoint" "public" ) -}}
return: | return: |
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: barbican name: barbican
@@ -202,23 +217,32 @@ examples:
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
- host: barbican.default - host: barbican.default
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
- host: barbican.default.svc.cluster.local - host: barbican.default.svc.cluster.local
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
- values: | - values: |
cert_issuer_type: issuer cert_issuer_type: issuer
network: network:
@@ -273,7 +297,7 @@ examples:
{{- include "helm-toolkit.manifests.ingress" ( dict "envAll" . "backendServiceType" "key-manager" "backendPort" "b-api" "endpoint" "public" "certIssuer" "ca-issuer" ) -}} {{- include "helm-toolkit.manifests.ingress" ( dict "envAll" . "backendServiceType" "key-manager" "backendPort" "b-api" "endpoint" "public" "certIssuer" "ca-issuer" ) -}}
return: | return: |
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: barbican name: barbican
@@ -295,23 +319,32 @@ examples:
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
- host: barbican.default - host: barbican.default
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
- host: barbican.default.svc.cluster.local - host: barbican.default.svc.cluster.local
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
- values: | - values: |
network: network:
@@ -366,7 +399,7 @@ examples:
{{- include "helm-toolkit.manifests.ingress" ( dict "envAll" . "backendServiceType" "key-manager" "backendPort" "b-api" "endpoint" "public" "certIssuer" "ca-issuer") -}} {{- include "helm-toolkit.manifests.ingress" ( dict "envAll" . "backendServiceType" "key-manager" "backendPort" "b-api" "endpoint" "public" "certIssuer" "ca-issuer") -}}
return: | return: |
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: barbican name: barbican
@@ -388,23 +421,32 @@ examples:
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
- host: barbican.default - host: barbican.default
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
- host: barbican.default.svc.cluster.local - host: barbican.default.svc.cluster.local
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: barbican-api service:
servicePort: b-api name: barbican-api
port:
name: b-api
# Sample usage for multiple DNS names associated with the same public # Sample usage for multiple DNS names associated with the same public
# endpoint and certificate # endpoint and certificate
- values: | - values: |
@@ -441,7 +483,7 @@ examples:
{{ $ingressOpts | include "helm-toolkit.manifests.ingress" }} {{ $ingressOpts | include "helm-toolkit.manifests.ingress" }}
return: | return: |
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: grafana name: grafana
@@ -455,25 +497,34 @@ examples:
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: grafana-dashboard service:
servicePort: dashboard name: grafana-dashboard
port:
name: dashboard
- host: grafana.default - host: grafana.default
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: grafana-dashboard service:
servicePort: dashboard name: grafana-dashboard
port:
name: dashboard
- host: grafana.default.svc.cluster.local - host: grafana.default.svc.cluster.local
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: grafana-dashboard service:
servicePort: dashboard name: grafana-dashboard
port:
name: dashboard
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: grafana-namespace-fqdn name: grafana-namespace-fqdn
@@ -492,18 +543,24 @@ examples:
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: grafana-dashboard service:
servicePort: dashboard name: grafana-dashboard
port:
name: dashboard
- host: grafana-alt.openstackhelm.example - host: grafana-alt.openstackhelm.example
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: grafana-dashboard service:
servicePort: dashboard name: grafana-dashboard
port:
name: dashboard
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: grafana-cluster-fqdn name: grafana-cluster-fqdn
@@ -522,16 +579,22 @@ examples:
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: grafana-dashboard service:
servicePort: dashboard name: grafana-dashboard
port:
name: dashboard
- host: grafana-alt.openstackhelm.example - host: grafana-alt.openstackhelm.example
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: grafana-dashboard service:
servicePort: dashboard name: grafana-dashboard
port:
name: dashboard
*/}} */}}
@@ -543,9 +606,16 @@ examples:
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: {{ $backendName }} service:
servicePort: {{ $backendPort }} name: {{ $backendName }}
port:
{{- if or (kindIs "int" $backendPort) (regexMatch "^[0-9]{1,5}$" $backendPort) }}
number: {{ $backendPort | int }}
{{- else }}
name: {{ $backendPort | quote }}
{{- end }}
{{- end }} {{- end }}
{{- define "helm-toolkit.manifests.ingress" -}} {{- define "helm-toolkit.manifests.ingress" -}}
@@ -564,7 +634,7 @@ examples:
{{- $certIssuerType = $envAll.Values.cert_issuer_type }} {{- $certIssuerType = $envAll.Values.cert_issuer_type }}
{{- end }} {{- end }}
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: {{ $ingressName }} name: {{ $ingressName }}
@@ -618,7 +688,7 @@ spec:
{{- range $key2, $ingressController := tuple "namespace" "cluster" }} {{- range $key2, $ingressController := tuple "namespace" "cluster" }}
{{- $vHosts := list $hostNameFull }} {{- $vHosts := list $hostNameFull }}
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: {{ printf "%s-%s-%s" $ingressName $ingressController "fqdn" }} name: {{ printf "%s-%s-%s" $ingressName $ingressController "fqdn" }}

View File

@@ -15,7 +15,7 @@ apiVersion: v1
appVersion: v0.42.0 appVersion: v0.42.0
description: OpenStack-Helm Ingress Controller description: OpenStack-Helm Ingress Controller
name: ingress name: ingress
version: 0.2.4 version: 0.2.5
home: https://github.com/kubernetes/ingress home: https://github.com/kubernetes/ingress
sources: sources:
- https://github.com/kubernetes/ingress - https://github.com/kubernetes/ingress

View File

@@ -18,8 +18,10 @@ limitations under the License.
{{- if empty (index .Values.network.ingress.annotations "kubernetes.io/ingress.class") -}} {{- if empty (index .Values.network.ingress.annotations "kubernetes.io/ingress.class") -}}
{{- $_ := set .Values.network.ingress.annotations "kubernetes.io/ingress.class" .Values.deployment.cluster.class -}} {{- $_ := set .Values.network.ingress.annotations "kubernetes.io/ingress.class" .Values.deployment.cluster.class -}}
{{- end -}} {{- end -}}
{{- $serviceName := tuple "ingress" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" -}}
{{- $servicePort := tuple "ingress" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" -}}
--- ---
apiVersion: networking.k8s.io/v1beta1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: {{ .Release.Namespace }}-{{ .Release.Name }} name: {{ .Release.Namespace }}-{{ .Release.Name }}
@@ -31,8 +33,15 @@ spec:
http: http:
paths: paths:
- path: / - path: /
pathType: ImplementationSpecific
backend: backend:
serviceName: {{ tuple "ingress" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }} service:
servicePort: {{ tuple "ingress" "internal" "http" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} name: {{ $serviceName }}
port:
{{- if or (kindIs "int" $servicePort) (regexMatch "^[0-9]{1,5}$" $servicePort) }}
number: {{ $servicePort | int }}
{{- else }}
name: {{ $servicePort | quote }}
{{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@@ -30,4 +30,5 @@ helm-toolkit:
- 0.2.21 Fix issue with db backup error return code being eaten - 0.2.21 Fix issue with db backup error return code being eaten
- 0.2.22 Add ability to set labels to add to resources - 0.2.22 Add ability to set labels to add to resources
- 0.2.23 Helm 3 - Fix Job labels - 0.2.23 Helm 3 - Fix Job labels
- 0.2.24 Migrate Ingress resources to networking.k8s.io/v1
... ...

View File

@@ -8,4 +8,5 @@ ingress:
- 0.2.2 Use full image ref for docker official images - 0.2.2 Use full image ref for docker official images
- 0.2.3 Uplift ingress to 0.42.0 - 0.2.3 Uplift ingress to 0.42.0
- 0.2.4 Update htk requirements - 0.2.4 Update htk requirements
- 0.2.5 Migrate Ingress resources to networking.k8s.io/v1
... ...