mirror of
https://github.com/rancher/types.git
synced 2025-08-28 00:30:31 +00:00
Types for k3s Rancher integration
This updates the cluster object with support for k3s clusters. The K3sConfig type also includes an embedded struct to handle upgrading.
This commit is contained in:
parent
3455ef4f91
commit
961aac3e74
@ -68,9 +68,7 @@ const (
|
||||
ClusterDriverImported = "imported"
|
||||
ClusterDriverLocal = "local"
|
||||
ClusterDriverRKE = "rancherKubernetesEngine"
|
||||
ClusterDriverGKE = "googleKubernetesEngine"
|
||||
ClusterDriverEKS = "amazonElasticContainerService"
|
||||
ClusterDriverAKS = "azureKubernetesService"
|
||||
ClusterDriverK3s = "k3s"
|
||||
)
|
||||
|
||||
// +genclient
|
||||
@ -111,6 +109,7 @@ type ClusterSpec struct {
|
||||
DisplayName string `json:"displayName" norman:"required"`
|
||||
Description string `json:"description"`
|
||||
Internal bool `json:"internal" norman:"nocreate,noupdate"`
|
||||
K3sConfig *K3sConfig `json:"k3sConfig,omitempty"`
|
||||
ImportedConfig *ImportedConfig `json:"importedConfig,omitempty" norman:"nocreate,noupdate"`
|
||||
GoogleKubernetesEngineConfig *MapStringInterface `json:"googleKubernetesEngineConfig,omitempty"`
|
||||
AzureKubernetesServiceConfig *MapStringInterface `json:"azureKubernetesServiceConfig,omitempty"`
|
||||
|
18
apis/management.cattle.io/v3/k3s_types.go
Normal file
18
apis/management.cattle.io/v3/k3s_types.go
Normal file
@ -0,0 +1,18 @@
|
||||
package v3
|
||||
|
||||
import "k8s.io/apimachinery/pkg/version"
|
||||
|
||||
//K3sConfig provides desired configuration for k3s clusters
|
||||
type K3sConfig struct {
|
||||
// k3s Kubernetes version
|
||||
Version *version.Info `yaml:"kubernetes_version" json:"kubernetesVersion,omitempty"`
|
||||
K3sUpgradeStrategy
|
||||
}
|
||||
|
||||
//K3sUpgradeStrategy provides configuration to the downstream system-upgrade-controller
|
||||
type K3sUpgradeStrategy struct {
|
||||
// How many controlplane nodes should be upgrade at time, defaults to 1
|
||||
ServerConcurrency int `yaml:"server_concurrency" json:"serverConcurrency,omitempty"`
|
||||
// How many workers should be upgraded at a time
|
||||
WorkerConcurrency int `yaml:"worker_concurrency" json:"workerConcurrency,omitempty"`
|
||||
}
|
Loading…
Reference in New Issue
Block a user