Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Machine objects for master nodes contain libvirt providerSpec #32

Closed
russellb opened this issue Apr 2, 2019 · 5 comments
Closed

Machine objects for master nodes contain libvirt providerSpec #32

russellb opened this issue Apr 2, 2019 · 5 comments
Assignees

Comments

@russellb
Copy link
Member

russellb commented Apr 2, 2019

Here is a Machine created for a master node:

apiVersion: v1
items:
- apiVersion: machine.openshift.io/v1beta1
  kind: Machine
  metadata:
    creationTimestamp: 2019-04-02T13:24:13Z
    finalizers:
    - machine.machine.openshift.io
    generation: 1
    labels:
      sigs.k8s.io/cluster-api-cluster: ostest
      sigs.k8s.io/cluster-api-machine-role: master
      sigs.k8s.io/cluster-api-machine-type: master
    name: ostest-master-0
    namespace: openshift-machine-api
    resourceVersion: "2025"
    selfLink: /apis/machine.openshift.io/v1beta1/namespaces/openshift-machine-api/machines/ostest-master-0
    uid: 9b69b622-554a-11e9-8072-52fdfc072182
  spec:
    metadata:
      creationTimestamp: null
    providerSpec:
      value:
        autostart: false
        cloudInit: null
        domainMemory: 0
        domainVcpu: 0
        ignKey: ""
        ignition: null
        networkInterfaceAddress: ""
        networkInterfaceHostname: ""
        networkInterfaceName: ""
        networkUUID: ""
        uri: ""
        volume: null
    versions:
      kubelet: ""

Note the contents of the providerSpec. Those fields are for the libvirt platform, and not baremetal. Presumably we need some additional code in kni-installer which knows how to create the Machine asset specifically for the baremetal platform type. See installer/pkg/asset/machines/....

@russellb
Copy link
Member Author

russellb commented Apr 2, 2019

CC @mhrivnak

@russellb
Copy link
Member Author

russellb commented Apr 8, 2019

This applies to worker Machines as well:

apiVersion: machine.openshift.io/v1beta1
kind: Machine
metadata:
  creationTimestamp: 2019-04-08T18:38:06Z
  finalizers:
  - machine.machine.openshift.io
  generateName: ostest-worker-0-
  generation: 1
  labels:
    sigs.k8s.io/cluster-api-cluster: ostest
    sigs.k8s.io/cluster-api-machine-role: worker
    sigs.k8s.io/cluster-api-machine-type: worker
    sigs.k8s.io/cluster-api-machineset: ostest-worker-0
  name: ostest-worker-0-29nx9
  namespace: openshift-machine-api
  ownerReferences:
  - apiVersion: machine.openshift.io/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: MachineSet
    name: ostest-worker-0
    uid: 6c2e98b4-5a2d-11e9-bab8-1ada188246cf
  resourceVersion: "2746"
  selfLink: /apis/machine.openshift.io/v1beta1/namespaces/openshift-machine-api/machines/ostest-worker-0-29nx9
  uid: 7359033a-5a2d-11e9-bab8-1ada188246cf
spec:
  metadata:
    creationTimestamp: null
  providerSpec:
    value:
      autostart: false
      cloudInit: null
      domainMemory: 0
      domainVcpu: 0
      ignKey: ""
      ignition: null
      networkInterfaceAddress: ""
      networkInterfaceHostname: ""
      networkInterfaceName: ""
      networkUUID: ""
      uri: ""
      volume: null
  versions:
    kubelet: ""

@markmc
Copy link
Contributor

markmc commented May 16, 2019

Yeah, see:

func provider(clusterName string, networkInterfaceAddress string, platform *baremetal.Platform, userDataSecret string) *libvirtprovider.LibvirtMachineProviderConfig {
        // FIXME: baremetal                                                                                                                                                                                        
        return &libvirtprovider.LibvirtMachineProviderConfig{}
}

@russellb
Copy link
Member Author

The fix here is to update the installer to use BareMetalMachineProivderSpec, as documented here: https://github.com/metal3-io/cluster-api-provider-baremetal/blob/master/docs/api.md

This will require vendoring openshift/cluster-api-provider-baremetal to get the type.

openshift/cluster-api-provider-baremetal needs a rebase first to include this provider spec type though. I'll update this issue with that PR.

@russellb
Copy link
Member Author

openshift/cluster-api-provider-baremetal has now been updated and is ready to be used for this.

openshift/cluster-api-provider-baremetal#26

You should be able to vendor that repo now and use the provider spec type from it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants