Initial work on External services (#754)
* adapt services to allow ExternalIP and ExternalName type servces * Also create endpoints for externalIP type services * bump common version * typo fix
This commit is contained in:
@@ -18,4 +18,4 @@ maintainers:
|
|||||||
name: common
|
name: common
|
||||||
sources:
|
sources:
|
||||||
type: library
|
type: library
|
||||||
version: 6.6.2
|
version: 6.7.0
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ spec:
|
|||||||
{{- if $values.clusterIP }}
|
{{- if $values.clusterIP }}
|
||||||
clusterIP: {{ $values.clusterIP }}
|
clusterIP: {{ $values.clusterIP }}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
{{- else if eq $svcType "ExternalName" }}
|
||||||
|
type: {{ $svcType }}
|
||||||
|
externalName: {{ $values.externalName }}
|
||||||
|
{{- else if eq $svcType "ExternalIP" }}
|
||||||
{{- else if eq $svcType "LoadBalancer" }}
|
{{- else if eq $svcType "LoadBalancer" }}
|
||||||
type: {{ $svcType }}
|
type: {{ $svcType }}
|
||||||
{{- if $values.loadBalancerIP }}
|
{{- if $values.loadBalancerIP }}
|
||||||
@@ -88,6 +92,37 @@ spec:
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if and ( ne $svcType "ExternalName" ) ( ne $svcType "ExternalIP" )}}
|
||||||
selector:
|
selector:
|
||||||
{{- include "common.labels.selectorLabels" . | nindent 4 }}
|
{{- include "common.labels.selectorLabels" . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if eq $svcType "ExternalIP" }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Endpoints
|
||||||
|
metadata:
|
||||||
|
name: {{ $serviceName }}
|
||||||
|
labels:
|
||||||
|
{{- include "common.labels" $ | nindent 4 }}
|
||||||
|
subsets:
|
||||||
|
- addresses:
|
||||||
|
- ip: {{ $values.externalIP }}
|
||||||
|
ports:
|
||||||
|
{{- range $name, $port := $values.ports }}
|
||||||
|
{{- if $port.enabled }}
|
||||||
|
- port: {{ $port.port | default 80 }}
|
||||||
|
targetPort: {{ $port.targetPort | default $name }}
|
||||||
|
{{- if $port.protocol }}
|
||||||
|
{{- if or ( eq $port.protocol "HTTP" ) ( eq $port.protocol "HTTPS" ) ( eq $port.protocol "TCP" ) }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- else }}
|
||||||
|
protocol: {{ $port.protocol }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
protocol: TCP
|
||||||
|
{{- end }}
|
||||||
|
name: {{ $name }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|||||||
Reference in New Issue
Block a user