filesystem: "root"
mode: 0644
path: "/etc/kubernetes/manifests/mdns-publisher.yaml"
contents:
  inline: |
    kind: Pod
    apiVersion: v1
    metadata:
      name: mdns-publisher
      namespace: openshift-openstack-infra
      creationTimestamp:
      deletionGracePeriodSeconds: 65
      labels:
        app: openstack-infra-mdns
    spec:
      volumes:
      - name: resource-dir
        hostPath:
          path: "/etc/kubernetes/static-pod-resources/mdns"
      - name: kubeconfig
        hostPath:
          path: "/etc/kubernetes/kubeconfig"
      - name: conf-dir
        hostPath:
          path: "/etc/mdns"
      initContainers:
      - name: verify-hostname
        image: {{ .Images.baremetalRuntimeCfgImage }}
        env:
          - name: DEFAULT_LOCAL_HOSTNAME
            value: "localhost"
          - name: RUNTIMECFG_HOSTNAME_PATH
            value: "/etc/mdns/hostname"
        command:
        - "/bin/bash"
        - "-c"
        - |
          #/bin/bash
          function get_hostname()
          {
            if [[ -s $RUNTIMECFG_HOSTNAME_PATH ]]; then
              cat $RUNTIMECFG_HOSTNAME_PATH
            else
              # if hostname wasn't updated by NM script, read hostname
              hostname
            fi
          }
          while [ "$(get_hostname)" == "$DEFAULT_LOCAL_HOSTNAME" ]
          do
            echo "hostname is still ${DEFAULT_LOCAL_HOSTNAME}"
            sleep 1
          done
        volumeMounts:
        - name: conf-dir
          mountPath: "/etc/mdns"
      - name: render-config
        image: {{ .Images.baremetalRuntimeCfgImage }}
        env:
          - name: RUNTIMECFG_HOSTNAME_PATH
            value: "/etc/mdns/hostname"
        command:
        - runtimecfg
        - render
        - "/etc/kubernetes/kubeconfig"
        - "--api-vip"
        - "{{ .Infra.Status.PlatformStatus.OpenStack.APIServerInternalIP }}"
        - "--dns-vip"
        - "{{ .Infra.Status.PlatformStatus.OpenStack.NodeDNSIP }}"
        - "--ingress-vip"
        - "{{ .Infra.Status.PlatformStatus.OpenStack.IngressIP }}"
        - "/config"
        - "--out-dir"
        - "/etc/mdns"
        resources: {}
        volumeMounts:
        - name: kubeconfig
          mountPath: "/etc/kubernetes/kubeconfig"
        - name: resource-dir
          mountPath: "/config"
        - name: conf-dir
          mountPath: "/etc/mdns"
        imagePullPolicy: IfNotPresent
      containers:
      - name: mdns-publisher
        image: {{.Images.mdnsPublisherImage}}
        args:
        - "--debug"
        resources:
          requests:
            cpu: 100m
            memory: 200Mi
        volumeMounts:
        - name: conf-dir
          mountPath: "/etc/mdns"
        livenessProbe:
          exec:
            command:
            - pgrep
            - mdns-publisher
          initialDelaySeconds: 10
        terminationMessagePolicy: FallbackToLogsOnError
        imagePullPolicy: IfNotPresent
      hostNetwork: true
      tolerations:
      - operator: Exists
      priorityClassName: system-node-critical
    status: {}