---
apiVersion: v1
kind: Pod
metadata:
  annotations:
    kubernetes.io/config.hash: d0cdb716b27e3e31c7f96540d6f51840
    kubernetes.io/config.mirror: d0cdb716b27e3e31c7f96540d6f51840
    kubernetes.io/config.seen: "2025-10-27T11:48:58.825450213Z"
    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:49:18Z"
  labels:
    app: kni-infra-api-lb
  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":"37549cd0-66c4-482a-a2e8-bebff241e79b"}: {}
      f:spec:
        f:containers:
          k:{"name":"haproxy"}:
            .: {}
            f:command: {}
            f:env:
              .: {}
              k:{"name":"OLD_HAPROXY_PS_FORCE_DEL_TIMEOUT"}:
                .: {}
                f:name: {}
                f:value: {}
            f:image: {}
            f:imagePullPolicy: {}
            f:livenessProbe:
              .: {}
              f:failureThreshold: {}
              f:httpGet:
                .: {}
                f:path: {}
                f:port: {}
                f:scheme: {}
              f:initialDelaySeconds: {}
              f:periodSeconds: {}
              f:successThreshold: {}
              f:timeoutSeconds: {}
            f:name: {}
            f:resources:
              .: {}
              f:requests:
                .: {}
                f:cpu: {}
                f:memory: {}
            f:terminationMessagePath: {}
            f:terminationMessagePolicy: {}
            f:volumeMounts:
              .: {}
              k:{"mountPath":"/etc/haproxy"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/var/run/haproxy"}:
                .: {}
                f:mountPath: {}
                f:name: {}
          k:{"name":"haproxy-monitor"}:
            .: {}
            f:command: {}
            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/haproxy"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/host"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/var/lib/kubelet"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/var/run/haproxy"}:
                .: {}
                f:mountPath: {}
                f:name: {}
        f:dnsPolicy: {}
        f:enableServiceLinks: {}
        f:hostNetwork: {}
        f:initContainers:
          .: {}
          k:{"name":"verify-api-int-resolvable"}:
            .: {}
            f:command: {}
            f:image: {}
            f:imagePullPolicy: {}
            f:name: {}
            f:resources: {}
            f:terminationMessagePath: {}
            f:terminationMessagePolicy: {}
            f:volumeMounts:
              .: {}
              k:{"mountPath":"/host"}:
                .: {}
                f:mountPath: {}
                f:mountPropagation: {}
                f:name: {}
              k:{"mountPath":"/var/lib/kubelet"}:
                .: {}
                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":"kubeconfigvarlib"}:
            .: {}
            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: {}
    manager: kubelet
    operation: Update
    time: "2025-10-27T11:49:18Z"
  - 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.41"}:
            .: {}
            f:ip: {}
          k:{"ip":"2620:52:0:2ef8::29"}:
            .: {}
            f:ip: {}
        f:startTime: {}
    manager: kubelet
    operation: Update
    subresource: status
    time: "2025-10-27T12:27:19Z"
  name: haproxy-cnvqe-070.lab.eng.tlv2.redhat.com
  namespace: openshift-kni-infra
  ownerReferences:
  - apiVersion: v1
    controller: true
    kind: Node
    name: cnvqe-070.lab.eng.tlv2.redhat.com
    uid: 37549cd0-66c4-482a-a2e8-bebff241e79b
  resourceVersion: "42484"
  uid: 0490c147-3c75-4180-a8e9-cf75710f142e
