This message was deleted.
# harvester
a
This message was deleted.
o
Try to create a VM using UI and view the VM yaml which is allowed to be deployed by kubectl.
s
The yaml of a VM does not include things like the CloudInit user and network data.
b
Hi @sticky-summer-13450, we store cloudinit in secrets like:
Copy code
- cloudInitNoCloud:
          networkDataSecretRef:
            name: vm-test-w8anf
          secretRef:
            name: vm-test-w8anf
        name: cloudinitdisk
Copy code
apiVersion: v1
data:
  networkdata: ""
  userdata: I2Nsb3VkLWNvbmZpZwpwYXNzd29yZDogdGVzdApjaHBhc3N3ZDoKICBleHBpcmU6IGZhbHNlCnNzaF9wd2F1dGg6IHRydWUK
kind: Secret
metadata:
  creationTimestamp: "2022-12-26T02:59:48Z"
  labels:
    <http://harvesterhci.io/cloud-init-template|harvesterhci.io/cloud-init-template>: harvester
  name: vm-test-w8anf
  namespace: default
  ownerReferences:
  - apiVersion: <http://kubevirt.io/v1|kubevirt.io/v1>
    kind: VirtualMachine
    name: vm-test
    uid: e4f1a8f2-ff48-487d-8161-ed88efae93ac
  resourceVersion: "58593"
  uid: a315c846-3731-4011-ac12-d91b34e7266c
type: secret
s
Thanks @bland-farmer-13503. Do I need to use specific labels or names? Is the use of
kubectl
to manage VMs in Harvester supported and documented?
b
I think you don't need to use specific labels/names.
kubectl
management is not in Harvester document. If you want to control Harvester via command line tool, I suggest to use Harvester Terraform Provider. https://docs.harvesterhci.io/v1.1/terraform/
s
I suggest to use Harvester Terraform Provider
Fantastic, another tool to learn over the holiday season 🙂 Thank you for the advice.