Skip to content
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

docs: document use of Lt/Gt #2467

Merged
merged 2 commits into from
Sep 8, 2022
Merged

docs: document use of Lt/Gt #2467

merged 2 commits into from
Sep 8, 2022

Conversation

tzneal
Copy link
Contributor

@tzneal tzneal commented Sep 6, 2022

Fixes #2456

Description

Document and show some examples of using the AWS specific labels,
specifically using Lt/Gt.

How was this change tested?

  • N/A

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

Release Note


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sorry, something went wrong.

@tzneal tzneal requested a review from a team as a code owner September 6, 2022 12:28
@tzneal tzneal requested a review from dewjam September 6, 2022 12:28
@netlify
Copy link

netlify bot commented Sep 6, 2022

Deploy Preview for karpenter-docs-prod ready!

Name Link
🔨 Latest commit ef2d9f7
🔍 Latest deploy log https://app.netlify.com/sites/karpenter-docs-prod/deploys/6319e4615ad8fd000a506d39
😎 Deploy Preview https://deploy-preview-2467--karpenter-docs-prod.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small wording change nits

@@ -289,6 +289,35 @@ Specify AMIs explicitly by ID:

Prior to the introduction of `spec.providerRef`, parameters for the AWS Cloud Provider could be specified within the Provisioner itself through the `spec.provider` field. This field in the Provisioners has now been deprecated, and all fields previously specified through the ProvisionerSpec can now be specified in the `AWSNodeTemplate` CRD instead. See the [upgrade guide for more information](../../upgrade-guide). New parameters can only be specified in the `AWSNodeTemplate` CRD.

## AWS Specific Labels

The AWS cloud provider adds several labels to nodes that describe the node resources to make filtering instance types easier. These work at either the provisioner level as requirements or the pod level as node selectors or node affinities. The complete list and which instance type they are applied to are available in the [Instance Types](../instance-types/) documentation. A sampling of these include:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The AWS cloud provider adds several labels to nodes that describe the node resources to make filtering instance types easier. These work at either the provisioner level as requirements or the pod level as node selectors or node affinities. The complete list and which instance type they are applied to are available in the [Instance Types](../instance-types/) documentation. A sampling of these include:
The AWS cloud provider adds several labels to nodes that describe the node resources to make filtering instance types easier. These work at either the provisioner level as requirements or the pod level as node selectors or node affinities. The complete list, including the instance types they are applied to, is available in the [Instance Types](../instance-types/) documentation. A sampling of these include:

- `karpenter.k8s.aws/instance-memory`
- `karpenter.k8s.aws/instance-gpu-name`

The `karpenter.k8s.aws/instance-cpu` and `karpenter.k8s.aws/instance-memory` values are numeric which also allows constructing requirements for them using the `Gt` and `Lt` operators. The standard rules for `Gt` and `Lt` apply, there can be only one value and it must be an integer. This can be useful to select nodes of a particular "shape". For example the following filters out all instance types with more than 8 CPUs or more than 16 GiB of memory:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The `karpenter.k8s.aws/instance-cpu` and `karpenter.k8s.aws/instance-memory` values are numeric which also allows constructing requirements for them using the `Gt` and `Lt` operators. The standard rules for `Gt` and `Lt` apply, there can be only one value and it must be an integer. This can be useful to select nodes of a particular "shape". For example the following filters out all instance types with more than 8 CPUs or more than 16 GiB of memory:
The `karpenter.k8s.aws/instance-cpu` and `karpenter.k8s.aws/instance-memory` values are numeric which allows constructing requirements using the `Gt` and `Lt` operators.
The following standard rules for `Gt` and `Lt` apply:
1. There can be only one value in the requirement
2. The value must be an integer
These requirements can be useful to select nodes of a particular "shape". For example the following filters out all instance types with more than 8 CPUs or more than 16 GiB of memory:

Document and show some examples of using the AWS specific labels,
specifically using Lt/Gt.

Fixes aws#2456
@tzneal
Copy link
Contributor Author

tzneal commented Sep 7, 2022

Hide whitespace on diff, I changed the fileformat to Unix style.

Copy link
Contributor

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two more small nits

1. There can be only one value in the requirement
2. The value must be an integer

These requirements can be useful to select nodes of a particular "shape". For example the following filters out all instance types with more than 8 CPUs or more than 16 GiB of memory::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
These requirements can be useful to select nodes of a particular "shape". For example the following filters out all instance types with more than 8 CPUs or more than 16 GiB of memory::
These requirements can be useful to select nodes of a particular "shape". For example the following filters out all instance types with more than 8 CPUs or more than 16 GiB of memory:

Karpenter supports accelerators, such as GPUs.


Additionally, include a resource requirement in the workload manifest. This will cause the GPU dependent pod will be scheduled onto the appropriate node.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Additionally, include a resource requirement in the workload manifest. This will cause the GPU dependent pod will be scheduled onto the appropriate node.
Additionally, include a resource requirement in the workload manifest. This will cause the GPU dependent pod to be scheduled onto the appropriate node.

Copy link
Contributor

@jonathan-innis jonathan-innis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

@tzneal tzneal merged commit 5054662 into aws:main Sep 8, 2022
@tzneal tzneal deleted the document-lt-gt branch September 8, 2022 19:58
Select AMIs by an arbitrary AWS tag key/value pair:
```
amiSelector:
MySubnetTag: value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tzneal
subnet, for AMI?!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add documentation for using the GT/LT Operators with CPU/Memory
3 participants