Configure Smart Karpenter for LKE Enterprise
LKE Enterprise is supported starting from Smart Karpenter version 1.1.0.
As LKE does not support external nodes, Smart Karpenter creates dedicated LKE NodePools to dynamically scale the cluster by adding or removing nodes. These NodePools are tagged for identification, and Smart Karpenter does not modify any existing NodePools.
Install and Configure the Smart Karpenter
You must have helm
and kubectl
configured on the target cluster.
-
Ensure that you have image pull secret credentials from Avesha Sales.
-
Add the Helm repository by using the following commands:
helm repo add smartscaler https://smartscaler.nexus.aveshalabs.io/repository/smartscaler-helm-ent-prod
helm repo update -
To view the Smart Karpenter charts, use the following command:
helm search repo avesha-karpenter
-
Create a
values.yaml
file as shown below and set the parameters.- Set the
cloudProvider
,linode
object, andimagePullSecrets
andimageCredentials
. - Use the credentials that you received from Avesha Sales for the
imageCredentials
object parameters.
cloudProvider: "linode" # Cloud Provider. For LKE Enterprise, the value must be linode.
linode: # Linode controller and its environment
controller: # controller for the Linode environment
env: # Linode environment
- name: CLUSTER_NAME # name variable for the Linode cluster
value: "lkee-smart-karpenter" # name of the Linode cluster
- name: LINODE_ENTERPRISE # enterprise variable for your environment
value: "true" # boolean value for the enterprise variable; set it to true.
imagePullSecrets:
name: "<name for secrets>" #user-defined name for image pull secrets
imageCredentials: # provide server, username and password here for image pull
registry: "<registry name>" # Name of the registry as received from Avesha Sales
username: "<user name>" # user name that you receive from Avesha Sales
password: "<password>" # password that you receive from Avesha Sales - Set the
-
Retrieve the
values.yaml
file from the repository you added using the following command:helm show values smartscaler/avesha-karpenter > values.yaml
-
Install Smart Karpenter using the
values.yaml
file in following command:helm install karpenter smartscaler/avesha-karpenter -f values.yaml --namespace smart-scaler --create-namespace
-
Deploy at least one NodePool on the Linode cluster. Refer to the the NodePool example below.
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: default
spec:
template:
spec:
requirements:
- key: kubernetes.io/arch
operator: In
values: ["amd64"]
- key: kubernetes.io/os
operator: In
values: ["linux"]
- key: node.kubernetes.io/instance-type
operator: NotIn
values: ["g6-dedicated-64", "g7-premium-64"]
- key: karpenter.linode.sh/instance-family
operator: NotIn
values: ["premium"]
expireAfter: 720h # 30 * 24h = 720h
limits:
cpu: 1000
disruption:
consolidationPolicy: WhenEmptyOrUnderutilized
consolidateAfter: 30s
weight: 20 -
Save the NodePool as a file and deploy it using the following command:
kubectl apply -f <nodepool.yaml>