-
Notifications
You must be signed in to change notification settings - Fork 962
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
1 parent
f14db29
commit 9cadbad
Showing
18 changed files
with
593 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This example NodePool limits the amount of compute | ||
# NodePool by Karpenter to 100 CPU cores | ||
apiVersion: karpenter.sh/v1beta1 | ||
kind: NodePool | ||
metadata: | ||
name: default | ||
spec: | ||
spec: | ||
template: | ||
spec: | ||
nodeClassRef: | ||
name: default | ||
limits: | ||
cpu: 100 | ||
--- | ||
apiVersion: karpenter.k8s.aws/v1beta1 | ||
kind: EC2NodeClass | ||
metadata: | ||
name: default | ||
spec: | ||
amiFamily: AL2 | ||
role: "KarpenterNodeRole-${CLUSTER_NAME}" # replace with your cluster name | ||
subnetSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
securityGroupSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name |
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,40 @@ | ||
# This example NodePool will provision instances using a custom EKS-Optimized AMI that belongs to the | ||
# AL2 AMIFamily. If your AMIs are built off https://github.com/awslabs/amazon-eks-ami and can be bootstrapped | ||
# by Karpenter, this may be a good fit for you. | ||
apiVersion: karpenter.sh/v1beta1 | ||
kind: NodePool | ||
metadata: | ||
name: default | ||
spec: | ||
template: | ||
spec: | ||
nodeClassRef: | ||
name: al2 | ||
--- | ||
apiVersion: karpenter.k8s.aws/v1beta1 | ||
kind: EC2NodeClass | ||
metadata: | ||
name: al2 | ||
spec: | ||
amiFamily: AL2 | ||
role: "KarpenterNodeRole-${CLUSTER_NAME}" # replace with your cluster name | ||
subnetSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
securityGroupSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
amiSelectorTerms: | ||
- id: ami-123 | ||
- id: ami-456 | ||
userData: | | ||
MIME-Version: 1.0 | ||
Content-Type: multipart/mixed; boundary="BOUNDARY" | ||
--BOUNDARY | ||
Content-Type: text/x-shellscript; charset="us-ascii" | ||
#!/bin/bash | ||
echo "Running a custom user data script" | ||
--BOUNDARY-- |
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,37 @@ | ||
# This example NodePool will provision instances using the AL2 EKS-Optimized AMI. | ||
# The UserData defined in spec.UserData needs to be in the MIME-multipart format, | ||
# and will be prepended to a Karpenter managed section that will bootstrap the kubelet. | ||
apiVersion: karpenter.sh/v1beta1 | ||
kind: NodePool | ||
metadata: | ||
name: default | ||
spec: | ||
template: | ||
spec: | ||
nodeClassRef: | ||
name: al2 | ||
--- | ||
apiVersion: karpenter.k8s.aws/v1beta1 | ||
kind: EC2NodeClass | ||
metadata: | ||
name: al2 | ||
spec: | ||
amiFamily: AL2 | ||
role: "KarpenterNodeRole-${CLUSTER_NAME}" # replace with your cluster name | ||
subnetSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
securityGroupSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
userData: | | ||
MIME-Version: 1.0 | ||
Content-Type: multipart/mixed; boundary="BOUNDARY" | ||
--BOUNDARY | ||
Content-Type: text/x-shellscript; charset="us-ascii" | ||
#!/bin/bash | ||
echo "Running a custom user data script" | ||
--BOUNDARY-- |
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,49 @@ | ||
# This example NodePool will provision instances using the AL2 EKS-Optimized AMI | ||
# and will be prepended to a Karpenter managed section that will bootstrap the kubelet. | ||
apiVersion: karpenter.sh/v1beta1 | ||
kind: NodePool | ||
metadata: | ||
name: default | ||
spec: | ||
template: | ||
spec: | ||
nodeClassRef: | ||
name: al2 | ||
--- | ||
apiVersion: karpenter.k8s.aws/v1beta1 | ||
kind: EC2NodeClass | ||
metadata: | ||
name: al2 | ||
spec: | ||
amiFamily: AL2 | ||
role: "KarpenterNodeRole-${CLUSTER_NAME}" # replace with your cluster name | ||
subnetSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
securityGroupSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
userData: | | ||
MIME-Version: 1.0 | ||
Content-Type: multipart/mixed; boundary="BOUNDARY" | ||
--BOUNDARY | ||
Content-Type: text/x-shellscript; charset="us-ascii" | ||
#!/bin/bash | ||
set -e | ||
# Add additional KUBELET_EXTRA_ARGS to the service | ||
# Requires Kubernetes 1.27 (alpha feature) | ||
cat << EOF > /etc/systemd/system/kubelet.service.d/90-kubelet-extra-args.conf | ||
[Service] | ||
Environment="KUBELET_EXTRA_ARGS=--feature-gates=NodeLogQuery=true $KUBELET_EXTRA_ARGS" | ||
EOF | ||
systemctl daemon-reload | ||
# Enable log handler and log query to the kubelet configuration | ||
echo "$(jq '.enableSystemLogHandler=true' /etc/kubernetes/kubelet/kubelet-config.json)" > /etc/kubernetes/kubelet/kubelet-config.json | ||
echo "$(jq '.enableSystemLogQuery=true' /etc/kubernetes/kubelet/kubelet-config.json)" > /etc/kubernetes/kubelet/kubelet-config.json | ||
--BOUNDARY-- |
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,36 @@ | ||
# This example NodePool will provision instances | ||
# running Bottlerocket OS | ||
apiVersion: karpenter.sh/v1beta1 | ||
kind: NodePool | ||
metadata: | ||
name: default | ||
spec: | ||
template: | ||
spec: | ||
nodeClassRef: | ||
name: bottlerocket | ||
--- | ||
apiVersion: karpenter.k8s.aws/v1beta1 | ||
kind: EC2NodeClass | ||
metadata: | ||
name: bottlerocket | ||
spec: | ||
amiFamily: Bottlerocket | ||
role: "KarpenterNodeRole-${CLUSTER_NAME}" # replace with your cluster name | ||
subnetSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
securityGroupSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
blockDeviceMappings: | ||
- deviceName: /dev/xvda | ||
ebs: | ||
volumeType: gp3 | ||
volumeSize: 4Gi | ||
deleteOnTermination: true | ||
- deviceName: /dev/xvdb | ||
ebs: | ||
volumeType: gp3 | ||
volumeSize: 20Gi # replace with your required disk size | ||
deleteOnTermination: true |
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,29 @@ | ||
# This example NodePool will provision instances | ||
# running Bottlerocket OS and the userData settings specified in ths AWSNodeTemplate | ||
# CRD will be merged into Karpenter defaults. | ||
apiVersion: karpenter.sh/v1beta1 | ||
kind: NodePool | ||
metadata: | ||
name: default | ||
spec: | ||
template: | ||
spec: | ||
nodeClassRef: | ||
name: bottlerocket | ||
--- | ||
apiVersion: karpenter.k8s.aws/v1beta1 | ||
kind: EC2NodeClass | ||
metadata: | ||
name: bottlerocket | ||
spec: | ||
amiFamily: Bottlerocket | ||
role: "KarpenterNodeRole-${CLUSTER_NAME}" # replace with your cluster name | ||
subnetSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
securityGroupSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
userData: | | ||
[settings.kubernetes] | ||
kube-api-qps = 30 |
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,42 @@ | ||
# This example provisioner will provision instances using an AMI that belongs to a custom AMIFamily | ||
# Keep in mind, that you're in charge of bootstrapping your worker nodes. | ||
|
||
apiVersion: karpenter.sh/v1beta1 | ||
kind: NodePool | ||
metadata: | ||
name: default | ||
spec: | ||
template: | ||
spec: | ||
nodeClassRef: | ||
name: custom-family | ||
--- | ||
apiVersion: karpenter.k8s.aws/v1beta1 | ||
kind: EC2NodeClass | ||
metadata: | ||
name: custom-family | ||
spec: | ||
amiFamily: Custom | ||
role: "KarpenterNodeRole-${CLUSTER_NAME}" # replace with your cluster name | ||
subnetSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
securityGroupSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
amiSelectorTerms: | ||
- id: ami-123 | ||
- id: ami-456 | ||
userData: | | ||
MIME-Version: 1.0 | ||
Content-Type: multipart/mixed; boundary="BOUNDARY" | ||
--BOUNDARY | ||
Content-Type: text/x-shellscript; charset="us-ascii" | ||
#!/bin/bash | ||
echo "Running my custom set-up" | ||
/etc/eks/bootstrap.sh my-cluster --kubelet-extra-args='--node-labels=foo=bar' | ||
--BOUNDARY |
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,33 @@ | ||
# This example NodePool will provision general purpose instances | ||
apiVersion: karpenter.sh/v1beta1 | ||
kind: NodePool | ||
metadata: | ||
name: default | ||
spec: | ||
template: | ||
spec: | ||
requirements: | ||
# Include general purpose instance families | ||
- key: karpenter.k8s.aws/instance-family | ||
operator: In | ||
values: [c5, m5, r5] | ||
# Exclude small instance sizes | ||
- key: karpenter.k8s.aws/instance-size | ||
operator: NotIn | ||
values: [nano, micro, small, large] | ||
nodeClassRef: | ||
name: default | ||
--- | ||
apiVersion: karpenter.k8s.aws/v1beta1 | ||
kind: EC2NodeClass | ||
metadata: | ||
name: default | ||
spec: | ||
amiFamily: AL2 | ||
role: "KarpenterNodeRole-${CLUSTER_NAME}" # replace with your cluster name | ||
subnetSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
securityGroupSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name |
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,32 @@ | ||
# This example NodePool will avoid small instance types in the cluster | ||
apiVersion: karpenter.sh/v1beta1 | ||
kind: NodePool | ||
metadata: | ||
name: default | ||
spec: | ||
template: | ||
spec: | ||
requirements: | ||
# exclude instances with < 4 cores and < 8GiB memory (8192 mebibytes) | ||
- key: "karpenter.k8s.aws/instance-cpu" | ||
operator: Gt | ||
values: ["3"] | ||
- key: "karpenter.k8s.aws/instance-memory" | ||
operator: Gt | ||
values: ["8191"] | ||
nodeClassRef: | ||
name: default | ||
--- | ||
apiVersion: karpenter.k8s.aws/v1beta1 | ||
kind: EC2NodeClass | ||
metadata: | ||
name: default | ||
spec: | ||
amiFamily: AL2 | ||
role: "KarpenterNodeRole-${CLUSTER_NAME}" # replace with your cluster name | ||
subnetSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
securityGroupSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name |
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,50 @@ | ||
# This example NodePool will provision instances | ||
# with multiple EBS attached | ||
apiVersion: karpenter.sh/v1beta1 | ||
kind: NodePool | ||
metadata: | ||
name: default | ||
spec: | ||
template: | ||
spec: | ||
requirements: | ||
# Include general purpose instance families | ||
- key: karpenter.k8s.aws/instance-family | ||
operator: In | ||
values: [c6g, c7g, c6a, c6i, m6a, m6g, m6i, r6a, r6g, r6i] | ||
# Exclude small instance sizes | ||
- key: karpenter.k8s.aws/instance-size | ||
operator: In | ||
values: [medium, large, xlarge, xlarge, 2xlarge, 4xlarge] | ||
nodeClassRef: | ||
name: default | ||
--- | ||
apiVersion: karpenter.k8s.aws/v1beta1 | ||
kind: EC2NodeClass | ||
metadata: | ||
name: default | ||
spec: | ||
amiFamily: AL2 | ||
role: "KarpenterNodeRole-${CLUSTER_NAME}" # replace with your cluster name | ||
subnetSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
securityGroupSelectorTerms: | ||
- tags: | ||
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name | ||
blockDeviceMappings: | ||
- deviceName: /dev/xvda | ||
ebs: | ||
volumeType: gp3 | ||
volumeSize: 20Gi | ||
deleteOnTermination: true | ||
- deviceName: /dev/xvdb | ||
ebs: | ||
volumeType: gp3 | ||
volumeSize: 100Gi | ||
deleteOnTermination: true | ||
- deviceName: /dev/xvdc | ||
ebs: | ||
volumeType: gp3 | ||
volumeSize: 2000Gi | ||
deleteOnTermination: true |
Oops, something went wrong.