Difference between revisions of "Kind: Provisioner"
Jump to navigation
Jump to search
(7 intermediate revisions by 3 users not shown) | |||
Line 2: | Line 2: | ||
[[kind:]] Provisioner | [[kind:]] Provisioner | ||
− | + | * <code>[[kubectl get provisioner -o yaml]]</code> | |
− | + | * <code>[[kubectl get provisioner]]</code> | |
+ | |||
+ | |||
+ | == Official Karpenter provisioner example == | ||
+ | |||
+ | apiVersion: [[karpenter.sh/v1alpha5]] | ||
+ | kind: Provisioner | ||
+ | <pre> | ||
+ | metadata: | ||
+ | name: default | ||
+ | spec: | ||
+ | # References cloud provider-specific custom resource, see your cloud provider specific documentation | ||
+ | providerRef: | ||
+ | name: default | ||
+ | |||
+ | # Provisioned nodes will have these taints | ||
+ | # Taints may prevent pods from scheduling if they are not tolerated by the pod. | ||
+ | taints: | ||
+ | - key: example.com/special-taint | ||
+ | effect: NoSchedule | ||
+ | |||
+ | # Provisioned nodes will have these taints, but pods do not need to tolerate these taints to be provisioned by this | ||
+ | # provisioner. These taints are expected to be temporary and some other entity (e.g. a DaemonSet) is responsible for | ||
+ | # removing the taint after it has finished initializing the node. | ||
+ | startupTaints: | ||
+ | - key: example.com/another-taint | ||
+ | effect: NoSchedule | ||
+ | |||
+ | # Labels are arbitrary key-values that are applied to all nodes | ||
+ | labels: | ||
+ | billing-team: my-team | ||
+ | |||
+ | # Requirements that constrain the parameters of provisioned nodes. | ||
+ | # These requirements are combined with pod.spec.affinity.nodeAffinity rules. | ||
+ | # Operators { In, NotIn } are supported to enable including or excluding values | ||
+ | requirements: | ||
+ | - key: "karpenter.k8s.aws/instance-category" | ||
+ | operator: In | ||
+ | values: ["c", "m", "r"] | ||
+ | - key: "karpenter.k8s.aws/instance-cpu" | ||
+ | operator: In | ||
+ | values: ["4", "8", "16", "32"] | ||
+ | - key: "karpenter.k8s.aws/instance-hypervisor" | ||
+ | operator: In | ||
+ | values: ["nitro"] | ||
+ | - key: "topology.kubernetes.io/zone" | ||
+ | operator: In | ||
+ | values: ["us-west-2a", "us-west-2b"] | ||
+ | - key: "kubernetes.io/arch" | ||
+ | operator: In | ||
+ | values: ["arm64", "amd64"] | ||
+ | - key: "karpenter.sh/capacity-type" # If not included, the webhook for the AWS cloud provider will default to on-demand | ||
+ | operator: In | ||
+ | values: ["spot", "on-demand"] | ||
+ | |||
+ | # Karpenter provides the ability to specify a few additional Kubelet args. | ||
+ | # These are all optional and provide support for additional customization and use cases. | ||
+ | kubeletConfiguration: | ||
+ | clusterDNS: ["10.0.1.100"] | ||
+ | containerRuntime: containerd | ||
+ | systemReserved: | ||
+ | cpu: 100m | ||
+ | memory: 100Mi | ||
+ | ephemeral-storage: 1Gi | ||
+ | kubeReserved: | ||
+ | cpu: 200m | ||
+ | memory: 100Mi | ||
+ | ephemeral-storage: 3Gi | ||
+ | evictionHard: | ||
+ | memory.available: 5% | ||
+ | nodefs.available: 10% | ||
+ | nodefs.inodesFree: 10% | ||
+ | evictionSoft: | ||
+ | memory.available: 500Mi | ||
+ | nodefs.available: 15% | ||
+ | nodefs.inodesFree: 15% | ||
+ | evictionSoftGracePeriod: | ||
+ | memory.available: 1m | ||
+ | nodefs.available: 1m30s | ||
+ | nodefs.inodesFree: 2m | ||
+ | evictionMaxPodGracePeriod: 3m | ||
+ | podsPerCore: 2 | ||
+ | maxPods: 20 | ||
+ | |||
+ | # Resource limits constrain the total size of the cluster. | ||
+ | # Limits prevent Karpenter from creating new instances once the limit is exceeded. | ||
+ | limits: | ||
+ | resources: | ||
+ | cpu: "1000" | ||
+ | memory: 1000Gi | ||
+ | |||
+ | # Enables consolidation which attempts to reduce cluster cost by both removing un-needed nodes and down-sizing those | ||
+ | # that can't be removed. Mutually exclusive with the ttlSecondsAfterEmpty parameter. | ||
+ | consolidation: | ||
+ | enabled: true | ||
+ | |||
+ | # If omitted, the feature is disabled and nodes will never expire. If set to less time than it requires for a node | ||
+ | # to become ready, the node may expire before any pods successfully start. | ||
+ | ttlSecondsUntilExpired: 2592000 # 30 Days = 60 * 60 * 24 * 30 Seconds; | ||
+ | |||
+ | # If omitted, the feature is disabled, nodes will never scale down due to low utilization | ||
+ | ttlSecondsAfterEmpty: 30 | ||
+ | |||
+ | # Priority given to the provisioner when the scheduler considers which provisioner | ||
+ | # to select. Higher weights indicate higher priority when comparing provisioners. | ||
+ | # Specifying no weight is equivalent to specifying a weight of 0. | ||
+ | weight: 10 | ||
+ | </pre> | ||
== Related == | == Related == | ||
Line 12: | Line 119: | ||
* <code>[[ttlSecondsUntilExpired]]</code> | * <code>[[ttlSecondsUntilExpired]]</code> | ||
* <code>[[Provisioner API]]</code> | * <code>[[Provisioner API]]</code> | ||
+ | * <code>[[kind: AWSNodeTemplate]]</code> | ||
+ | * <code>[[kind: EC2NodeClass]]</code> | ||
== See also == | == See also == | ||
+ | * {{kind: Provisioner}} | ||
* {{kubectl provisioner}} | * {{kubectl provisioner}} | ||
+ | * {{karpenter.sh}} | ||
* {{Kubernetes provisioner}} | * {{Kubernetes provisioner}} | ||
* {{Karpenter}} | * {{Karpenter}} | ||
[[Category:K8s]] | [[Category:K8s]] |
Latest revision as of 07:18, 2 October 2024
kind: Provisioner
Official Karpenter provisioner example[edit]
apiVersion: karpenter.sh/v1alpha5 kind: Provisioner
metadata: name: default spec: # References cloud provider-specific custom resource, see your cloud provider specific documentation providerRef: name: default # Provisioned nodes will have these taints # Taints may prevent pods from scheduling if they are not tolerated by the pod. taints: - key: example.com/special-taint effect: NoSchedule # Provisioned nodes will have these taints, but pods do not need to tolerate these taints to be provisioned by this # provisioner. These taints are expected to be temporary and some other entity (e.g. a DaemonSet) is responsible for # removing the taint after it has finished initializing the node. startupTaints: - key: example.com/another-taint effect: NoSchedule # Labels are arbitrary key-values that are applied to all nodes labels: billing-team: my-team # Requirements that constrain the parameters of provisioned nodes. # These requirements are combined with pod.spec.affinity.nodeAffinity rules. # Operators { In, NotIn } are supported to enable including or excluding values requirements: - key: "karpenter.k8s.aws/instance-category" operator: In values: ["c", "m", "r"] - key: "karpenter.k8s.aws/instance-cpu" operator: In values: ["4", "8", "16", "32"] - key: "karpenter.k8s.aws/instance-hypervisor" operator: In values: ["nitro"] - key: "topology.kubernetes.io/zone" operator: In values: ["us-west-2a", "us-west-2b"] - key: "kubernetes.io/arch" operator: In values: ["arm64", "amd64"] - key: "karpenter.sh/capacity-type" # If not included, the webhook for the AWS cloud provider will default to on-demand operator: In values: ["spot", "on-demand"] # Karpenter provides the ability to specify a few additional Kubelet args. # These are all optional and provide support for additional customization and use cases. kubeletConfiguration: clusterDNS: ["10.0.1.100"] containerRuntime: containerd systemReserved: cpu: 100m memory: 100Mi ephemeral-storage: 1Gi kubeReserved: cpu: 200m memory: 100Mi ephemeral-storage: 3Gi evictionHard: memory.available: 5% nodefs.available: 10% nodefs.inodesFree: 10% evictionSoft: memory.available: 500Mi nodefs.available: 15% nodefs.inodesFree: 15% evictionSoftGracePeriod: memory.available: 1m nodefs.available: 1m30s nodefs.inodesFree: 2m evictionMaxPodGracePeriod: 3m podsPerCore: 2 maxPods: 20 # Resource limits constrain the total size of the cluster. # Limits prevent Karpenter from creating new instances once the limit is exceeded. limits: resources: cpu: "1000" memory: 1000Gi # Enables consolidation which attempts to reduce cluster cost by both removing un-needed nodes and down-sizing those # that can't be removed. Mutually exclusive with the ttlSecondsAfterEmpty parameter. consolidation: enabled: true # If omitted, the feature is disabled and nodes will never expire. If set to less time than it requires for a node # to become ready, the node may expire before any pods successfully start. ttlSecondsUntilExpired: 2592000 # 30 Days = 60 * 60 * 24 * 30 Seconds; # If omitted, the feature is disabled, nodes will never scale down due to low utilization ttlSecondsAfterEmpty: 30 # Priority given to the provisioner when the scheduler considers which provisioner # to select. Higher weights indicate higher priority when comparing provisioners. # Specifying no weight is equivalent to specifying a weight of 0. weight: 10
Related[edit]
- Kubernetes Persistent Volume Claim (PVC)
karpenter.sh/capacity-type: [ spot | on-demand ]
Karpenter
apiVersion
ttlSecondsUntilExpired
Provisioner API
kind: AWSNodeTemplate
kind: EC2NodeClass
See also[edit]
kind: Provisioner, kind: AWSNodeTemplate
kubeclt [ get | describe | patch ] provisioner
karpenter.sh [ /capacity-type | /discovery | /arch | /provisioner-name | /do-not-evict | /do-not-consolidate | /termination | /discovery ]
, provisioners.karpenter.sh- Kubernetes provisioner:
kubernetes.io/gce-pd, kubernetes.io/aws-ebs, pd.csi.storage.gke.io, k8s.io/minikube-hostpath
,ExternalProvisioning
,kubectl get provisioner, kubectl describe provisioner, kubectl patch provisioner
- Karpenter,
karpenter.sh, provisioners.karpenter.sh
, Karpenter releases, best practices,karpenter.sh/capacity-type, karpenter.sh/discovery
,kind: Provisioner, kind: AWSNodeTemplate
,kubectl provisioner
,TopologyKey, FailedDraining, Evict, DisruptionBlocked
, Karpenter logs,controller., ttlSecondsUntilExpired
, KEDA, NodePools, Kind: NodePool, Workload Consolidation, Disruption controls
Advertising: