kubermatic / kubeone

Kubermatic KubeOne automate cluster operations on all your cloud, on-prem, edge, and IoT environments.
https://kubeone.io
Apache License 2.0
1.36k stars 231 forks source link

[brainstorm] v1beta1 API ideas #828

Closed kron4eg closed 4 years ago

kron4eg commented 4 years ago

This issue will serve as a collection of ideas to gather for new API version. Later good ideas will be included into the proposal and eventually implemented.

EDIT Things TODO:

kron4eg commented 4 years ago

Every cloud provider has own settings, defined in corresponding struct.

diff --git pkg/apis/kubeone/types.go pkg/apis/kubeone/types.go
index c58555f..d8fd8f6 100644
--- pkg/apis/kubeone/types.go
+++ pkg/apis/kubeone/types.go
@@ -104,9 +104,17 @@ const (

 // CloudProviderSpec describes the cloud provider that is running the machines
 type CloudProviderSpec struct {
-   Name        CloudProviderName `json:"name"`
-   External    bool              `json:"external"`
-   CloudConfig string            `json:"cloudConfig"`
+   External     bool              `json:"external"`
+   CloudConfig  string            `json:"cloudConfig"`
+   AWS          *AWSSpec          `json:"aws"`
+   Azure        *AzureSpec        `json:"azure"`
+   Openstack    *OpenstackSpec    `json:"openstack"`
+   Hetzner      *HetznerSpec      `json:"hetzner"`
+   Digitalocean *DigitaloceanSpec `json:"digitalocean"`
+   Packet       *PacketSpec       `json:"packet"`
+   Vsphere      *VsphereSpec      `json:"vsphere"`
+   Gce          *GceSpec          `json:"gce"`
+   None         *NoneSpec         `json:"none"`
 }

 // VersionConfig describes the versions of components that are installed on the machines
kron4eg commented 4 years ago

Machine controller takes as cloud provider whatever is configured at CloudProviderSpec

diff --git pkg/apis/kubeone/types.go pkg/apis/kubeone/types.go
index c58555f..8ece034 100644
--- pkg/apis/kubeone/types.go
+++ pkg/apis/kubeone/types.go
@@ -201,9 +201,6 @@ type NetworkConfig struct {
 // MachineControllerConfig configures kubermatic machine-controller deployment
 type MachineControllerConfig struct {
    Deploy bool `json:"deploy"`
-   // Provider is provider to be used for machine-controller
-   // Defaults and must be same as chosen cloud provider, unless cloud provider is set to None
-   Provider CloudProviderName `json:"provider"`
 }

 // Features controls what features will be enabled on the cluster
kron4eg commented 4 years ago

CNI provider configs are defined in own spec structures.

diff --git pkg/apis/kubeone/types.go pkg/apis/kubeone/types.go
index c58555f..5b7c7d1 100644
--- pkg/apis/kubeone/types.go
+++ pkg/apis/kubeone/types.go
@@ -150,10 +150,9 @@ const (

 // CNI config
 type CNI struct {
-   // Provider choice
-   Provider CNIProvider `json:"provider"`
-   // Encrypted enables encryption for supported CNI plugins
-   Encrypted bool `json:"encrypted"`
+   Canal    *CanalSpec    `json:"canal"`
+   Calico   *CalicoSpec   `json:"calico"`
+   WeaveNet *WeaveNetSpec `json:"weaveNet"`
 }

 // ProxyConfig configures proxy for the Docker daemon and is used by KubeOne scripts
kron4eg commented 4 years ago

Taints == nil should be distinguished from len(Taints) == 0

diff --git pkg/apis/kubeone/types.go pkg/apis/kubeone/types.go
index c58555f..278f4be 100644
--- pkg/apis/kubeone/types.go
+++ pkg/apis/kubeone/types.go
@@ -71,7 +71,13 @@ type HostConfig struct {
    BastionUser       string `json:"bastionUser"`
    Hostname          string `json:"hostname"`
    IsLeader          bool   `json:"isLeader"`
-   Untaint           bool   `json:"untaint"`
+
+   // If not provided (i.e. nil) defaults to TaintEffectNoSchedule, with key
+   // node-role.kubernetes.io/master.
+   // Explicitly empty (i.e. []corev1.Taint{}) means no taints.
+   //
+   // Taints == nil should be distinguished from len(Taints) == 0
+   Taints []corev1.Taint `json:"taints,omitempty"`

    // Information populated at the runtime
    OperatingSystem string `json:"-"`
kron4eg commented 4 years ago

Add operating system ENUM

xmudrii commented 4 years ago

https://github.com/kubermatic/kubeone/pull/882#discussion_r415645040

xmudrii commented 4 years ago

All relevant tasks are done. /close

kubermatic-bot commented 4 years ago

@xmudrii: Closing this issue.

In response to [this](https://github.com/kubermatic/kubeone/issues/828#issuecomment-641196473): >All relevant tasks are done. >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.