Skip to content

Commit

Permalink
docs: Update v1beta1 to v1 examples (#6609)
Browse files Browse the repository at this point in the history
  • Loading branch information
engedaam authored Aug 8, 2024
1 parent c66e3f5 commit 66019a6
Show file tree
Hide file tree
Showing 22 changed files with 168 additions and 155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Karpenter for this NodePool. Karpenter will not provision compute that
# takes the pool over a total of 100 (virtual or physical) CPU cores.
---
apiVersion: karpenter.sh/v1beta1
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: limitcpu100
Expand All @@ -28,24 +28,25 @@ spec:
operator: Gt
values: ["2"]
nodeClassRef:
apiVersion: karpenter.k8s.aws/v1beta1
group: karpenter.k8s.aws
kind: EC2NodeClass
name: default
limits:
cpu: 100
---
apiVersion: karpenter.k8s.aws/v1beta1
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: default
annotations:
kubernetes.io/description: "General purpose EC2NodeClass for running Amazon Linux 2 nodes"
spec:
amiFamily: AL2 # Amazon Linux 2
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
karpenter.sh/discovery: "${CLUSTER_NAME}" # replace with your cluster name
amiSelectorTerms:
- alias: al2023@latest # Amazon Linux 2023
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: default
Expand All @@ -28,11 +28,11 @@ spec:
operator: Gt
values: ["2"]
nodeClassRef:
apiVersion: karpenter.k8s.aws/v1beta1
group: karpenter.k8s.aws
kind: EC2NodeClass
name: al2
---
apiVersion: karpenter.k8s.aws/v1beta1
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: al2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# 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
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: default
Expand All @@ -28,25 +28,26 @@ spec:
operator: Gt
values: ["2"]
nodeClassRef:
apiVersion: karpenter.k8s.aws/v1beta1
group: karpenter.k8s.aws
kind: EC2NodeClass
name: al2
---
apiVersion: karpenter.k8s.aws/v1beta1
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: al2
annotations:
kubernetes.io/description: "EC2NodeClass for running Amazon Linux 2 nodes with custom user data"
spec:
amiFamily: AL2 # Amazon Linux 2
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:
- alias: al2023@latest # Amazon Linux 2023
userData: |
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="BOUNDARY"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 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
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: default
Expand All @@ -27,25 +27,26 @@ spec:
operator: Gt
values: ["2"]
nodeClassRef:
apiVersion: karpenter.k8s.aws/v1beta1
group: karpenter.k8s.aws
kind: EC2NodeClass
name: al2
---
apiVersion: karpenter.k8s.aws/v1beta1
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: al2
annotations:
kubernetes.io/description: "EC2NodeClass for running Amazon Linux 2 nodes with user data that enables the NodeLogQuery feature gate"
spec:
amiFamily: AL2 # Amazon Linux 2
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:
- alias: al2023@latest # Amazon Linux 2023
userData: |
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="BOUNDARY"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This example NodePool will provision instances using the AL2023 EKS-Optimized AMI.
---
apiVersion: karpenter.sh/v1beta1
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: default
Expand All @@ -26,25 +26,26 @@ spec:
operator: Gt
values: ["2"]
nodeClassRef:
apiVersion: karpenter.k8s.aws/v1beta1
group: karpenter.k8s.aws
kind: EC2NodeClass
name: al2023
---
apiVersion: karpenter.k8s.aws/v1beta1
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: al2023
annotations:
kubernetes.io/description: "EC2NodeClass for running Amazon Linux 2023 nodes with custom user data"
spec:
amiFamily: AL2023 # Amazon Linux 2023
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:
- alias: al2023@latest # Amazon Linux 2023
userData: |
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="//"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This example NodePool will provision instances
# running Bottlerocket OS
---
apiVersion: karpenter.sh/v1beta1
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: default
Expand All @@ -27,25 +27,26 @@ spec:
operator: Gt
values: ["2"]
nodeClassRef:
apiVersion: karpenter.k8s.aws/v1beta1
group: karpenter.k8s.aws
kind: EC2NodeClass
name: bottlerocket
---
apiVersion: karpenter.k8s.aws/v1beta1
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: bottlerocket
annotations:
kubernetes.io/description: "EC2NodeClass for running Bottlerocket nodes"
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
amiSelectorTerms:
- alias: bottlerocket@latest # Bottlerocket
blockDeviceMappings:
- deviceName: /dev/xvda
ebs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# running Bottlerocket OS and the user data settings specified in
# this EC2NodeClass will be merged into Karpenter defaults.
---
apiVersion: karpenter.sh/v1beta1
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: default
Expand All @@ -28,25 +28,26 @@ spec:
operator: Gt
values: ["2"]
nodeClassRef:
apiVersion: karpenter.k8s.aws/v1beta1
group: karpenter.k8s.aws
kind: EC2NodeClass
name: bottlerocket
---
apiVersion: karpenter.k8s.aws/v1beta1
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: bottlerocket
annotations:
kubernetes.io/description: "EC2NodeClass for running Bottlerocket nodes with custom user data"
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
amiSelectorTerms:
- alias: bottlerocket@latest # Bottlerocket
userData: |
[settings.kubernetes]
kube-api-qps = 30
64 changes: 64 additions & 0 deletions examples/v1/custom-family-with-alias.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# This example NodePool provisions instances using an AMI that belongs to a custom AMIFamily with an Alisa
# Keep in mind, that you're in charge of bootstrapping your worker nodes.
---
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: default
annotations:
kubernetes.io/description: "General purpose NodePool for generic workloads"
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: ["on-demand"]
- key: karpenter.k8s.aws/instance-category
operator: In
values: ["c", "m", "r"]
- key: karpenter.k8s.aws/instance-generation
operator: Gt
values: ["2"]
nodeClassRef:
group: karpenter.k8s.aws
kind: EC2NodeClass
name: custom-family
---
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: custom-family
annotations:
kubernetes.io/description: "EC2NodeClass for running Custom AMIFamily with custom user data that doesn't conform to the other AMIFamilies"
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:
- alias: bottlerocket@latest
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"
# Have the kubelet label the node
/etc/eks/bootstrap.sh my-cluster --kubelet-extra-args='--node-labels=foo=bar'
--BOUNDARY
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This example NodePool provisions 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
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: default
Expand All @@ -27,11 +27,11 @@ spec:
operator: Gt
values: ["2"]
nodeClassRef:
apiVersion: karpenter.k8s.aws/v1beta1
group: karpenter.k8s.aws
kind: EC2NodeClass
name: custom-family
---
apiVersion: karpenter.k8s.aws/v1beta1
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: custom-family
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This example NodePool will provision general purpose instances
---
apiVersion: karpenter.sh/v1beta1
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: general-purpose
Expand All @@ -26,22 +26,23 @@ spec:
operator: Gt
values: ["2"]
nodeClassRef:
apiVersion: karpenter.k8s.aws/v1beta1
group: karpenter.k8s.aws
kind: EC2NodeClass
name: default
---
apiVersion: karpenter.k8s.aws/v1beta1
apiVersion: karpenter.k8s.aws/v1
kind: EC2NodeClass
metadata:
name: default
annotations:
kubernetes.io/description: "General purpose EC2NodeClass for running Amazon Linux 2 nodes"
spec:
amiFamily: AL2 # Amazon Linux 2
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:
- alias: al2023@latest # Amazon Linux 2023
Loading

0 comments on commit 66019a6

Please sign in to comment.