Skip to content

Commit

Permalink
Merge pull request #2697 from yboaron/ingress_keepalived
Browse files Browse the repository at this point in the history
Bug 1988102: [release-4.7] On-prem: add default ingress track script to Keepalived
  • Loading branch information
openshift-merge-robot committed Aug 28, 2021
2 parents bd4378e + 916f1da commit d6d26e1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions templates/common/on-prem/files/keepalived.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ contents:
mountPath: "/etc/keepalived"
- name: run-dir
mountPath: "/var/run/keepalived"
- name: chroot-host
mountPath: "/host"
- name: kubeconfigvarlib
mountPath: "/var/lib/kubelet"
livenessProbe:
exec:
command:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ contents:
vrrp_script chk_ingress {
script "/usr/bin/timeout 0.9 /usr/bin/curl -o /dev/null -Lfs http://localhost:1936/healthz/ready"
interval 1
weight 20
}
vrrp_script chk_default_ingress {
script "/usr/bin/timeout 4.9 /host/bin/oc --kubeconfig /var/lib/kubelet/kubeconfig get ep -n openshift-ingress router-internal-default -o yaml  | grep 'ip:' | grep {{`{{.NonVirtualIP}}`}} "
interval 5
weight 50
}
Expand Down Expand Up @@ -75,7 +81,7 @@ contents:
state BACKUP
interface {{`{{ .VRRPInterface }}`}}
virtual_router_id {{`{{ .Cluster.IngressVirtualRouterID }}`}}
priority 40
priority 20
advert_int 1
{{`{{if .EnableUnicast}}`}}
unicast_src_ip {{`{{.NonVirtualIP}}`}}
Expand All @@ -94,5 +100,6 @@ contents:
}
track_script {
chk_ingress
chk_default_ingress
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ contents:
vrrp_script chk_ingress {
script "/usr/bin/timeout 0.9 /usr/bin/curl -o /dev/null -Lfs http://localhost:1936/healthz/ready"
interval 1
weight 20
}
vrrp_script chk_default_ingress {
script "/usr/bin/timeout 4.9 /host/bin/oc --kubeconfig /var/lib/kubelet/kubeconfig get ep -n openshift-ingress router-internal-default -o yaml  | grep 'ip:' | grep {{`{{.NonVirtualIP}}`}} "
interval 5
weight 50
}
Expand All @@ -16,7 +22,7 @@ contents:
state BACKUP
interface {{`{{ .VRRPInterface }}`}}
virtual_router_id {{`{{ .Cluster.IngressVirtualRouterID }}`}}
priority 40
priority 20
advert_int 1
{{`{{if .EnableUnicast}}`}}
unicast_src_ip {{`{{.NonVirtualIP}}`}}
Expand All @@ -35,5 +41,6 @@ contents:
}
track_script {
chk_ingress
chk_default_ingress
}
}

0 comments on commit d6d26e1

Please sign in to comment.