Skip to content

Commit e32117f

Browse files
charliedmcbCharlie McBride
andauthored
docs(self-hosted): Update Readme (#564)
* Update Readme * move log check earlier * minor adjustments * add seperate headers for areas --------- Co-authored-by: Charlie McBride <[email protected]>
1 parent d83a94c commit e32117f

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

README.md

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ Table of contents:
1515
- [Create a cluster](#create-a-cluster)
1616
- [Configure Helm chart values](#configure-helm-chart-values)
1717
- [Install Karpenter](#install-karpenter)
18+
- [Using Karpenter (self-hosted)](#using-karpenter-self-hosted)
1819
- [Create NodePool](#create-nodepool)
1920
- [Scale up deployment](#scale-up-deployment)
2021
- [Scale down deployment](#scale-down-deployment)
2122
- [Delete Karpenter nodes manually](#delete-karpenter-nodes-manually)
23+
- [Cleanup (self-hosted)](#cleanup-self-hosted)
2224
- [Delete the cluster](#delete-the-cluster)
2325
- [Source Attribution](#source-attribution)
2426
- [Community, discussion, contribution, and support](#community-discussion-contribution-and-support)
@@ -70,24 +72,30 @@ Set environment variables:
7072
```bash
7173
export CLUSTER_NAME=karpenter
7274
export RG=karpenter
73-
export LOCATION=eastus
75+
export LOCATION=westus3
7476
export KARPENTER_NAMESPACE=kube-system
7577

7678
```
7779

80+
Login and select a subscription to use:
81+
82+
```bash
83+
az login
84+
```
85+
7886
Create the resource group:
7987

8088
```bash
8189
az group create --name ${RG} --location ${LOCATION}
8290
```
8391

84-
Create the workload MSI that is the backing for the karpenter pod auth:
92+
Create the workload MSI that backs the karpenter pod auth:
8593

8694
```bash
8795
KMSI_JSON=$(az identity create --name karpentermsi --resource-group "${RG}" --location "${LOCATION}")
8896
```
8997

90-
Create AKS cluster compatible with Karpenter, and with the workload identity enabled:
98+
Create the AKS cluster compatible with Karpenter, with workload identity enabled:
9199

92100
```bash
93101
AKS_JSON=$(az aks create \
@@ -119,13 +127,17 @@ for role in "Virtual Machine Contributor" "Network Contributor" "Managed Identit
119127
done
120128
```
121129

130+
> Note: If you experience any issues creating the role assignments, but should have the given ownership to do so, try going through the Azure portal:
131+
> 1. Navigate to your MSI.
132+
> 2. Give it the following roles "Virtual Machine Contributor", "Network Contributor", and "Managed Identity Operator" at the scope of the node resource group.
133+
122134
### Configure Helm chart values
123135

124-
The Karpenter Helm chart requires specific configuration values to work with an AKS cluster. While these values are documented within the Helm chart, you can use the `configure-values.sh` script to generate the `karpenter-values.yaml` file with the necessary configuration. This script queries the AKS cluster and creates the values file using `karpenter-values-template.yaml` as a template. Although the script automatically fetches the template from the main branch, inconsistencies may arise between the installed version of Karpenter and the repository code. Therefore, it is advisable to download the specific version of the template before running the script.
136+
The Karpenter Helm chart requires specific configuration values to work with an AKS cluster. While these values are documented within the Helm chart, you can use the `configure-values.sh` script to generate the `karpenter-values.yaml` file with the necessary configuration. This script queries the AKS cluster and creates `karpenter-values.yaml` using `karpenter-values-template.yaml` as the configuration template. Although the script automatically fetches the template from the main branch, inconsistencies may arise between the installed version of Karpenter and the repository code. Therefore, it is advisable to download the specific version of the template before running the script.
125137

126138
```bash
127139
# Select version to install
128-
export KARPENTER_VERSION=0.5.4
140+
export KARPENTER_VERSION=0.7.0
129141

130142
# Download the specific's version template
131143
curl -sO https://raw.githubusercontent.com/Azure/karpenter/v${KARPENTER_VERSION}/karpenter-values-template.yaml
@@ -138,10 +150,9 @@ chmod +x ./configure-values.sh && ./configure-values.sh ${CLUSTER_NAME} ${RG} ka
138150

139151
### Install Karpenter
140152

141-
Usinge the generated `karpenter-values.yaml` file, install Karpenter using Helm:
153+
Using the generated `karpenter-values.yaml` file, install Karpenter using Helm:
142154

143155
```bash
144-
145156
helm upgrade --install karpenter oci://mcr.microsoft.com/aks/karpenter/karpenter \
146157
--version "${KARPENTER_VERSION}" \
147158
--namespace "${KARPENTER_NAMESPACE}" --create-namespace \
@@ -151,11 +162,21 @@ helm upgrade --install karpenter oci://mcr.microsoft.com/aks/karpenter/karpenter
151162
--set controller.resources.limits.cpu=1 \
152163
--set controller.resources.limits.memory=1Gi \
153164
--wait
165+
```
154166

167+
Check karpenter deployed successfully:
168+
169+
```bash
170+
kubectl get pods --namespace "${KARPENTER_NAMESPACE}" -l app.kubernetes.io/name=karpenter
171+
```
172+
173+
Check its logs:
174+
175+
```bash
155176
kubectl logs -f -n "${KARPENTER_NAMESPACE}" -l app.kubernetes.io/name=karpenter -c controller
156177
```
157178

158-
Snapshot versions can be installed in a similar way for development:
179+
Note: Snapshot versions can be installed in a similar way for development:
159180

160181
```bash
161182
export KARPENTER_NAMESPACE=kube-system
@@ -170,10 +191,10 @@ helm upgrade --install karpenter oci://ksnap.azurecr.io/karpenter/snapshot/karpe
170191
--set controller.resources.limits.cpu=1 \
171192
--set controller.resources.limits.memory=1Gi \
172193
--wait
173-
174-
kubectl logs -f -n "${KARPENTER_NAMESPACE}" -l app.kubernetes.io/name=karpenter -c controller
175194
```
176195

196+
## Using Karpenter (self-hosted)
197+
177198
### Create NodePool
178199

179200
A single Karpenter NodePool is capable of handling many different pod shapes. Karpenter makes scheduling and provisioning decisions based on pod attributes such as labels and affinity. In other words, Karpenter eliminates the need to manage many different node groups.
@@ -277,6 +298,8 @@ If you delete a node with kubectl, Karpenter will gracefully cordon, drain, and
277298
kubectl delete node $NODE_NAME
278299
```
279300

301+
## Cleanup (self-hosted)
302+
280303
### Delete the cluster
281304

282305
To avoid additional charges, remove the demo infrastructure from your AKS account.

0 commit comments

Comments
 (0)