Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-57360

[OCP 4.14] openstack-kubelet-nodename.service fails when OCP is deployed by OpenStack Ironic

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Low
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      openstack-kubelet-nodename.service fails when we deploy OCP 4.14 on baremetal nodes using OpenStack Ironic on RHOSP 17.1 + ML2/OVN environments.

      OpenStack usually provide metadata using the following two ways

      • Metadata service hosted on 169.254.169.254
      • config-drive which is stored on "config-2" labeled local partition

      When we create an instance on a baremetal node on a RHOSP 17.1 + ML2/OVN environment, the instance cannot access the metadata service hosted on 169.254.169.254 ( if my understanding is correct, this is expected behavior and limitation).
      The instance should refers to the config-drive instead of the metadata server.

      However, on OCP 4.14, openstack-kubelet-nodename.service accesses the metadata server on 169.254.169.254, and it doesn't refer to config-drive.

       

      /etc/systemd/system/openstack-kubelet-nodename.service 
      
      [Unit]
      Description=Fetch kubelet node name from OpenStack metadata
      # Wait for NetworkManager to report it's online
      After=NetworkManager-wait-online.service
      # Run before kubelet
      Before=kubelet-dependencies.target
      
      [Service]
      ExecStart=/usr/local/bin/openstack-kubelet-nodename
      Type=oneshot
      
      [Install]
      WantedBy=network-online.target

       

      /usr/local/bin/openstack-kubelet-nodename
      
      #!/bin/bash
      set -e -o pipefail
      
      NODECONF=/etc/systemd/system/kubelet.service.d/20-openstack-node-name.conf
      
      if [ -e "${NODECONF}" ]; then
          echo "Not replacing existing ${NODECONF}"
          exit 0
      fi
      
      # For compatibility with the OpenStack in-tree provider
      # Set node name to be instance name instead of the default FQDN hostname
      #
      # https://docs.openstack.org/nova/victoria/user/metadata.html#metadata-openstack-format
      name=$(curl -s http://169.254.169.254/openstack/2012-08-10/meta_data.json | jq -re .name)
      cat > "${NODECONF}" <<EOF
      [Service]
      Environment="KUBELET_NODE_NAME=${name}"
      EOF 

       

      That's why openstack-kubelet-nodename.service fails when we deploy OCP 4.14 on baremetal nodes using OpenStack Ironic on RHOSP 17.1 + ML2/OVN environments.

      This issue won't occur in the latest OCP because of the following change.
      By the followoing change, openstack-kubelet-nodename.service refers to config-drive when it's available.

       

              rdobosz Roman Dobosz
              rhn-support-yatanaka Yamato Tanaka
              None
              None
              Itshak Brown Itshak Brown
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: