-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement v1alpha3 #373
implement v1alpha3 #373
Changes from all commits
d92cd33
9538323
07d72c8
22a4f19
82f2329
724d800
fb4b51a
92391f2
ebde768
de47e86
b840f28
ec51791
4a757e3
06ae2af
ceabf34
71c05a3
3cbfd8a
2ac298d
af80976
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,58 +25,60 @@ import ( | |
|
||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// Config groups all nodes in the `kind` Config. | ||
type Config struct { | ||
// Cluster contains kind cluster configuration | ||
type Cluster struct { | ||
// TypeMeta representing the type of the object and its API schema version. | ||
metav1.TypeMeta | ||
|
||
// Nodes contains the list of nodes defined in the `kind` Config | ||
Nodes []Node `json:"nodes,"` | ||
} | ||
// Nodes contains the list of nodes defined in the `kind` Cluster | ||
// If unset this will default to a single control-plane node | ||
// Note that if more than one control plane is specified, an external | ||
// control plane load balancer will be provisioned implicitly | ||
Nodes []Node | ||
|
||
/* Advanced fields */ | ||
|
||
// Node contains settings for a node in the `kind` Config. | ||
// A node in kind config represent a container that will be provisioned with all the components | ||
// required for the assigned role in the Kubernetes cluster. | ||
// If replicas is set, the desired node replica number will be generated. | ||
type Node struct { | ||
// Replicas is the number of desired node replicas. | ||
// Defaults to 1 | ||
Replicas *int32 | ||
// Role defines the role of the node in the in the Kubernetes cluster managed by `kind` | ||
// Defaults to "control-plane" | ||
Role NodeRole | ||
// Image is the node image to use when running the cluster | ||
// TODO(bentheelder): split this into image and tag? | ||
Image string | ||
// KubeadmConfigPatches are applied to the generated kubeadm config as | ||
// strategic merge patches to `kustomize build` internally | ||
// https://github.com/kubernetes/community/blob/master/contributors/devel/strategic-merge-patch.md | ||
// This should be an inline yaml blob-string | ||
KubeadmConfigPatches []string | ||
|
||
// KubeadmConfigPatchesJSON6902 are applied to the generated kubeadm config | ||
// as patchesJson6902 to `kustomize build` | ||
KubeadmConfigPatchesJSON6902 []kustomize.PatchJSON6902 | ||
} | ||
|
||
// Node contains settings for a node in the `kind` Cluster. | ||
// A node in kind config represent a container that will be provisioned with all the components | ||
// required for the assigned role in the Kubernetes cluster | ||
type Node struct { | ||
// Role defines the role of the node in the in the Kubernetes cluster | ||
// created by kind | ||
// | ||
// Defaults to "control-plane" | ||
Role NodeRole | ||
|
||
// Image is the node image to use when creating this node | ||
// If unset a default image will be used, see defaults.Image | ||
Image string | ||
|
||
/* Advanced fields */ | ||
|
||
// ExtraMounts describes additional mount points for the node container | ||
// These may be used to bind a hostpath | ||
ExtraMounts []cri.Mount `json:"extraMounts,omitempty"` | ||
// These may be used to bind a hostPath | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ER isn't it implied that they're bound to the current node? |
||
ExtraMounts []cri.Mount | ||
} | ||
|
||
// NodeRole defines possible role for nodes in a Kubernetes cluster managed by `kind` | ||
type NodeRole string | ||
|
||
const ( | ||
// ControlPlaneRole identifies a node that hosts a Kubernetes control-plane | ||
// NB. in single node clusters, control-plane nodes act also as a worker nodes | ||
// ControlPlaneRole identifies a node that hosts a Kubernetes control-plane. | ||
// NOTE: in single node clusters, control-plane nodes act also as a worker | ||
// nodes, in which case the taint will be removed. see: | ||
// https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/#control-plane-node-isolation | ||
ControlPlaneRole NodeRole = "control-plane" | ||
// WorkerRole identifies a node that hosts a Kubernetes worker | ||
WorkerRole NodeRole = "worker" | ||
// ExternalEtcdRole identifies a node that hosts an external-etcd instance. | ||
// WARNING: this node type is not yet implemented! | ||
// Please note that `kind` nodes hosting external etcd are not kubernetes nodes | ||
ExternalEtcdRole NodeRole = "external-etcd" | ||
// ExternalLoadBalancerRole identifies a node that hosts an external load balancer for API server | ||
// in HA configurations. | ||
// WARNING: this node type is not yet implemented! | ||
// Please note that `kind` nodes hosting external load balancer are not kubernetes nodes | ||
ExternalLoadBalancerRole NodeRole = "external-load-balancer" | ||
) |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I didn't think defaults were usually applied as part of the internal API version? Although I could definitely be wrong 😄 (/me goes away to dig into Kubernetes)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have to default the internal type as well currently because its used by library consumers 🤔