Make sure the Cluster API external network is propagated to load balancers
This commit is contained in:
parent
a53b6aa366
commit
b6a660ba12
@ -9,9 +9,17 @@
|
||||
installType: custom
|
||||
custom:
|
||||
install: |
|
||||
{{- if .Values.clusterApi }}
|
||||
export EXTERNAL_NETWORK_ID="$(
|
||||
KUBECONFIG= kubectl get openstackcluster \
|
||||
{{ tpl .Values.clusterName . }} \
|
||||
--namespace {{ .Release.Namespace }} \
|
||||
-o jsonpath='{.status.externalNetwork.id}'
|
||||
)"
|
||||
{{- end }}
|
||||
gomplate --file secret.yaml.tpl | kubectl apply -f -
|
||||
delete: |
|
||||
gomplate --file secret.yaml.tpl | kubectl delete -f -
|
||||
kubectl delete secret --namespace kube-system cloud-config
|
||||
extraVolumes:
|
||||
- secret:
|
||||
name: {{ $secretName }}
|
||||
@ -44,12 +52,22 @@ extraFiles:
|
||||
tls-insecure=true
|
||||
{{ "{{-" }} end {{ "}}" }}
|
||||
{{ "{{-" }} end {{ "}}" }}
|
||||
{{- range $section, $items := omit .Values.openstack.cloudConfig "Global" }}
|
||||
{{- range $section, $items := omit .Values.openstack.cloudConfig "Global" "LoadBalancer" }}
|
||||
[{{ $section }}]
|
||||
{{- range $name, $value := $items }}
|
||||
{{ $name }}={{ $value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
[LoadBalancer]
|
||||
{{- $lbItems := default dict .Values.openstack.cloudConfig.LoadBalancer }}
|
||||
{{- if hasKey $lbItems "floating-network-id" }}
|
||||
floating-network-id={{ index $lbItems "floating-network-id" }}
|
||||
{{- else if .Values.clusterApi }}
|
||||
floating-network-id={{ "{{" }} .Env.EXTERNAL_NETWORK_ID {{ "}}" }}
|
||||
{{- end }}
|
||||
{{- range $lbName, $lbValue := omit $lbItems "floating-network-id" }}
|
||||
{{ $lbName }}={{ $lbValue }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{-
|
||||
|
@ -30,5 +30,15 @@ rules:
|
||||
- list
|
||||
- get
|
||||
- watch
|
||||
{{- if .Values.openstack.enabled }}
|
||||
- apiGroups:
|
||||
- infrastructure.cluster.x-k8s.io
|
||||
resources:
|
||||
- openstackclusters
|
||||
verbs:
|
||||
- list
|
||||
- get
|
||||
- watch
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user