---
apiVersion: v1
kind: Pod
metadata:
  annotations:
    kubernetes.io/config.hash: 2888e7a41a5a2fe2a981e9ef017667cf
    kubernetes.io/config.mirror: 2888e7a41a5a2fe2a981e9ef017667cf
    kubernetes.io/config.seen: "2025-10-27T11:27:53.299137827Z"
    kubernetes.io/config.source: file
    openshift.io/required-scc: privileged
    openshift.io/scc: privileged
    target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
  creationTimestamp: "2025-10-27T11:27:57Z"
  labels:
    app: kni-infra-vrrp
  managedFields:
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .: {}
          f:kubernetes.io/config.hash: {}
          f:kubernetes.io/config.mirror: {}
          f:kubernetes.io/config.seen: {}
          f:kubernetes.io/config.source: {}
          f:openshift.io/required-scc: {}
          f:target.workload.openshift.io/management: {}
        f:labels:
          .: {}
          f:app: {}
        f:ownerReferences:
          .: {}
          k:{"uid":"a9fb40ce-a7c8-4ab3-8b5b-81265dd585ae"}: {}
      f:spec:
        f:containers:
          k:{"name":"keepalived"}:
            .: {}
            f:command: {}
            f:env:
              .: {}
              k:{"name":"NSS_SDB_USE_CACHE"}:
                .: {}
                f:name: {}
                f:value: {}
            f:image: {}
            f:imagePullPolicy: {}
            f:livenessProbe:
              .: {}
              f:exec:
                .: {}
                f:command: {}
              f:failureThreshold: {}
              f:initialDelaySeconds: {}
              f:periodSeconds: {}
              f:successThreshold: {}
              f:timeoutSeconds: {}
            f:name: {}
            f:resources:
              .: {}
              f:requests:
                .: {}
                f:cpu: {}
                f:memory: {}
            f:securityContext:
              .: {}
              f:capabilities:
                .: {}
                f:add: {}
            f:terminationMessagePath: {}
            f:terminationMessagePolicy: {}
            f:volumeMounts:
              .: {}
              k:{"mountPath":"/etc/keepalived"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/host"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/run/nodeip-configuration"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/var/lib/kubelet"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/var/run/keepalived"}:
                .: {}
                f:mountPath: {}
                f:name: {}
          k:{"name":"keepalived-monitor"}:
            .: {}
            f:command: {}
            f:env:
              .: {}
              k:{"name":"ENABLE_UNICAST"}:
                .: {}
                f:name: {}
                f:value: {}
              k:{"name":"IS_BOOTSTRAP"}:
                .: {}
                f:name: {}
                f:value: {}
              k:{"name":"POD_NAMESPACE"}:
                .: {}
                f:name: {}
                f:valueFrom:
                  .: {}
                  f:fieldRef: {}
            f:image: {}
            f:imagePullPolicy: {}
            f:name: {}
            f:resources:
              .: {}
              f:requests:
                .: {}
                f:cpu: {}
                f:memory: {}
            f:securityContext:
              .: {}
              f:capabilities:
                .: {}
                f:add: {}
            f:terminationMessagePath: {}
            f:terminationMessagePolicy: {}
            f:volumeMounts:
              .: {}
              k:{"mountPath":"/config"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/etc/keepalived"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/host"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/run/nodeip-configuration"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/var/lib/kubelet"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/var/run/keepalived"}:
                .: {}
                f:mountPath: {}
                f:name: {}
        f:dnsPolicy: {}
        f:enableServiceLinks: {}
        f:hostNetwork: {}
        f:initContainers:
          .: {}
          k:{"name":"render-config-keepalived"}:
            .: {}
            f:command: {}
            f:image: {}
            f:imagePullPolicy: {}
            f:name: {}
            f:resources: {}
            f:terminationMessagePath: {}
            f:terminationMessagePolicy: {}
            f:volumeMounts:
              .: {}
              k:{"mountPath":"/config"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/etc/keepalived"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/etc/kubernetes"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/run/nodeip-configuration"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
        f:nodeName: {}
        f:priorityClassName: {}
        f:restartPolicy: {}
        f:schedulerName: {}
        f:securityContext: {}
        f:terminationGracePeriodSeconds: {}
        f:tolerations: {}
        f:volumes:
          .: {}
          k:{"name":"chroot-host"}:
            .: {}
            f:hostPath:
              .: {}
              f:path: {}
              f:type: {}
            f:name: {}
          k:{"name":"conf-dir"}:
            .: {}
            f:hostPath:
              .: {}
              f:path: {}
              f:type: {}
            f:name: {}
          k:{"name":"kubeconfig"}:
            .: {}
            f:hostPath:
              .: {}
              f:path: {}
              f:type: {}
            f:name: {}
          k:{"name":"kubeconfigvarlib"}:
            .: {}
            f:hostPath:
              .: {}
              f:path: {}
              f:type: {}
            f:name: {}
          k:{"name":"nodeip-configuration"}:
            .: {}
            f:hostPath:
              .: {}
              f:path: {}
              f:type: {}
            f:name: {}
          k:{"name":"resource-dir"}:
            .: {}
            f:hostPath:
              .: {}
              f:path: {}
              f:type: {}
            f:name: {}
          k:{"name":"run-dir"}:
            .: {}
            f:emptyDir: {}
            f:name: {}
          k:{"name":"script-dir"}:
            .: {}
            f:hostPath:
              .: {}
              f:path: {}
              f:type: {}
            f:name: {}
    manager: kubelet
    operation: Update
    time: "2025-10-27T11:27:57Z"
  - apiVersion: v1
    fieldsType: FieldsV1
    fieldsV1:
      f:status:
        f:conditions:
          .: {}
          k:{"type":"ContainersReady"}:
            .: {}
            f:lastProbeTime: {}
            f:lastTransitionTime: {}
            f:status: {}
            f:type: {}
          k:{"type":"Initialized"}:
            .: {}
            f:lastProbeTime: {}
            f:lastTransitionTime: {}
            f:status: {}
            f:type: {}
          k:{"type":"PodReadyToStartContainers"}:
            .: {}
            f:lastProbeTime: {}
            f:lastTransitionTime: {}
            f:status: {}
            f:type: {}
          k:{"type":"PodScheduled"}:
            .: {}
            f:lastProbeTime: {}
            f:lastTransitionTime: {}
            f:status: {}
            f:type: {}
          k:{"type":"Ready"}:
            .: {}
            f:lastProbeTime: {}
            f:lastTransitionTime: {}
            f:status: {}
            f:type: {}
        f:containerStatuses: {}
        f:hostIP: {}
        f:hostIPs: {}
        f:initContainerStatuses: {}
        f:phase: {}
        f:podIP: {}
        f:podIPs:
          .: {}
          k:{"ip":"10.46.248.134"}:
            .: {}
            f:ip: {}
          k:{"ip":"2620:52:0:2ef8::86"}:
            .: {}
            f:ip: {}
        f:startTime: {}
    manager: kubelet
    operation: Update
    subresource: status
    time: "2025-10-27T12:37:20Z"
  name: keepalived-cnvqe-072.lab.eng.tlv2.redhat.com
  namespace: openshift-kni-infra
  ownerReferences:
  - apiVersion: v1
    controller: true
    kind: Node
    name: cnvqe-072.lab.eng.tlv2.redhat.com
    uid: a9fb40ce-a7c8-4ab3-8b5b-81265dd585ae
  resourceVersion: "48538"
  uid: 502de796-e7c2-486f-bba0-78efc3be6302
spec:
  containers:
  - command:
    - /bin/bash
    - -c
    - |
      #/bin/bash
      sigterm_handler()
      {
        if pid=$(pgrep -o keepalived); then
          kill -s SIGTERM "$pid"
        fi
      }

      reload_keepalived()
      {
        if pid=$(pgrep -o keepalived); then
            kill -s SIGHUP "$pid"
        else
            /usr/sbin/keepalived -f /etc/keepalived/keepalived.conf --dont-fork --vrrp --log-detail --log-console &
        fi
      }

      msg_handler()
      {
        while read -r line; do
          echo "The client sent: $line" >&2
          # currently only 'reload' msg is supported
          if [ "$line" = reload ]; then
              reload_keepalived
          fi
        done
      }

      remove_vip()
      {
        address=$1
        interface=$(ip -o a | awk "/\s${address}\// {print \$2}")
        cidr=$(ip -o a | awk "/\s${address}\// {print \$4}")
        if [ -n "$interface" ]; then
            ip a del $cidr dev $interface
        fi
      }

      set -ex
      # Ensure that we don't have stale VIPs configured
      # See https://bugzilla.redhat.com/show_bug.cgi?id=1931505
      remove_vip "10.46.255.225"
      remove_vip "2620:52:0:2ef8::225"
      remove_vip "10.46.255.224"
      remove_vip "2620:52:0:2ef8::224"
      declare -r keepalived_sock="/var/run/keepalived/keepalived.sock"
      export -f msg_handler
      export -f reload_keepalived
      export -f sigterm_handler

      # in remote worker case sleep forever
      if [ -f "/run/nodeip-configuration/remote-worker" ]; then
         sleep infinity
         exit 0
      fi

      trap sigterm_handler SIGTERM
      if [ -s "/etc/keepalived/keepalived.conf" ]; then
          /usr/sbin/keepalived -f /etc/keepalived/keepalived.conf --dont-fork --vrrp --log-detail --log-console &
      fi

      rm -f "$keepalived_sock"
      socat UNIX-LISTEN:${keepalived_sock},fork system:'bash -c msg_handler'
    env:
    - name: NSS_SDB_USE_CACHE
      value: "no"
    image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:60a3d51bab20c792ea285e7bec6c26917e8e8a7151c02d44306f9744442f799a
    imagePullPolicy: IfNotPresent
    livenessProbe:
      exec:
        command:
        - /bin/bash
        - -c
        - |
          [ ! -s "/etc/keepalived/keepalived.conf" ] || (echo "" > /tmp/keepalived.data && kill -s SIGUSR1 "$(pgrep -o keepalived)" && for i in $(seq 5); do grep -q "VRRP Instance" /tmp/keepalived.data && exit 0 || sleep 1; done && exit 1)
      failureThreshold: 3
      initialDelaySeconds: 20
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 5
    name: keepalived
    resources:
      requests:
        cpu: 100m
        memory: 200Mi
    securityContext:
      capabilities:
        add:
        - NET_ADMIN
        - NET_RAW
        - SYS_CHROOT
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: FallbackToLogsOnError
    volumeMounts:
    - mountPath: /etc/keepalived
      mountPropagation: HostToContainer
      name: conf-dir
    - mountPath: /var/run/keepalived
      name: run-dir
    - mountPath: /host
      mountPropagation: HostToContainer
      name: chroot-host
    - mountPath: /var/lib/kubelet
      mountPropagation: HostToContainer
      name: kubeconfigvarlib
    - mountPath: /run/nodeip-configuration
      mountPropagation: HostToContainer
      name: nodeip-configuration
  - command:
    - /bin/bash
    - -c
    - |
      #/bin/bash
      # in remote worker case sleep forever
      if [ -f "/run/nodeip-configuration/remote-worker" ]; then
          sleep infinity
          exit 0
      fi
      api_vips=10.46.255.225,2620:52:0:2ef8::225
      ingress_vips=10.46.255.224,2620:52:0:2ef8::224
      dynkeepalived /var/lib/kubelet/kubeconfig /config/keepalived.conf.tmpl /etc/keepalived/keepalived.conf --api-vips "${api_vips}" --ingress-vips "${ingress_vips}"
    env:
    - name: ENABLE_UNICAST
      value: "yes"
    - name: IS_BOOTSTRAP
      value: "no"
    - name: POD_NAMESPACE
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: metadata.namespace
    image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:52cc8276aa5266029a31bb97c45413ad02eee9e6fc723cc1a9cab787958e7c39
    imagePullPolicy: IfNotPresent
    name: keepalived-monitor
    resources:
      requests:
        cpu: 100m
        memory: 200Mi
    securityContext:
      capabilities:
        add:
        - NET_ADMIN
        - SYS_CHROOT
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: FallbackToLogsOnError
    volumeMounts:
    - mountPath: /config
      mountPropagation: HostToContainer
      name: resource-dir
    - mountPath: /var/lib/kubelet
      mountPropagation: HostToContainer
      name: kubeconfigvarlib
    - mountPath: /etc/keepalived
      mountPropagation: HostToContainer
      name: conf-dir
    - mountPath: /var/run/keepalived
      name: run-dir
    - mountPath: /host
      mountPropagation: HostToContainer
      name: chroot-host
    - mountPath: /run/nodeip-configuration
      mountPropagation: HostToContainer
      name: nodeip-configuration
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  hostNetwork: true
  initContainers:
  - command:
    - runtimecfg
    - render
    - /etc/kubernetes/kubeconfig
    - --api-vips
    - 10.46.255.225,2620:52:0:2ef8::225
    - --ingress-vips
    - 10.46.255.224,2620:52:0:2ef8::224
    - /config
    - --out-dir
    - /etc/keepalived
    image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:52cc8276aa5266029a31bb97c45413ad02eee9e6fc723cc1a9cab787958e7c39
    imagePullPolicy: IfNotPresent
    name: render-config-keepalived
    resources: {}
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: FallbackToLogsOnError
    volumeMounts:
    - mountPath: /etc/kubernetes
      mountPropagation: HostToContainer
      name: kubeconfig
    - mountPath: /config
      mountPropagation: HostToContainer
      name: script-dir
    - mountPath: /etc/keepalived
      mountPropagation: HostToContainer
      name: conf-dir
    - mountPath: /run/nodeip-configuration
      mountPropagation: HostToContainer
      name: nodeip-configuration
  nodeName: cnvqe-072.lab.eng.tlv2.redhat.com
  preemptionPolicy: PreemptLowerPriority
  priority: 2000001000
  priorityClassName: system-node-critical
  restartPolicy: Always
  schedulerName: default-scheduler
  securityContext: {}
  terminationGracePeriodSeconds: 30
  tolerations:
  - operator: Exists
  volumes:
  - hostPath:
      path: /etc/kubernetes/static-pod-resources/keepalived
      type: ""
    name: resource-dir
  - hostPath:
      path: /etc/kubernetes/static-pod-resources/keepalived/scripts
      type: ""
    name: script-dir
  - hostPath:
      path: /etc/kubernetes
      type: ""
    name: kubeconfig
  - hostPath:
      path: /var/lib/kubelet
      type: ""
    name: kubeconfigvarlib
  - hostPath:
      path: /etc/keepalived
      type: ""
    name: conf-dir
  - emptyDir: {}
    name: run-dir
  - hostPath:
      path: /
      type: ""
    name: chroot-host
  - hostPath:
      path: /run/nodeip-configuration
      type: ""
    name: nodeip-configuration
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2025-10-27T12:37:14Z"
    status: "True"
    type: PodReadyToStartContainers
  - lastProbeTime: null
    lastTransitionTime: "2025-10-27T12:37:14Z"
    status: "True"
    type: Initialized
  - lastProbeTime: null
    lastTransitionTime: "2025-10-27T12:37:20Z"
    status: "True"
    type: Ready
  - lastProbeTime: null
    lastTransitionTime: "2025-10-27T12:37:20Z"
    status: "True"
    type: ContainersReady
  - lastProbeTime: null
    lastTransitionTime: "2025-10-27T12:37:12Z"
    status: "True"
    type: PodScheduled
  containerStatuses:
  - containerID: cri-o://93af4cce94ff67ff3e41f1be3f3fa61928973d50f2a48a3e1aec8b5e3537b578
    image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:60a3d51bab20c792ea285e7bec6c26917e8e8a7151c02d44306f9744442f799a
    imageID: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:60a3d51bab20c792ea285e7bec6c26917e8e8a7151c02d44306f9744442f799a
    lastState: {}
    name: keepalived
    ready: true
    restartCount: 1
    started: true
    state:
      running:
        startedAt: "2025-10-27T12:37:16Z"
    volumeMounts:
    - mountPath: /etc/keepalived
      name: conf-dir
    - mountPath: /var/run/keepalived
      name: run-dir
    - mountPath: /host
      name: chroot-host
    - mountPath: /var/lib/kubelet
      name: kubeconfigvarlib
    - mountPath: /run/nodeip-configuration
      name: nodeip-configuration
  - containerID: cri-o://85c5360f5218d40c8d0ad38199abf140281da94f26b63d0639bfa3843a5fc833
    image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:52cc8276aa5266029a31bb97c45413ad02eee9e6fc723cc1a9cab787958e7c39
    imageID: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:52cc8276aa5266029a31bb97c45413ad02eee9e6fc723cc1a9cab787958e7c39
    lastState: {}
    name: keepalived-monitor
    ready: true
    restartCount: 1
    started: true
    state:
      running:
        startedAt: "2025-10-27T12:37:19Z"
    volumeMounts:
    - mountPath: /config
      name: resource-dir
    - mountPath: /var/lib/kubelet
      name: kubeconfigvarlib
    - mountPath: /etc/keepalived
      name: conf-dir
    - mountPath: /var/run/keepalived
      name: run-dir
    - mountPath: /host
      name: chroot-host
    - mountPath: /run/nodeip-configuration
      name: nodeip-configuration
  hostIP: 10.46.248.134
  hostIPs:
  - ip: 10.46.248.134
  - ip: 2620:52:0:2ef8::86
  initContainerStatuses:
  - containerID: cri-o://3442661494bddfa77f7bfade6ef336ec7f646b6d88558a80f959f6d76d28efdc
    image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:52cc8276aa5266029a31bb97c45413ad02eee9e6fc723cc1a9cab787958e7c39
    imageID: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:52cc8276aa5266029a31bb97c45413ad02eee9e6fc723cc1a9cab787958e7c39
    lastState: {}
    name: render-config-keepalived
    ready: true
    restartCount: 1
    started: false
    state:
      terminated:
        containerID: cri-o://3442661494bddfa77f7bfade6ef336ec7f646b6d88558a80f959f6d76d28efdc
        exitCode: 0
        finishedAt: "2025-10-27T12:37:14Z"
        reason: Completed
        startedAt: "2025-10-27T12:37:14Z"
    volumeMounts:
    - mountPath: /etc/kubernetes
      name: kubeconfig
    - mountPath: /config
      name: script-dir
    - mountPath: /etc/keepalived
      name: conf-dir
    - mountPath: /run/nodeip-configuration
      name: nodeip-configuration
  phase: Running
  podIP: 10.46.248.134
  podIPs:
  - ip: 10.46.248.134
  - ip: 2620:52:0:2ef8::86
  qosClass: Burstable
  startTime: "2025-10-27T12:37:12Z"
