-
Notifications
You must be signed in to change notification settings - Fork 838
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provisioning tasks docs first draft (#871)
* Provisioning tasks docs first draft * Responded to PR comments
- Loading branch information
1 parent
051ddff
commit 1ab9895
Showing
1 changed file
with
79 additions
and
0 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,79 @@ | ||
--- | ||
title: "Provisioning" | ||
linkTitle: "Provisioning" | ||
weight: 5 | ||
--- | ||
|
||
When you first installed Karpenter, you set up a default [Provisioner](../getting-started/#provisioner). | ||
The Provisioner sets constraints on the nodes that can be created by Karpenter and the pods that can run on those nodes. | ||
The Provisioner can be set to do things like: | ||
|
||
* Define taints to limit the pods that can run on nodes Karpenter creates | ||
* Limit node creation to certain zones, instance types, and computer architectures | ||
* Set defaults for node expiration | ||
|
||
You can change your provisioner or add other provisioners to Karpenter. | ||
Here are things you should know about Provisioners: | ||
|
||
* Karpenter won't do anything if there is not at least one Provisioner configured. | ||
* Each Provisioner that is configured is looped through by Karpenter. | ||
* If Karpenter encounters a taint in the Provisioner that is not tolerated by a Pod, Karpenter won't use that Provisioner to provision the pod. | ||
* It is recommended to create Provisioners that are mutually exclusive. So no Pod should match multiple Provisioners. If multiple Provisioners are matched, Karpenter will randomly choose which to use. | ||
|
||
If you want to modify or add provisioners to Karpenter, do the following: | ||
|
||
1. Review the following Provisioner documents: | ||
* [Provisioner](../getting-started/#provisioner) in the Getting Started guide for a sample default Provisioner | ||
* [Provisioner API](../provisioner-crd) for descriptions Provisioner API values | ||
* [Provisioning Configuration](../AWS/constraints) for cloud-specific settings | ||
|
||
1. Apply the new or modified Provisioner to the cluster. | ||
|
||
The following examples illustrate different aspects of Provisioners. | ||
Refer to [Running pods](../tasks/running-pods) to see how the same features are used in Pod specs to determine where pods run. | ||
|
||
## Example: Requirements | ||
|
||
This provisioner limits nodes to specific zones. | ||
It is flexible to both spot and on-demand capacity types. | ||
|
||
``` | ||
apiVersion: karpenter.sh/v1alpha5 | ||
kind: Provisioner | ||
metadata: | ||
name: westzones | ||
spec: | ||
requirements: | ||
- key: "topology.kubernetes.io/zone" | ||
operator: In | ||
values: ["us-west-2a", "us-west-2b", "us-west-2c"] | ||
- key: "karpenter.sh/capacity-type" | ||
operator: In | ||
values: ["spot", "on-demand"] | ||
provider: | ||
instanceProfile: myprofile-cluster101 | ||
``` | ||
With these settings, the provisioner is able to launch nodes in three availability zones and is flexible to both spot and on-demand purchase types. | ||
|
||
## Example: Isolating Expensive Hardware | ||
|
||
A provisioner can be set up to only provision nodes on particular processor types. | ||
The following example sets a taint that only allows pods with tolerations for Nvidia GPUs to be scheduled: | ||
|
||
``` | ||
apiVersion: karpenter.sh/v1alpha5 | ||
kind: Provisioner | ||
metadata: | ||
name: gpu | ||
spec: | ||
ttlSecondsAfterEmpty: 60 | ||
requirements: | ||
- key: node.kubernetes.io/instance-type | ||
operator: In | ||
values: ["p3.8xlarge", "p3.16xlarge"] | ||
taints: | ||
- key: nvidia.com/gpu | ||
value: true | ||
effect: “NoSchedule” | ||
``` | ||
In order for a pod to run on a node defined in this provisioner, it must tolerate `nvidia.com/gpu` in its pod spec. |