Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdeal committed Oct 26, 2023
1 parent 3ecd2d2 commit 44d2973
Showing 1 changed file with 54 additions and 17 deletions.
71 changes: 54 additions & 17 deletions website/content/en/preview/concepts/nodeclasses.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,47 @@ metadata:
name: default
spec:
# required, resolves a default ami and userdata
amiFamily: AL2
amiFamily: AL2

# required, discovers subnets to attach to instances
subnetSelectorTerms:
subnetSelectorTerms:
- tags:
karpenter.sh/discovery: "${CLUSTER_NAME}"

# required, discovers security groups to attach to instances
securityGroupSelectorTerms:
securityGroupSelectorTerms:
- tags:
karpenter.sh/discovery: "${CLUSTER_NAME}"

# optional, discovers amis to override the amiFamily's default
amiSelectorTerms:
amiSelectorTerms:
- tags:
karpenter.sh/discovery: "${CLUSTER_NAME}"

# optional, IAM role to use for the node identity
role: "KarpenterNodeRole-${CLUSTER_NAME}"

# optional, overrides autogenerated userdata with a merge semantic
userData: |
userData: |
echo "Hello world"
# optional, propagates tags to underlying EC2 resources
tags:
tags:
team: team-a
app: team-a-app

# optional, configures IMDS for the instance
metadataOptions:
httpEndpoint: enabled
httpProtocolIPv6: disabled
httpPutResponseHopLimit: 2
httpTokens: required

# optional, configure network interfaces for the instance
- associatePublicIPAddress: true
description: "a network interface"
deviceIndex: 0

# optional, configures storage devices for the instance
blockDeviceMappings:
- deviceName: /dev/xvda
Expand Down Expand Up @@ -95,15 +100,15 @@ status:
zone: us-east-2c
- id: subnet-03941e7ad6afeaa72
zone: us-east-2a

# resolved security groups
securityGroups:
- id: sg-041513b454818610b
name: ClusterSharedNodeSecurityGroup
- id: sg-0286715698b894bca
name: ControlPlaneSecurityGroup-1AQ073TSAAPW

# resolved AMIs
# resolved AMIs
amis:
- id: ami-01234567890123456
name: custom-ami-amd64
Expand All @@ -119,7 +124,7 @@ status:
operator: In
values:
- arm64

# generated instance profile name
instanceProfile: "${CLUSTER_NAME}-0123456778901234567789"
```
Expand Down Expand Up @@ -206,7 +211,7 @@ Karpenter will automatically query for the appropriate [EKS optimized AMI](https

### Custom

The `Custom` AMIFamily ships without any default userData to allow you to configure custom bootstrapping for control planes or images that don't support the default methods from the other families.
The `Custom` AMIFamily ships without any default userData to allow you to configure custom bootstrapping for control planes or images that don't support the default methods from the other families.

## spec.subnetSelectorTerms

Expand Down Expand Up @@ -265,7 +270,7 @@ spec:
## spec.securityGroupSelectorTerms

The security group of an instance is comparable to a set of firewall rules.
[EKS creates at least two security groups by default](https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html).
[EKS creates at least two security groups by default](https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html).

{{% alert title="Tip" color="secondary" %}}
Security groups may be specified by any tag, including "Name". Selecting tags using wildcards (`*`) is supported.
Expand Down Expand Up @@ -531,6 +536,38 @@ spec:

The `Custom` AMIFamily ships without any default `blockDeviceMappings`.

## spec.networkInterfaces

The `networkInterfaces` field is mapped to [AWS EC2 LaunchTemplate NetworkInterfaces](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-launchtemplate-networkinterface.html)
and can be used to configure the network interfaces that AWS EC2 will attach to the provisioned nodes at launch.

Learn more about [Network Interfaces](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html).

### Examples

Single network interface (with associated public IP):
```yaml
apiVersion: karpenter.k8s.aws/v1alpha1
kind: AWSNodeTemplate
spec:
networkInterfaces:
- associatePublicIPAddress: true
description: "a network interface"
deviceIndex: 0
```

Multiple network interfaces:
```yaml
apiVersion: karpenter.k8s.aws/v1alpha1
kind: AWSNodeTemplate
spec:
networkInterfaces:
- description: "main network interface"
deviceIndex: 0
- description: "secondary network interface"
deviceIndex: 1
```

## spec.userData

You can control the UserData that is applied to your worker nodes via this field. This allows you to run custom scripts or pass-through custom configuration to Karpenter instances on start-up.
Expand Down Expand Up @@ -880,4 +917,4 @@ spec:
role: "KarpenterNodeRole-${CLUSTER_NAME}"
status:
instanceProfile: "${CLUSTER_NAME}-0123456778901234567789"
```
```

0 comments on commit 44d2973

Please sign in to comment.