diff --git a/apis/management.cattle.io/v3/cluster_types.go b/apis/management.cattle.io/v3/cluster_types.go index bb0ba613..1cc9111e 100644 --- a/apis/management.cattle.io/v3/cluster_types.go +++ b/apis/management.cattle.io/v3/cluster_types.go @@ -47,9 +47,8 @@ type ClusterSpec struct { DisplayName string `json:"displayName"` Description string `json:"description"` Internal bool `json:"internal" norman:"nocreate,noupdate"` - Imported bool `json:"imported" norman:"noupdate"` - Embedded bool `json:"embedded" norman:"noupdate"` - EmbeddedConfig *K8sServerConfig `json:"embeddedConfig"` + ImportedConfig *ImportedConfig `json:"importedConfig" norman:"noupdate"` + EmbeddedConfig *K8sServerConfig `json:"embeddedConfig" norman:"noupdate"` GoogleKubernetesEngineConfig *GoogleKubernetesEngineConfig `json:"googleKubernetesEngineConfig,omitempty"` AzureKubernetesServiceConfig *AzureKubernetesServiceConfig `json:"azureKubernetesServiceConfig,omitempty"` RancherKubernetesEngineConfig *RancherKubernetesEngineConfig `json:"rancherKubernetesEngineConfig,omitempty"` @@ -57,6 +56,10 @@ type ClusterSpec struct { DefaultClusterRoleForProjectMembers string `json:"defaultClusterRoleForProjectMembers,omitempty" norman:"type=reference[roleTemplate]"` } +type ImportedConfig struct { + KubeConfig string `json:"kubeConfig"` +} + type K8sServerConfig struct { AdmissionControllers []string `json:"admissionControllers,omitempty"` ServiceNetCIDR string `json:"serviceNetCidr,omitempty"` diff --git a/apis/management.cattle.io/v3/global_types.go b/apis/management.cattle.io/v3/global_types.go index 39750abe..0c854280 100644 --- a/apis/management.cattle.io/v3/global_types.go +++ b/apis/management.cattle.io/v3/global_types.go @@ -21,6 +21,8 @@ type ListenConfig struct { Description string `json:"description,omitempty"` Mode string `json:"mode,omitempty" norman:"type=enum,options=https|http|acme"` CACerts string `json:"caCerts,omitempty"` + CACert string `json:"caCert,omitempty"` + CAKey string `json:"caKey,omitempty"` Cert string `json:"cert,omitempty"` Key string `json:"key,omitempty" norman:"writeOnly"` Domains []string `json:"domains,omitempty"` diff --git a/apis/management.cattle.io/v3/machine_types.go b/apis/management.cattle.io/v3/machine_types.go index dfd1dce6..2edf1495 100644 --- a/apis/management.cattle.io/v3/machine_types.go +++ b/apis/management.cattle.io/v3/machine_types.go @@ -103,15 +103,29 @@ type MachineConfig struct { Annotations map[string]string `json:"annotations"` } +type CustomConfig struct { + // IP or FQDN that is fully resolvable and used for SSH communication + Address string `yaml:"address" json:"address,omitempty"` + // Optional - Internal address that will be used for components communication + InternalAddress string `yaml:"internal_address" json:"internalAddress,omitempty"` + // SSH user that will be used by RKE + User string `yaml:"user" json:"user,omitempty"` + // Optional - Docker socket on the node that will be used in tunneling + DockerSocket string `yaml:"docker_socket" json:"dockerSocket,omitempty"` + // SSH Private Key + SSHKey string `yaml:"ssh_key" json:"sshKey,omitempty"` +} + type MachineSpec struct { - NodeSpec v1.NodeSpec `json:"nodeSpec"` - Description string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - RequestedHostname string `json:"requestedHostname,omitempty" norman:"noupdate"` - ClusterName string `json:"clusterName,omitempty" norman:"type=reference[cluster],noupdate,required"` - Role []string `json:"role,omitempty" norman:"noupdate,type=array[enum],options=etcd|worker|controlplane"` - MachineTemplateName string `json:"machineTemplateName,omitempty" norman:"type=reference[machineTemplate],noupdate"` - UseInternalIPAddress bool `json:"useInternalIpAddress,omitempty" norman:"default=true,noupdate"` + NodeSpec v1.NodeSpec `json:"nodeSpec"` + CustomConfig *CustomConfig `json:"customConfig"` + Description string `json:"description,omitempty"` + DisplayName string `json:"displayName"` + RequestedHostname string `json:"requestedHostname,omitempty" norman:"noupdate"` + ClusterName string `json:"clusterName,omitempty" norman:"type=reference[cluster],noupdate,required"` + Role []string `json:"role,omitempty" norman:"noupdate,type=array[enum],options=etcd|worker|controlplane"` + MachineTemplateName string `json:"machineTemplateName,omitempty" norman:"type=reference[machineTemplate],noupdate"` + UseInternalIPAddress bool `json:"useInternalIpAddress,omitempty" norman:"default=true,noupdate"` } type MachineCommonParams struct { diff --git a/apis/management.cattle.io/v3/schema/schema.go b/apis/management.cattle.io/v3/schema/schema.go index 20b2da75..235b33f4 100644 --- a/apis/management.cattle.io/v3/schema/schema.go +++ b/apis/management.cattle.io/v3/schema/schema.go @@ -253,7 +253,11 @@ func userTypes(schema *types.Schemas) *types.Schemas { func globalTypes(schema *types.Schemas) *types.Schemas { return schema. - AddMapperForType(&Version, v3.ListenConfig{}, m.DisplayName{}). + AddMapperForType(&Version, v3.ListenConfig{}, + m.DisplayName{}, + m.Drop{Field: "caKey"}, + m.Drop{Field: "caCert"}, + ). MustImport(&Version, v3.ListenConfig{}). MustImportAndCustomize(&Version, v3.Setting{}, func(schema *types.Schema) { schema.MustCustomizeField("name", func(f types.Field) types.Field {