Closed kkaempf closed 2 years ago
I can edit the machineRegistration
in the Rancher Manager UI. Adding emulate-tpm: true
gets accepted and stored.
Adding emulated-tpm-hash: 4
does not get stored.
elemental-operator
log doesn't show anything suspicious:
time="2022-08-03T12:06:15Z" level=info msg="Operator version 0.4.2, commit f4ba471, commit date git20220803" │
│ time="2022-08-03T12:06:15Z" level=info msg="Starting controller at namespace cattle-elemental-system. Upgrade sync interval at: 1h0m0s" │
│ time="2022-08-03T12:06:15Z" level=info msg="Applying CRD managedosimages.elemental.cattle.io" │
│ time="2022-08-03T12:06:15Z" level=info msg="Applying CRD machineinventories.elemental.cattle.io" │
│ time="2022-08-03T12:06:15Z" level=info msg="Applying CRD machineregistrations.elemental.cattle.io" │
│ time="2022-08-03T12:06:15Z" level=info msg="Applying CRD managedosversions.elemental.cattle.io" │
│ time="2022-08-03T12:06:15Z" level=info msg="Applying CRD managedosversionchannels.elemental.cattle.io" │
│ time="2022-08-03T12:06:15Z" level=info msg="Applying CRD machineinventoryselectors.elemental.cattle.io" │
│ time="2022-08-03T12:06:15Z" level=info msg="Applying CRD machineinventoryselectortemplates.elemental.cattle.io" │
│ time="2022-08-03T12:06:15Z" level=info msg="Creating event broadcaster for mos-bundle" │
│ time="2022-08-03T12:06:15Z" level=info msg="Creating event broadcaster for machine-registration" │
│ time="2022-08-03T12:06:15Z" level=info msg="Starting fleet.cattle.io/v1alpha1, Kind=Bundle controller" │
│ time="2022-08-03T12:06:15Z" level=info msg="Starting elemental.cattle.io/v1beta1, Kind=ManagedOSImage controller" │
│ time="2022-08-03T12:06:15Z" level=info msg="Starting elemental.cattle.io/v1beta1, Kind=MachineInventory controller" │
│ time="2022-08-03T12:06:15Z" level=info msg="Starting elemental.cattle.io/v1beta1, Kind=MachineInventorySelector controller" │
│ time="2022-08-03T12:06:15Z" level=info msg="Starting elemental.cattle.io/v1beta1, Kind=MachineRegistration controller" │
│ time="2022-08-03T12:06:15Z" level=info msg="Starting /v1, Kind=ServiceAccount controller" │
│ time="2022-08-03T12:06:15Z" level=info msg="Starting management.cattle.io/v3, Kind=Setting controller" │
│ time="2022-08-03T12:06:15Z" level=info msg="Starting cluster.x-k8s.io/v1beta1, Kind=Machine controller" │
│ time="2022-08-03T12:06:15Z" level=info msg="Starting elemental.cattle.io/v1beta1, Kind=ManagedOSVersion controller" │
│ time="2022-08-03T12:06:15Z" level=info msg="Starting /v1, Kind=Secret controller" │
│ time="2022-08-03T12:06:15Z" level=info msg="Starting elemental.cattle.io/v1beta1, Kind=ManagedOSVersionChannel controller" │
│ time="2022-08-03T12:06:15Z" level=info msg="Starting steve aggregation client" │
I think this may have something to do with the fact that we dont have the config as part of the apis, so it doesnt generate some methods for it for complex classes. Something like missing deep copy or something like that.
Weirdly enough adding logging to the deepcopy shows that at that part the registration is already empty??? Not sure what is going on as this is from a yaml, there is nothing else in the middle.... need to keep digging
weirdly enough, if you apply the same yaml twice then registration gets the no-smbios key only?????
This is what is received on kubectl appy
config.Config{
Elemental: config.Elemental{
Install: config.Install{
Firmware: \"\",
Device: \"/dev/vda\",
NoFormat: true,
ConfigURLs: nil,
ISO: \"\",
SystemURI: \"\",
Debug: true,
TTY: \"\",
PowerOff: false,
Reboot: true,
EjectCD: false,
},
Registration: config.Registration{
URL: \"\",
CACert: \"\",
EmulateTPM: false,
EmulatedTPMSeed: 0,
NoSMBIOS: false,
Labels: map[string]string(nil),
},
SystemAgent: config.SystemAgent{
URL: \"\",
Token: \"\",
SecretName: \"\",
SecretNamespace: \"\",
},
},
CloudConfig: map[string]interface {}{
\"users\": []interface {}{
map[string]interface {}{
\"name\": \"root\",
\"passwd\": \"root\",
},
},
},
}
with this test yaml:
apiVersion: elemental.cattle.io/v1beta1
kind: MachineRegistration
metadata:
name: test-nodes
namespace: fleet-default
spec:
config:
cloud-config:
users:
- name: root
passwd: root
elemental:
registration:
emulated-tpm: true
emulate-tpm-seed: 4
no-smbios: false
install:
automatic: true
reboot: true
debug: true
no-format: true
device: /dev/vda
machineName: m-${System Information/Manufacturer}-${System Information/Product Name}-${System Information/UUID}
machineInventoryLabels:
cluster-id: kvm-cluster
So its getting the cloud-config and install parts correctly but not the registration? WTF is going on??
emulated-tpm
IS emulate-tpm
emulate-tpm-seed
IS emulated-tpm-seed
using the proper fields makes it show, this is not a bug but a lack of docs or maybe a non-clear-enough-keys
Running
kubectl apply -f
with this registration.yamllets elemental-operator drop the
registration:
components. The Rancher manager UI only shows (note the empty registration value under spec.config.elemental)