Make sure that the services are created with both IPv4 and IPv6 addresses when the cluster has been created with both IPv4 and IPv6 ranges. They will behave as single stack otherwise. Signed-off-by: Marco Chiappero <marco.chiappero@suse.com>
41 lines
1.3 KiB
YAML
41 lines
1.3 KiB
YAML
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ include "ironic.fullname" . }}
|
|
labels:
|
|
{{- include "ironic.labels" . | nindent 4 }}
|
|
{{- with .Values.service.annotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
type: {{ .Values.service.type }}
|
|
ipFamilyPolicy: PreferDualStack
|
|
ports:
|
|
{{- $enableTLS := .Values.global.enable_tls }}
|
|
{{- $enableVMediaTLS := .Values.global.enable_vmedia_tls }}
|
|
{{- range .Values.service.ports }}
|
|
{{- if and (eq .name "httpd") (or (not $enableTLS) (not $enableVMediaTLS)) }}
|
|
- name: {{ .name }}
|
|
port: {{ .port }}
|
|
protocol: {{ .protocol }}
|
|
targetPort: {{ .targetPort }}
|
|
{{- else if and (eq .name "httpd-tls") ($enableTLS) ($enableVMediaTLS) }}
|
|
- name: {{ .name }}
|
|
port: {{ .port }}
|
|
protocol: {{ .protocol }}
|
|
targetPort: {{ .targetPort }}
|
|
{{- else if and (ne .name "httpd") (ne .name "httpd-tls") }}
|
|
- name: {{ .name }}
|
|
port: {{ .port }}
|
|
protocol: {{ .protocol }}
|
|
targetPort: {{ .targetPort }}
|
|
{{- end }}
|
|
{{- end }}
|
|
selector:
|
|
{{- include "ironic.selectorLabels" . | nindent 4 }}
|
|
{{- if or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort") }}
|
|
externalIPs:
|
|
{{- toYaml .Values.service.externalIPs | nindent 4 }}
|
|
{{- end }}
|