Skip to content

Commit

Permalink
Add AWS Cloud Provider Docs (#557)
Browse files Browse the repository at this point in the history
* revise diesc of aws labels

* rename dir for cloud providers

* wrap long lines

* revise aws label desc based on pr feedback

* revise aws prov docs re etarn review

* revert desc of AZ IDs

* Docs Bash Collab

Co-authored-by: Ellis Tarn <ellistarn@gmail.com>
  • Loading branch information
geoffcline and ellistarn committed Jul 30, 2021
1 parent b15abb5 commit 2519db5
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 0 deletions.
159 changes: 159 additions & 0 deletions website/content/en/docs/cloud-providers/AWS.md
@@ -0,0 +1,159 @@
---
title: "Amazon Web Services (AWS)"
linkTitle: "AWS"
weight: 10
---

## Control Provisioning with Labels

The [Provisioner CRD]({{< ref "provisioner-crd.md" >}}) supports defining
node properties like instance type and zone.For certain well-known labels (documented below), Karpenter will provision
nodes accordingly. For example, in response to a label of
`topology.kubernetes.io/zone=us-east-1c`, Karpenter will provision nodes in
that availability zone.

### Instance Types

Karpenter supports specifying [AWS instance type](https://aws.amazon.com/ec2/instance-types/).

The default value includes all instance types with the exclusion of metal
(non-virtualized),
[non-HVM](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/virtualization_types.html),
and GPU instances.

If necessary, Karpenter supports defining a limited list of default instance types.

If more than one type is listed, Karpenter will determine the
instance type to minimize the number of new nodes.

View the full list of instance types with `aws ec2 describe-instance-types`.

**Example**

*Set Default with provisioner.yaml*

```yaml
spec:
instanceTypes:
- m5.large
```

*Override with workload manifest (e.g., pod)*

```yaml
spec:
template:
spec:
nodeSelector:
node.kubernetes.io/instance-type: m5.large
```

### Availability Zones

`topology.kubernetes.io/zone=us-east-1c`

- key: `topology.kubernetes.io/zone`
- value example: `us-east-1c`
- value list: `aws ec2 describe-availability-zones --region <region-name>`

Karpenter can be configured to create nodes in a particular zone. Note that the Availability Zone us-east-1a for your AWS account might not have the same location as us-east-1a for another AWS account.

[Learn more about Availability Zone
IDs.](https://docs.aws.amazon.com/ram/latest/userguide/working-with-az-ids.html)

### Capacity Type

- key: `node.k8s.aws/capacity-type`
- values
- `on-demand` (default)
- `spot`

Karpenter supports specifying capacity type and defaults to on-demand.

Specify this value on the provisioner to enable spot instances. [Spot
instances](https://aws.amazon.com/ec2/spot/) may be preempted, and should not
be used for critical workloads.

**Example**

*Set Default with provisioner.yaml*

```yaml
spec:
labels:
node.k8s.aws/capacity-type: spot
```

*Override with workload manifest (e.g., pod)*

```yaml
spec:
template:
spec:
nodeSelector:
node.k8s.aws/capacity-type: spot
```

### Architecture

- key: `kubernetes.io/arch`
- values
- `amd64` (default)
- `arm64`

Karpenter supports `amd64` nodes, and `arm64` nodes.

**Example**

*Set Default with provisioner.yaml*

```yaml
spec:
labels:
kubernetes.io/arch: arm64
```

*Override with workload manifest (e.g., pod)*

```yaml
spec:
template:
spec:
nodeSelector:
kubernetes.io/arch: amd64
```

### Operating System

- key: `kubernetes.io/os`
- values
- `linux` (default)

At this time, Karpenter only supports Linux OS nodes.

### Accelerators, GPU

Accelerator (e.g., GPU) values include
- `nvidia.com/gpu`
- `amd.com/gpu`
- `aws.amazon.com/neuron`

Karpenter supports accelerators, such as GPUs.

To enable instances with accelerators, use the [instance type
well known label selector](#instance-types).

Additionally, include a resource requirement in the workload manifest. Thus,
accelerator dependent pod will be scheduled onto the appropriate node.

*accelerator resource in workload manifest (e.g., pod)*

```yaml
spec:
template:
spec:
containers:
- resources:
limits:
nvidia.com/gpu: "1"
```
5 changes: 5 additions & 0 deletions website/content/en/docs/cloud-providers/_index.md
@@ -0,0 +1,5 @@
---
title: "Cloud Providers"
linkTitle: "Cloud Providers"
weight: 70
---

0 comments on commit 2519db5

Please sign in to comment.