Skip to content

Commit

Permalink
Add support for dual stack clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
UXabre authored and Arend Lapere committed Jan 24, 2023
1 parent 72914d8 commit 95b9eea
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 0 deletions.
3 changes: 3 additions & 0 deletions templates/server-ha-active-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ spec:
{{- if .Values.server.service.type}}
type: {{ .Values.server.service.type }}
{{- end}}
{{- if and .Values.service.ipFamilyPolicy (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.server.service.clusterIP }}
clusterIP: {{ .Values.server.service.clusterIP }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions templates/server-ha-standby-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ spec:
{{- if .Values.server.service.type}}
type: {{ .Values.server.service.type }}
{{- end}}
{{- if and .Values.service.ipFamilyPolicy (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.server.service.clusterIP }}
clusterIP: {{ .Values.server.service.clusterIP }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions templates/server-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ spec:
{{- if .Values.server.service.type}}
type: {{ .Values.server.service.type }}
{{- end}}
{{- if and .Values.service.ipFamilyPolicy (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.server.service.clusterIP }}
clusterIP: {{ .Values.server.service.clusterIP }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions templates/ui-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ metadata:
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- template "vault.ui.annotations" . }}
spec:
{{- if and .Values.ui.serviceIpFamilyPolicy (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) }}
ipFamilyPolicy: {{ .Values.ui.serviceIpFamilyPolicy }}
{{- end }}
selector:
app.kubernetes.io/name: {{ include "vault.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
Expand Down
6 changes: 6 additions & 0 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,9 @@
},
"standbyNodePort": {
"type": "integer"
},
"ipFamilyPolicy": {
"type": "string"
}
}
},
Expand Down Expand Up @@ -1058,6 +1061,9 @@
},
"targetPort": {
"type": "integer"
},
"serviceIpFamilyPolicy": {
"type": "string"
}
}
}
Expand Down
13 changes: 13 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,13 @@ server:
# or NodePort.
#type: ClusterIP

# Configures the service's supported IP family, can be either:
# SingleStack: Single-stack service. The control plane allocates a cluster IP for the Service, using the first configured service cluster IP range.
# PreferDualStack: Allocates IPv4 and IPv6 cluster IPs for the Service.
# RequireDualStack: Allocates Service .spec.ClusterIPs from both IPv4 and IPv6 address ranges.
# Only supported for kubernetes versions >=1.23.0
# ipFamilyPolicy: SingleStack

# Do not wait for pods to be ready
publishNotReadyAddresses: true

Expand Down Expand Up @@ -915,6 +922,12 @@ ui:
serviceNodePort: null
externalPort: 8200
targetPort: 8200
# Configures the service's supported IP family, can be either:
# SingleStack: Single-stack service. The control plane allocates a cluster IP for the Service, using the first configured service cluster IP range.
# PreferDualStack: Allocates IPv4 and IPv6 cluster IPs for the Service.
# RequireDualStack: Allocates Service .spec.ClusterIPs from both IPv4 and IPv6 address ranges.
# Only supported for kubernetes versions >=1.23.0
# serviceIpFamilyPolicy: SingleStack

# The externalTrafficPolicy can be set to either Cluster or Local
# and is only valid for LoadBalancer and NodePort service types.
Expand Down

0 comments on commit 95b9eea

Please sign in to comment.