-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
106 additions
and
0 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
80 changes: 80 additions & 0 deletions
80
docs/content/how-to/automated-machine-management/node-autoprovisioning.md
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,80 @@ | ||
--- | ||
title: Node Autoprovisioning | ||
--- | ||
|
||
# Node Autoprovisoning | ||
|
||
## Context and Considerations | ||
|
||
Node Autoprovisoning is an experimental feature in Hypershift and it is enabled behind a feature gate. | ||
To use it the Hypershift Operator needs to run with --feature-gates=Autoprovision=true. | ||
|
||
We implement autoprovision via Karpenter. When the feature is enabled we handle everything for the cluster consumer so a cluster admin can just create regular karpenter resources against their guest cluster at any time. | ||
|
||
```yaml | ||
apiVersion: karpenter.sh/v1beta1 | ||
kind: NodePool | ||
metadata: | ||
name: spot-example | ||
annotations: | ||
kubernetes.io/description: "NodePool to run spot instances" | ||
spec: | ||
template: | ||
spec: | ||
requirements: | ||
- key: kubernetes.io/arch | ||
operator: In | ||
values: ["amd64"] | ||
- key: kubernetes.io/os | ||
operator: In | ||
values: ["linux"] | ||
- key: karpenter.sh/capacity-type | ||
operator: In | ||
values: ["spot"] | ||
- key: karpenter.k8s.aws/instance-category | ||
operator: In | ||
values: ["c", "m", "r"] | ||
- key: karpenter.k8s.aws/instance-generation | ||
operator: Gt | ||
values: ["4"] | ||
- key: karpenter.k8s.aws/instance-size | ||
operator: In | ||
values: ["xlarge",] | ||
nodeClassRef: | ||
apiVersion: karpenter.k8s.aws/v1beta1 | ||
kind: EC2NodeClass | ||
name: default | ||
--- | ||
apiVersion: karpenter.k8s.aws/v1beta1 | ||
kind: EC2NodeClass | ||
metadata: | ||
name: default | ||
annotations: | ||
kubernetes.io/description: "General purpose EC2NodeClass for running Amazon Linux 2 nodes" | ||
spec: | ||
amiFamily: Custom | ||
amiSelectorTerms: | ||
- id: ami-00722494a4a3fa2af | ||
subnetSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "your-infra-tag" # replace with your known tag | ||
securityGroupSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "your-infra-tag" # replace with your known tag | ||
blockDeviceMappings: | ||
- deviceName: /dev/xvda | ||
rootVolume: true | ||
ebs: | ||
volumeType: gp3 | ||
volumeSize: 120Gi | ||
deleteOnTermination: true | ||
``` | ||
Make sure to tag your securityGroups and subnets. | ||
### Limitations and Caveats | ||
- We automatically reconcile the userData against the EC2NodeClass resources. | ||
- We automatically reconcile the amiID against the EC2NodeClass resources. | ||
- We automatically approve CSRs. | ||
!!! warning | ||
- The underlying implementation and APIs exposure to consumer for Autoprovisiong might change in the future. |
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,22 @@ | ||
--- | ||
title: Experimental features | ||
--- | ||
|
||
# Experimental features | ||
|
||
Hypershift ships with a "featuregate" package where you can specify new experimental features behind a feature gate. | ||
|
||
The Hypershift Operator has a featuregate/ reconciler where experimental features that affect the operator can be added. | ||
|
||
The Control Plane Operator has featuregate/ folder where experimental components reconciliation can be added. | ||
|
||
The Hosted Cluster Config Operator has a featuregate/ reconciler where experimental features that affect the operator can be added. | ||
|
||
Additional changes that need to interfere within the stable controllers logic can be added behind a check such as | ||
|
||
```go | ||
if featuregateConfig.Gates.Enabled(featuregateConfig.AutoProvision) {} | ||
``` | ||
|
||
TODO(alberto): Elaborate experimental APIs policy. | ||
|
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