Skip to content

Latest commit

 

History

History
91 lines (77 loc) · 1.58 KB

Controllers.md

File metadata and controls

91 lines (77 loc) · 1.58 KB

AKS Admission Controllers

PodNodeSelector

cat <<EOF | kubectl apply -f - apiVersion: v1 kind: Namespace metadata: annotations: scheduler.alpha.kubernetes.io/node-selector: env=development name: dev EOF

cat <<EOF | kubectl apply -f - apiVersion: v1 kind: Pod metadata: name: nginx namespace: dev spec: containers:

  • name: nginx image: nginx EOF

cat <<EOF | kubectl apply -f - apiVersion: v1 kind: Pod metadata: name: nginx namespace: dev spec: containers:

  • name: nginx image: nginx nodeSelecor: env: prod EOF

PodTolerationRestriction

apiVersion: v1 kind: Namespace metadata: name: apps-that-need-nodes-exclusively annotations: scheduler.alpha.kubernetes.io/defaultTolerations: '[{"operator": "Exists", "effect": "NoSchedule", "key": "dedicated-node"}]'

cat <<EOF | kubectl apply -f - apiVersion: v1 kind: Pod metadata: name: nginx namespace: apps-that-need-nodes-exclusively spec: containers:

  • name: nginx image: nginx EOF

ExtendedResourceToleration

kubectl taint no aks-nodes-32411630-vmss000000 nvidia.com/gpu:NoSchedule

cat <<EOF | kubectl apply -f - apiVersion: batch/v1 kind: Job metadata: labels: app: samples-tf-mnist-demo name: samples-tf-mnist-demo spec: template: metadata: labels: app: samples-tf-mnist-demo spec: containers: - name: samples-tf-mnist-demo image: microsoft/samples-tf-mnist-demo:gpu args: ["--max_steps", "500"] imagePullPolicy: IfNotPresent resources: limits: nvidia.com/gpu: 1 restartPolicy: OnFailure EOF