-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
Merge pull request #642 from duanmengkk/feature_kubenest
support --configfile for kubenest
Showing
21 changed files
with
504 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package config | ||
|
||
import ( | ||
clientset "k8s.io/client-go/kubernetes" | ||
restclient "k8s.io/client-go/rest" | ||
componentbaseconfig "k8s.io/component-base/config" | ||
|
||
"github.com/kosmos.io/kosmos/pkg/apis/kosmos/v1alpha1" | ||
) | ||
|
||
// Config has all the configurations for kubenest. | ||
type Config struct { | ||
KubeNestOptions v1alpha1.KubeNestConfiguration | ||
Client clientset.Interface | ||
RestConfig *restclient.Config | ||
KubeconfigStream []byte | ||
// LeaderElection is optional. | ||
LeaderElection componentbaseconfig.LeaderElectionConfiguration | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package v1alpha1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
type KubeNestType string | ||
|
||
const ( | ||
KubeInKube KubeNestType = "Kube in kube" | ||
KosmosKube KubeNestType = "Kosmos in kube" | ||
) | ||
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// KubeNestConfiguration defines the configuration for KubeNest | ||
type KubeNestConfiguration struct { | ||
// TypeMeta contains the API version and kind. | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
KubeNestType KubeNestType `yaml:"kubeNestType" json:"kubeNestType,omitempty"` | ||
|
||
KosmosKubeConfig KosmosKubeConfig `yaml:"kosmosKubeConfig" json:"kosmosKubeConfig,omitempty"` | ||
|
||
KubeInKubeConfig KubeInKubeConfig `yaml:"kubeInKubeConfig" json:"kubeInKubeConfig,omitempty"` | ||
} | ||
|
||
type EtcdCluster struct { | ||
} | ||
|
||
type KosmosKubeConfig struct { | ||
// AllowNodeOwnbyMulticluster indicates whether to allow nodes to be owned by multiple clusters. | ||
AllowNodeOwnbyMulticluster bool `yaml:"allowNodeOwnbyMulticluster" json:"allowNodeOwnbyMulticluster,omitempty"` | ||
} | ||
|
||
type KubeInKubeConfig struct { | ||
// todo Group according to the parameters of apiserver, etcd, coredns, etc. | ||
|
||
ForceDestroy bool `yaml:"forceDestroy" json:"forceDestroy,omitempty"` | ||
AnpMode string `yaml:"anpMode" json:"anpMode,omitempty"` | ||
AdmissionPlugins bool `yaml:"admissionPlugins" json:"admissionPlugins,omitempty"` | ||
ApiServerReplicas int `yaml:"apiServerReplicas" json:"apiServerReplicas,omitempty"` | ||
ClusterCIDR string `yaml:"clusterCIDR" json:"clusterCIDR,omitempty"` | ||
ETCDStorageClass string `yaml:"etcdStorageClass" json:"etcdStorageClass,omitempty"` | ||
ETCDUnitSize string `yaml:"etcdUnitSize" json:"etcdUnitSize,omitempty"` | ||
|
||
//// Etcd contains the configuration for the etcd statefulset. | ||
//Etcd EtcdCluster `yaml:"etcd" json:"etcd,omitempty"` | ||
|
||
//// DNS contains the configuration for the dns server in kubernetes. | ||
//DNS DNS `yaml:"dns" json:"dns,omitempty"` | ||
// | ||
//// Kubernetes contains the configuration for the kubernetes. | ||
//Kubernetes Kubernetes `yaml:"kubernetes" json:"kubernetes,omitempty"` | ||
// | ||
//// Network contains the configuration for the network in kubernetes cluster. | ||
//Network NetworkConfig `yaml:"network" json:"network,omitempty"` | ||
// | ||
//// Storage contains the configuration for the storage in kubernetes cluster. | ||
//Storage StorageConfig `yaml:"storage" json:"storage,omitempty"` | ||
// | ||
//// Registry contains the configuration for the registry in kubernetes cluster. | ||
//Registry RegistryConfig `yaml:"registry" json:"registry,omitempty"` | ||
} |
Oops, something went wrong.