-
Notifications
You must be signed in to change notification settings - Fork 630
✨ Initial dedicated hosts implementation #5548
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -233,6 +233,18 @@ type AWSMachineSpec struct { | |
// If marketType is not specified and spotMarketOptions is provided, the marketType defaults to "Spot". | ||
// +optional | ||
MarketType MarketType `json:"marketType,omitempty"` | ||
|
||
// HostID specifies the Dedicated Host on which the instance must be started. | ||
// +optional | ||
HostID *string `json:"hostID,omitempty"` | ||
|
||
// HostAffinity specifies the dedicated host affinity setting for the instance. | ||
// When hostAffinity is set to host, an instance started onto a specific host always restarts on the same host if stopped. | ||
// When hostAffinity is set to default, and you stop and restart the instance, it can be restarted on any available host. | ||
// When HostAffinity is defined, HostID is required. | ||
// +optional | ||
// +kubebuilder:validation:Enum:=default;host | ||
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. NIt, these should be PascalCase to be consistent with K8s conventions |
||
HostAffinity *string `json:"hostAffinity,omitempty"` | ||
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. No need for this to be a pointer as the zero value is not a valid choice |
||
} | ||
|
||
// CloudInit defines options related to the bootstrapping systems where | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
--- | ||
apiVersion: cluster.x-k8s.io/v1beta1 | ||
kind: MachineDeployment | ||
metadata: | ||
name: "${CLUSTER_NAME}-md-dh" | ||
spec: | ||
clusterName: "${CLUSTER_NAME}" | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
template: | ||
spec: | ||
clusterName: "${CLUSTER_NAME}" | ||
version: "${KUBERNETES_VERSION}" | ||
bootstrap: | ||
configRef: | ||
name: "${CLUSTER_NAME}-md-dh" | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
infrastructureRef: | ||
name: "${CLUSTER_NAME}-md-dh" | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
kind: AWSMachineTemplate | ||
--- | ||
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2 | ||
kind: AWSMachineTemplate | ||
metadata: | ||
name: "${CLUSTER_NAME}-md-dh" | ||
spec: | ||
template: | ||
spec: | ||
instanceType: "${AWS_NODE_MACHINE_TYPE}" | ||
iamInstanceProfile: "nodes.cluster-api-provider-aws.sigs.k8s.io" | ||
sshKeyName: "${AWS_SSH_KEY_NAME}" | ||
hostID: "${HOST_ID}" | ||
hostAffinity: "${HOST_AFFINITY}" | ||
--- | ||
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 | ||
kind: KubeadmConfigTemplate | ||
metadata: | ||
name: "${CLUSTER_NAME}-md-dh" | ||
spec: | ||
template: | ||
spec: | ||
joinConfiguration: | ||
nodeRegistration: | ||
name: '{{ ds.meta_data.local_hostname }}' | ||
kubeletExtraArgs: | ||
cloud-provider: external |
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.
Ideally this would set both minimum and maximum length constraints, also, is there a pattern that is valid for this?
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.
good callouts @JoelSpeed , will follow up with another PR. there is a pattern we could check for validation