spec:
  containers:
  - command:
    - /bin/bash
    - -c
    - |
      #/bin/bash
      verify_old_haproxy_ps_being_deleted()
      {
        local prev_pids

        prev_pids="$1"
        sleep $OLD_HAPROXY_PS_FORCE_DEL_TIMEOUT
        cur_pids=$(pidof haproxy)

        for val in $prev_pids; do
            if [[ $cur_pids =~ (^|[[:space:]])"$val"($|[[:space:]]) ]] ; then
               kill $val
            fi
        done
      }

      reload_haproxy()
      {
        old_pids=$(pidof haproxy)
        if [ -n "$old_pids" ]; then
            /usr/sbin/haproxy -W -db -f /etc/haproxy/haproxy.cfg  -p /var/lib/haproxy/run/haproxy.pid -x /var/lib/haproxy/run/haproxy.sock -sf $old_pids &
            #There seems to be some cases where HAProxy doesn't drain properly.
            #To handle that case, SIGTERM signal being sent to old HAProxy processes which haven't terminated.
            verify_old_haproxy_ps_being_deleted "$old_pids"  &
        else
            /usr/sbin/haproxy -W -db -f /etc/haproxy/haproxy.cfg  -p /var/lib/haproxy/run/haproxy.pid &
        fi
      }

      msg_handler()
      {
        while read -r line; do
          echo "The client send: $line"  >&2
          # currently only 'reload' msg is supported
          if [ "$line" = reload ]; then
              reload_haproxy
          fi
        done
      }
      set -ex
      declare -r haproxy_sock="/var/run/haproxy/haproxy-master.sock"
      declare -r haproxy_log_sock="/var/run/haproxy/haproxy-log.sock"
      export -f msg_handler
      export -f reload_haproxy
      export -f verify_old_haproxy_ps_being_deleted
      rm -f "$haproxy_sock" "$haproxy_log_sock"
      socat UNIX-RECV:${haproxy_log_sock} STDOUT &
      if [ -s "/etc/haproxy/haproxy.cfg" ]; then
          /usr/sbin/haproxy -W -db -f /etc/haproxy/haproxy.cfg  -p /var/lib/haproxy/run/haproxy.pid &
      fi
      socat UNIX-LISTEN:${haproxy_sock},fork system:'bash -c msg_handler'
    env:
    - name: OLD_HAPROXY_PS_FORCE_DEL_TIMEOUT
      value: "120"
    image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:d1885afe542303e608974e00e1284ea69e536b574a1723d15a77601454eccada
    imagePullPolicy: IfNotPresent
    livenessProbe:
      failureThreshold: 3
      httpGet:
        path: /haproxy_ready
        port: 9444
        scheme: HTTP
      initialDelaySeconds: 50
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 1
    name: haproxy
    resources:
      requests:
        cpu: 100m
        memory: 200Mi
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: FallbackToLogsOnError
    volumeMounts:
    - mountPath: /etc/haproxy
      mountPropagation: HostToContainer
      name: conf-dir
    - mountPath: /var/run/haproxy
      name: run-dir
  - command:
    - monitor
    - /var/lib/kubelet/kubeconfig
    - /config/haproxy.cfg.tmpl
    - /etc/haproxy/haproxy.cfg
    - --api-vips
    - 10.46.255.225,2620:52:0:2ef8::225
    image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:52cc8276aa5266029a31bb97c45413ad02eee9e6fc723cc1a9cab787958e7c39
    imagePullPolicy: IfNotPresent
    name: haproxy-monitor
    resources:
      requests:
        cpu: 100m
        memory: 200Mi
    securityContext:
      capabilities:
        add:
        - NET_ADMIN
        - SYS_CHROOT
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: FallbackToLogsOnError
    volumeMounts:
    - mountPath: /etc/haproxy
      mountPropagation: HostToContainer
      name: conf-dir
    - mountPath: /var/run/haproxy
      name: run-dir
    - mountPath: /config
      mountPropagation: HostToContainer
      name: resource-dir
    - mountPath: /host
      mountPropagation: HostToContainer
      name: chroot-host
    - mountPath: /var/lib/kubelet
      mountPropagation: HostToContainer
      name: kubeconfigvarlib
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  hostNetwork: true
  initContainers:
  - command:
    - /bin/bash
    - -c
    - |
      while ! /usr/bin/curl -o /dev/null -kLfs https://api-int.bm12b-tlv2.abi.cnv-qe.rhood.us:6443/healthz; do
        sleep 5
      done
    image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:52cc8276aa5266029a31bb97c45413ad02eee9e6fc723cc1a9cab787958e7c39
    imagePullPolicy: IfNotPresent
    name: verify-api-int-resolvable
    resources: {}
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: FallbackToLogsOnError
    volumeMounts:
    - mountPath: /host
      mountPropagation: HostToContainer
      name: chroot-host
    - mountPath: /var/lib/kubelet
      mountPropagation: HostToContainer
      name: kubeconfigvarlib
  nodeName: cnvqe-070.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/haproxy
      type: ""
    name: resource-dir
  - hostPath:
      path: /var/lib/kubelet
      type: ""
    name: kubeconfigvarlib
  - emptyDir: {}
    name: run-dir
  - hostPath:
      path: /etc/haproxy
      type: ""
    name: conf-dir
  - hostPath:
      path: /
      type: ""
    name: chroot-host
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2025-10-27T12:27:11Z"
    status: "True"
    type: PodReadyToStartContainers
  - lastProbeTime: null
    lastTransitionTime: "2025-10-27T12:27:12Z"
    status: "True"
    type: Initialized
  - lastProbeTime: null
    lastTransitionTime: "2025-10-27T12:27:19Z"
    status: "True"
    type: Ready
  - lastProbeTime: null
    lastTransitionTime: "2025-10-27T12:27:19Z"
    status: "True"
    type: ContainersReady
  - lastProbeTime: null
    lastTransitionTime: "2025-10-27T12:27:10Z"
    status: "True"
    type: PodScheduled
  containerStatuses:
  - containerID: cri-o://4b694c018e7ef1a9a1deae6fef03c2e63719b50cb44b9e8a199b8f93ec594fc9
    image: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:d1885afe542303e608974e00e1284ea69e536b574a1723d15a77601454eccada
    imageID: quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:d1885afe542303e608974e00e1284ea69e536b574a1723d15a77601454eccada
    lastState: {}
    name: haproxy
    ready: true
    restartCount: 1
    started: true
    state:
      running:
        startedAt: "2025-10-27T12:27:15Z"
    volumeMounts:
    - mountPath: /etc/haproxy
      name: conf-dir
    - mountPath: /var/run/haproxy
      name: run-dir
  - containerID: cri-o://d71d725e27a9e00a3e268f396b0e656b9dd639427c557e501e8557720783ba58
    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: haproxy-monitor
    ready: true
    restartCount: 1
    started: true
    state:
      running:
        startedAt: "2025-10-27T12:27:18Z"
    volumeMounts:
    - mountPath: /etc/haproxy
      name: conf-dir
    - mountPath: /var/run/haproxy
      name: run-dir
    - mountPath: /config
      name: resource-dir
    - mountPath: /host
      name: chroot-host
    - mountPath: /var/lib/kubelet
      name: kubeconfigvarlib
  hostIP: 10.46.248.41
  hostIPs:
  - ip: 10.46.248.41
  - ip: 2620:52:0:2ef8::29
  initContainerStatuses:
  - containerID: cri-o://9365503e94805cf4cae3868d95b50a39af21bb7c3d9469fa009956e39badabf5
    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: verify-api-int-resolvable
    ready: true
    restartCount: 1
    started: false
    state:
      terminated:
        containerID: cri-o://9365503e94805cf4cae3868d95b50a39af21bb7c3d9469fa009956e39badabf5
        exitCode: 0
        finishedAt: "2025-10-27T12:27:11Z"
        reason: Completed
        startedAt: "2025-10-27T12:27:11Z"
    volumeMounts:
    - mountPath: /host
      name: chroot-host
    - mountPath: /var/lib/kubelet
      name: kubeconfigvarlib
  phase: Running
  podIP: 10.46.248.41
  podIPs:
  - ip: 10.46.248.41
  - ip: 2620:52:0:2ef8::29
  qosClass: Burstable
  startTime: "2025-10-27T12:27:10Z"
