mirror of
				https://github.com/Telecominfraproject/wlan-cloud-owprov.git
				synced 2025-10-30 18:18:03 +00:00 
			
		
		
		
	[WIFI-1998] Add: gracefull ingress deprecation
Signed-off-by: Dmitry Dunaev <dmitry@opsfleet.com>
This commit is contained in:
		| @@ -30,3 +30,13 @@ Create chart name and version as used by the chart label. | |||||||
| {{- define "owprov.chart" -}} | {{- define "owprov.chart" -}} | ||||||
| {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||||||
| {{- end -}} | {{- end -}} | ||||||
|  |  | ||||||
|  | {{- define "owprov.ingress.apiVersion" -}} | ||||||
|  |   {{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" -}} | ||||||
|  |       {{- print "networking.k8s.io/v1" -}} | ||||||
|  |   {{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}} | ||||||
|  |     {{- print "networking.k8s.io/v1beta1" -}} | ||||||
|  |   {{- else -}} | ||||||
|  |     {{- print "extensions/v1beta1" -}} | ||||||
|  |   {{- end -}} | ||||||
|  | {{- end -}} | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ | |||||||
| {{- range $ingress, $ingressValue := .Values.ingresses }} | {{- range $ingress, $ingressValue := .Values.ingresses }} | ||||||
| {{- if $ingressValue.enabled }} | {{- if $ingressValue.enabled }} | ||||||
| --- | --- | ||||||
| apiVersion: extensions/v1beta1 | apiVersion: {{ include "owprov.ingress.apiVersion" $root }} | ||||||
| kind: Ingress | kind: Ingress | ||||||
| metadata: | metadata: | ||||||
|   name: {{ include "owprov.fullname" $root }}-{{ $ingress }} |   name: {{ include "owprov.fullname" $root }}-{{ $ingress }} | ||||||
| @@ -36,9 +36,23 @@ spec: | |||||||
|       paths: |       paths: | ||||||
|       {{- range $ingressValue.paths }} |       {{- range $ingressValue.paths }} | ||||||
|         - path: {{ .path }} |         - path: {{ .path }} | ||||||
|  |           {{- if $root.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} | ||||||
|  |           pathType: {{ .pathType | default "ImplementationSpecific" }} | ||||||
|  |           {{- end }} | ||||||
|           backend: |           backend: | ||||||
|  |             {{- if $root.Capabilities.APIVersions.Has "networking.k8s.io/v1" }} | ||||||
|  |             service: | ||||||
|  |               name: {{ include "owprov.fullname" $root }}-{{ .serviceName }} | ||||||
|  |               port: | ||||||
|  |               {{- if kindIs "string" .servicePort }} | ||||||
|  |                 name: {{ .servicePort }} | ||||||
|  |               {{- else }} | ||||||
|  |                 number: {{ .servicePort }} | ||||||
|  |               {{- end }} | ||||||
|  |             {{- else }} | ||||||
|             serviceName: {{ include "owprov.fullname" $root }}-{{ .serviceName }} |             serviceName: {{ include "owprov.fullname" $root }}-{{ .serviceName }} | ||||||
|             servicePort: {{ .servicePort }} |             servicePort: {{ .servicePort }} | ||||||
|  |             {{- end }} | ||||||
|       {{- end }} |       {{- end }} | ||||||
|   {{- end }} |   {{- end }} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -54,6 +54,7 @@ ingresses: | |||||||
|     - restapi.chart-example.local |     - restapi.chart-example.local | ||||||
|     paths: |     paths: | ||||||
|     - path: / |     - path: / | ||||||
|  |       pathType: ImplementationSpecific | ||||||
|       serviceName: owprov |       serviceName: owprov | ||||||
|       servicePort: restapi |       servicePort: restapi | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Dmitry Dunaev
					Dmitry Dunaev