Uploaded image for project: 'Red Hat Advanced Cluster Management'
  1. Red Hat Advanced Cluster Management
  2. ACM-9535

MCE - custom MachineSet labels

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • Cluster Lifecycle
    • False
    • None
    • False
    • No
    • -

      Description of problem:

      The creation on infra MachineSets through hive MachinePool doesn't create labels  'machine.openshift.io/cluster-api-machine-role'
      'machine.openshift.io/cluster-api-machine-type' l on the MachineSet and the Machines have these labels set to 'worker' .

      OpenShift documentation [1] describes that these labels needs to be defined when creating infrastructure MachineSets.

      Version-Release number of selected component (if applicable):

      Any

      How reproducible:

      Always

      Steps to Reproduce:

      1. Create a hive MachinePool to define an infra MachineSet:
      apiVersion: hive.openshift.io/v1
      kind: MachinePool
      metadata:
        labels:
          argocd.argoproj.io/instance: ####
        name: #####
        namespace: ####
      spec:
        clusterDeploymentRef:
          name: ####
        labels:
          node-role.kubernetes.io: infra
          node-role.kubernetes.io/infra: ''
        name: infra
        platform:
          vsphere:
            coresPerSocket: 2
            cpus: 4
            memoryMB: 16392
            osDisk:
              diskSizeGB: 120
            resourcePool: #####
        replicas: 3
        taints:
          - effect: NoSchedule
            key: node-role.kubernetes.io/infra
            value: reserved
          - effect: NoExecute
            key: node-role.kubernetes.io/infra
            value: reserved 

      2 . The created MachineSet doesn't define labels on the MachineSet :

      apiVersion: machine.openshift.io/v1beta1
      kind: MachineSet
      metadata:
        annotations:
          machine.openshift.io/memoryMb: '16392'
          machine.openshift.io/vCPU: '4'
        name: ####-infra-0
        namespace: openshift-machine-api
        labels:
          hive.openshift.io/machine-pool: infra
          hive.openshift.io/managed: 'true'
          machine.openshift.io/cluster-api-cluster: ####
      spec:
        replicas: 3
        selector:
          matchLabels:
            machine.openshift.io/cluster-api-cluster: ####
            machine.openshift.io/cluster-api-machineset: ####-infra-0
        template:
          metadata:
            labels:
              machine.openshift.io/cluster-api-cluster: ####
              machine.openshift.io/cluster-api-machine-role: worker
              machine.openshift.io/cluster-api-machine-type: worker
              machine.openshift.io/cluster-api-machineset: ####-infra-0
          spec:
            lifecycleHooks: {}
            metadata:
              labels:
                node-role.kubernetes.io: infra
                node-role.kubernetes.io/infra: ''
            providerSpec:
              value:
                numCoresPerSocket: 2
                diskGiB: 120
                snapshot: ''
                userDataSecret:
                  name: worker-user-data
                memoryMiB: 16392
                credentialsSecret:
                  name: vsphere-cloud-credentials
                network:
                  devices:
                    - networkName: ####
                metadata:
                  creationTimestamp: null
                numCPUs: 4
                kind: VSphereMachineProviderSpec
                workspace:
                  datacenter: ####
                  datastore: >-
                    ####
                  folder: ####
                  resourcePool: ####
                  server: ####
                template: ####-rhcos
                apiVersion: machine.openshift.io/v1beta1
            taints:
              - effect: NoSchedule
                key: node-role.kubernetes.io/infra
                value: reserved
              - effect: NoExecute
                key: node-role.kubernetes.io/infra
                value: reserved 

      Actual results:

      The created MachineSet definition doesn't contain the following labels defined on the MachineSet Object:

      machine.openshift.io/cluster-api-machine-role
      machine.openshift.io/cluster-api-machine-type

      The created Machines have the labels set with 'worker' value:

      machine.openshift.io/cluster-api-machine-role: worker 
      machine.openshift.io/cluster-api-machine-type: worker 

      Nodes are correctly defined with 'infra' label:

              labels:
                node-role.kubernetes.io: infra
                node-role.kubernetes.io/infra: '' 

      Expected results:

      We would expect to be able have 'machine.openshift.io/cluster-api-machine-role'
      'machine.openshift.io/cluster-api-machine-type' labels defined on the MachineSet object as described in OpenShift documentation[1]

       [1] https://docs.openshift.com/container-platform/4.13/machine_management/creating-infrastructure-machinesets.html

      Additional info:

            efried.openshift Eric Fried
            rhn-support-malonso Maria Del Mar Alonso
            David Huynh David Huynh
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: