@@ -69,6 +69,62 @@ contents:
69
69
fall 2
70
70
}
71
71
72
+ # When using dual-stack with OpenStack, both IPv4 and IPv6 share the same Neutron Port and this
73
+ # makes OVN thinks that both addresses are associated to the same Node, but that might not always be
74
+ # true. To change that, let's make sure the API VIPs stays together through state changes, the same
75
+ # goes for Ingress VIPs.
76
+ {{- if and (eq .Infra.Status.PlatformStatus.Type "OpenStack") (or (eq .IPFamilies "DualStack") (eq .IPFamilies "DualStackIPv6Primary")) }}
77
+ vrrp_sync_group VG_API {
78
+ group {
79
+ {{`{{ range $i, $config := .Configs }}`}}
80
+ {{`{{$nonVirtualIP := .NonVirtualIP}}`}}
81
+
82
+ {{`{{$participateInAPIVRRP := not .EnableUnicast}}`}}
83
+ {{`{{- if .EnableUnicast}}
84
+ {{- range .LBConfig.Backends}}
85
+ {{- if eq $nonVirtualIP .Address}}
86
+ {{$participateInAPIVRRP = true}}
87
+ {{- end}}
88
+ {{- end}}
89
+ {{- end}}`}}
90
+
91
+ {{`{{if $participateInAPIVRRP}}`}}
92
+ {{`{{ .Cluster.Name }}`}}_API_{{`{{$i}}`}}
93
+ {{`{{ end }}`}}
94
+ {{`{{ end }}`}}
95
+ }
96
+ track_script {
97
+ chk_ocp_lb
98
+ chk_ocp_both
99
+ chk_mcs
100
+ }
101
+ }
102
+
103
+ vrrp_sync_group VG_INGRESS {
104
+ group {
105
+ {{`{{ range $i, $config := .Configs }}`}}
106
+ {{`{{$participateInIngressVRRP := not .EnableUnicast}}`}}
107
+ {{`{{- if .EnableUnicast}}
108
+ {{- range .IngressConfig.Peers}}
109
+ {{- if eq $nonVirtualIP .}}
110
+ {{$participateInIngressVRRP = true}}
111
+ {{- end}}
112
+ {{- end}}
113
+ {{- end}}`}}
114
+
115
+ {{`{{if $participateInIngressVRRP}}`}}
116
+ {{`{{ .Cluster.Name }}`}}_INGRESS_{{`{{$i}}`}}
117
+ {{`{{ end }}`}}
118
+ {{`{{ end }}`}}
119
+ }
120
+ track_script {
121
+ chk_ingress
122
+ chk_ingress_ready
123
+ chk_default_ingress
124
+ }
125
+ }
126
+ {{- end}}
127
+
72
128
{{`{{ range $i, $config := .Configs }}`}}
73
129
{{`{{$nonVirtualIP := .NonVirtualIP}}`}}
74
130
@@ -105,11 +161,13 @@ contents:
105
161
virtual_ipaddress {
106
162
{{`{{ .Cluster.APIVIP }}`}}/{{`{{ .Cluster.VIPNetmask }}`}} label vip
107
163
}
164
+ {{- if not (and (eq .Infra.Status.PlatformStatus.Type "OpenStack") (or (eq .IPFamilies "DualStack") (eq .IPFamilies "DualStackIPv6Primary"))) }}
108
165
track_script {
109
166
chk_ocp_lb
110
167
chk_ocp_both
111
168
chk_mcs
112
169
}
170
+ {{- end}}
113
171
}
114
172
{{`{{end}}`}}
115
173
@@ -146,11 +204,13 @@ contents:
146
204
virtual_ipaddress {
147
205
{{`{{ .Cluster.IngressVIP }}`}}/{{`{{ .Cluster.VIPNetmask }}`}} label vip
148
206
}
207
+ {{- if not (and (eq .Infra.Status.PlatformStatus.Type "OpenStack") (or (eq .IPFamilies "DualStack") (eq .IPFamilies "DualStackIPv6Primary"))) }}
149
208
track_script {
150
209
chk_ingress
151
210
chk_ingress_ready
152
211
chk_default_ingress
153
212
}
213
+ {{- end}}
154
214
}
155
215
{{`{{ end }}`}}
156
216
{{`{{ end }}`}}
0 commit comments