kube-dedicated-pod-admission

command module
v0.0.0-...-c8bf3fd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 17 Imported by: 0

README

kube-dedicated-pod-admission

This is Admission Webhook that adds Pod tolerations and optionally nodeSelector.

For every Pod there will be set these tolerations:

tolerations:
- effect: NoExecute
  key: k8s.smp.io/dedicated
  operator: Equal
  value: $(POD_NAMESPACE)
- effect: NoSchedule
  key: k8s.smp.io/dedicated
  operator: Equal
  value: $(POD_NAMESPACE)

Behaviour customization

Replacing POD_NAMESPACE

If the Pod's namespace has annotation k8s.smp.io/dedicated then instead of using POD_NAMESPACE, the value of this annotation is used. This can be used to stick multiple namespaces to single node group.

Force scheduling to dedicated nodes

If the Pod's namespace has annotation k8s.smp.io/only-dedicated-nodes: "true", then nodeSelector also will be set:

nodeSelector:
  k8s.smp.io/dedicated: $(POD_NAMESPACE)

If the Pod's namespace has annotation k8s.smp.io/only-dedicated-nodes: "annotation", then nodeSelector will be set only for pods that have k8s.smp.io/only-dedicated-nodes: "true" annotation.

Installation

See Kubernetes docs.

Usage

  1. Label and taint your nodes:
kubectl label node NODENAME k8s.smp.io/dedicated=NAMESPACE
kubectl taint node NODENAME k8s.smp.io/dedicated=NAMESPACE:NoExecute
  1. (Optinally) annotate namespaces:
kubectl annotate ns NAMESPACE k8s.smp.io/only-dedicated-nodes=true

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL