Goglides Dev 🌱

Discussion on: Openshift-UPI: Keepalived to rescue failover

Collapse
 
bkpandey profile image
Balkrishna Pandey

Yes it is possible to use machineconfig to create static file. Simply create a file where kubelet is tracking and rest kubelet will start managing the pod.

Collapse
 
yashjethi profile image
Yash Singh

Thanks for that, i was looking the static pod resources and there are some variables in haproxy config template. I was wondering how are these variables passed on to the haproxy config file, does installer passes these variables ?

Thread Thread
 
bkpandey profile image
Balkrishna Pandey

There are 2 containers in that pod, haproxy-monitor resolve the variable and produce the correct config, so that haproxy container can consume it.

  - name: haproxy-monitor
    securityContext:
      privileged: true
    image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:c1f0f7c54f0f2ecd38fdf2667651f95153a589bd7fe4605f0f96a97899576a08
    command:
      - "/bin/bash"
      - "-c"
      - |            
        cp /host/etc/resolv.conf /etc/resolv.conf
        monitor /var/lib/kubelet/kubeconfig  /config/haproxy.cfg.tmpl  /etc/haproxy/haproxy.cfg  --api-vip 172.21.104.25
    resources:
Enter fullscreen mode Exit fullscreen mode