@@ -5,13 +5,32 @@ manual steps which must be performed before it will operate.
55
66## Prerequisites
77
8- These instructions work best with the following versions:
8+ These instructions work best with the following versions and settings :
99
1010| Component | Version |
1111| -----------| ---------|
1212| karpenter-provider-cluster-api | 0.1.0 |
13- | cluster-api | 1.6 |
14- | kubernetes | 1.30 |
13+ | cluster-api | 1.10 |
14+ | kubernetes | 1.33 |
15+
16+ Karpenter is connected to Cluster API management with ` --cluster-api-kubeconfig ` flag.
17+
18+ ```
19+ +-------------------------+ +---------------------------+
20+ | mgmt | | workload |
21+ | +-------------------+ | cluster-api-kubeconfig | ------------------------ |
22+ | | MachineDeployment | |<-----------------------+ Karpenter |
23+ | +-------------------+ | | +---------------------+ |
24+ | +-------------------+ | | | ClusterAPINodeClass | |
25+ | | MachineSet | | | +---------------------+ |
26+ | +-------------------+ | | +---------------------+ |
27+ | +-------------------+ | | | NodePool | |
28+ | | Machine | | | +---------------------+ |
29+ | +-------------------+ | | +---------------------+ |
30+ +-------------------------+ | | NodeClaim | |
31+ | +---------------------+ |
32+ +---------------------------+
33+ ```
1534
1635## Building
1736
@@ -78,10 +97,17 @@ for more configuration options.
7897
7998### Configuring the Karpenter resources
8099
81- To engage Karpenter in the cluster you will need to create a NodePool and a ClusterAPINodeClass at
82- the minimum. For a deeper discussion of NodePools and NodeClasses, please see the
100+ To engage Karpenter in the cluster you will need to create a NodePool, NodeClaim and a ClusterAPINodeClass at
101+ the minimum. For a deeper discussion of NodePools, NodeClaims and NodeClasses, please see the
83102[ Karpenter documentation on concepts] ( https://karpenter.sh/docs/concepts/ ) .
84103
104+ To apply these custom resources, run the following commands in the cluster that Karpenter will monitor.
105+ ```
106+ kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/karpenter-provider-cluster-api/refs/heads/main/pkg/apis/crds/karpenter.cluster.x-k8s.io_clusterapinodeclasses.yaml
107+ kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/karpenter-provider-cluster-api/refs/heads/main/pkg/apis/crds/karpenter.sh_nodeclaims.yaml
108+ kubectl apply -f https://raw.githubusercontent.com/kubernetes-sigs/karpenter-provider-cluster-api/refs/heads/main/pkg/apis/crds/karpenter.sh_nodepools.yaml
109+ ```
110+
85111The following are basic examples of the NodePool and ClusterAPINodeClass resources. In brief,
86112the NodePool will match on any node that contains the well-known Kubernetes architecture label
87113with a value of ` amd64 ` . Further, the ClusterAPINodeClass will match any MachineDeployment
@@ -153,8 +179,19 @@ metadata:
153179 node.cluster.x-k8s.io/karpenter-member: ""
154180` ` `
155181
182+ # ## Run Karpenter Cluster API provider
183+
184+ Execute the following command to run Karpenter Cluster API Provider in the workload cluster.
185+
186+ ```
187+ ./bin/karpenter-clusterapi-controller --cluster-api-kubeconfig <mgmt.kubeconfig> --leader-election-namespace kube-system
188+ ```
189+
190+ **Caution:**
191+ Because `--leader-election-namespace` defaults to empty, running `bin/karpenter-clusterapi-controller` without this flag and outside an in-cluster environment will result in an error.
192+
156193### Demonstration of Karpenter Cluster API provider
157194
158195This is a demo that was given during the Cluster API office hours meeting on 2024-08-07.
159196
160- <iframe width="560" height="315" src=" https://www.youtube.com/embed/BZz5ibGP7ZQ?si=0Ql-p6hJZHXYfmKB" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
197+ [YouTube video player]( https://www.youtube.com/embed/BZz5ibGP7ZQ?si=0Ql-p6hJZHXYfmKB)
0 commit comments