Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-9443

when NodeSelector gets set on the openstackclient, the pod won't get recreated with it

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • rhos-18.0.2
    • rhos-18.0.0
    • openstack-operator
    • None
    • 2
    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • ?
    • ?
    • ?
    • None
    • Moderate

      the openstackclient crd supports passing a nodeselector https://github.com/openstack-k8s-operators/openstack-operator/blob/main/apis/client/v1beta1/openstackclient_types.go#L53 . It should be possible to set it via the openstackclient section in OpenStackControlPlane CR.

       

      current ctlplane openstackclient section:

      # oc get osctlplane controlplane -o yaml | yq .spec.openstackclient
      {
        "template": {
          "openStackConfigMap": "openstack-config",
          "openStackConfigSecret": "openstack-config-secret"
        }
      }
       
      

       

      Pod is scheduled to master-1

      # oc get pods -o wide |grep client
      ceph-client-edpm-deployment-post-ceph-openstack-edpm-7fzx8        0/1     Completed   0          2d19h   192.168.20.134   master-1   <none>           <none>
      openstackclient                                                   1/1     Running     0          2d19h   192.168.20.89    master-1   <none>           <none>
       
       
      

       

      Patch the ctlplane to set a nodeSelector for the openstackclient

      # oc patch osctlplane controlplane --type='merge' --patch '{"spec": {"openstackclient": {"template": { "nodeSelector": {"kubernetes.io/hostname": "master-0"}}}}}'
      openstackcontrolplane.core.openstack.org/controlplane patched
      # oc get osctlplane controlplane -o yaml | yq .spec.openstackclient
      {
        "template": {
          "nodeSelector": {
            "kubernetes.io/hostname": "master-0"
          },
          "openStackConfigMap": "openstack-config",
          "openStackConfigSecret": "openstack-config-secret"
        }
      }
      

       

      There is a bug right now that after setting the nodeSelector, the openstackclient pod won't get re-created with the nodeSelector. When deleting the openstackclient the new pod will receive the nodeSelector

      # oc delete pod openstackclient -n openstack
      # oc get pods openstackclient -o yaml | yq .spec.nodeSelector
      {
        "kubernetes.io/hostname": "master-0"
      }
      # oc get pods -o wide |grep openstackclient
      openstackclient                                                   1/1     Running     0          5m19s   192.168.16.204   master-0   <none>           <none>
      

       

            rhn-support-mschuppe Martin Schuppert
            rhn-support-mschuppe Martin Schuppert
            rhos-dfg-ospk8s
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: