dashboard
dashboard copied to clipboard
[Bug] Cannot create RKE2 cluster from yaml view
Setup
- Rancher version:
v2.9-head
(2b53406
) - Rancher UI Extensions: N/A
- Browser type & version: FF 125.0.3
Describe the bug
When attempting to provision an RKE2 cluster from the YAML view, the formatting of the generated yaml is incorrect, causing the creation to fail.
To Reproduce
- Install Rancher
v2.9-head
- Create RKE2 cluster
- Select "Edit as YAML"
- Attempt to create the cluster
Result An error banner shows:
bad indentation of a mapping entry (13:56)
10 | ...
11 | ... t
12 | ...
13 | ... ustomization: overrideAffinity: {}
-----------------------------------------^
14 | ...
15 | ... ments: {}
Screenshots
Additional context
It appears that the schema returned is broken, there are a few instances with incorrect spacing and two duplicate entries.
- Incorrect spacing:
-
clusterAgentDeploymentCustomization: overrideAffinity: {}
-
fleetAgentDeploymentCustomization: overrideAffinity: {}
-
rkeConfig: chartValues:
-
- duplicate entries:
-
appendTolerations: []
-
overrideResourceRequirements: {}
-
Yaml returned for rke2 config
apiVersion: provisioning.cattle.io/v1
kind: Cluster
metadata:
name: #string
annotations:
{}
# key: string
labels:
{}
# key: string
namespace: fleet-default
spec:
clusterAgentDeploymentCustomization: overrideAffinity: {}
appendTolerations: []
overrideResourceRequirements: {}
defaultPodSecurityAdmissionConfigurationTemplateName: ''
fleetAgentDeploymentCustomization: overrideAffinity: {}
appendTolerations: []
overrideResourceRequirements: {}
kubernetesVersion: v1.28.9+rke2r1
localClusterAuthEndpoint:
caCerts: ''
enabled: false
fqdn: ''
rkeConfig: chartValues:
rke2-calico: {}
upgradeStrategy:
controlPlaneConcurrency: '1'
controlPlaneDrainOptions:
deleteEmptyDirData: true
disableEviction: false
enabled: false
force: false
gracePeriod: -1
ignoreDaemonSets: true
skipWaitForDeleteTimeoutSeconds: 0
timeout: 120
workerConcurrency: '1'
workerDrainOptions:
deleteEmptyDirData: true
disableEviction: false
enabled: false
force: false
gracePeriod: -1
ignoreDaemonSets: true
skipWaitForDeleteTimeoutSeconds: 0
timeout: 120
machineGlobalConfig:
cni: calico
disable-kube-proxy: false
etcd-expose-metrics: false
profile: null
machineSelectorConfig:
- config:
protect-kernel-defaults: false
etcd:
disableSnapshots: false
s3: null
snapshotRetention: 5
snapshotScheduleCron: 0 */5 * * *
registries:
configs: {}
mirrors: {}
machinePools: []
machineSelectorConfig:
- config: {}
# agentEnvVars: string
# cloudCredentialSecretName: string
# clusterAPIConfig: string
# defaultClusterRoleForProjectMembers: string
# defaultPodSecurityPolicyTemplateName: string
# enableNetworkPolicy: string
# redeploySystemAgentGeneration: int
__clone: true
It looks like a lot of the spec props have lost their hierarchy
The schema
looks ok, we should check value that goes into the yaml converter
This could be impacted by https://github.com/rancher/rancher/issues/45157, @MbolotSuse & @tomleb might be able to provide a debug image to validate that fix against this bug.
In the mean time we should still confirm the json object we convert to yaml is correct.
Taking blocker off for now though this is important to fix before we release 2.9.0
@richard-cox I'm working on https://github.com/rancher/rancher/issues/45157 now. I need to rebase my changes on top of @MbolotSuse 's fix, which was also affecting the schema definitions. Once that's done (by EOD) I'll ping you.
EDIT: To clarify, I don't know if the issue I'm working on causes what you see here.
Tom has kindly got an image ready for us to test with, check in with him for details