Skip to content

Commit

Permalink
Merge pull request openshift#2637 from yboaron/add_ingr_default_script
Browse files Browse the repository at this point in the history
On-prem: add default ingress track script to Keepalived
  • Loading branch information
openshift-merge-robot committed Jul 18, 2021
2 parents 53fd3ec + 39bf3dc commit 182cb2e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions templates/common/on-prem/files/keepalived.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ contents:
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 @@ -40,6 +40,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 @@ -78,7 +84,7 @@ contents:
state BACKUP
interface {{`{{ .VRRPInterface }}`}}
virtual_router_id {{`{{ .Cluster.IngressVirtualRouterID }}`}}
priority {{`{{ .IngressConfig.Priority }}`}}
priority 20
advert_int 1
{{`{{if .EnableUnicast}}`}}
unicast_src_ip {{`{{.NonVirtualIP}}`}}
Expand All @@ -99,5 +105,6 @@ contents:
}
track_script {
chk_ingress
chk_default_ingress
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,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 @@ -22,7 +28,7 @@ contents:
state BACKUP
interface {{`{{ .VRRPInterface }}`}}
virtual_router_id {{`{{ .Cluster.IngressVirtualRouterID }}`}}
priority {{`{{ .IngressConfig.Priority }}`}}
priority 20
advert_int 1
{{`{{if .EnableUnicast}}`}}
unicast_src_ip {{`{{.NonVirtualIP}}`}}
Expand All @@ -43,5 +49,6 @@ contents:
}
track_script {
chk_ingress
chk_default_ingress
}
}

0 comments on commit 182cb2e

Please sign in to comment.