A Heart Rate Dynamic Admission Controller

Tom Gallacher
Sep 5, 2018 · 4 min read
“no entry sign on metal rail in front of building during day” by Fikri Rasyid on Unsplash

Validating Admission Webhooks


My pretty bicycle, note, it isn’t this clean now.

apiVersion: admissionregistration.k8s.io/v1beta1
kind: ValidatingWebhookConfiguration
metadata:
  name: deny-heartrate
webhooks:
  - name: deny-heartrate.yld.io
    rules:
      - apiGroups:
          - ""
        apiVersions:
          - "v1"
        operations:
          - "CREATE"
        resources:
          - "pods"
    failurePolicy: Fail
    clientConfig:
      url: "https://192.168.99.1:8080"
      caBundle: "%%API_CERTIFICATE%%"
{ "response": {
    "allowed": true,
  }
}
{ "response": {
    "allowed": false,
    "status": {
      "status": "Failure",
      "message": "heart rate: 120 is too low (Lower than 130)",
      "reason": "heart rate: 120 is too low (Lower than 130)",
      "code": 402
    }
  }
}

YLD Blog

YLD's latest thoughts on Software Engineering, Design and Digital Products

Tom Gallacher

Written by

🏎️🛣️🚴👨‍💻🍺. Linux performance privateer & DevOps extraordinaire, Often seen happily writing code without any knowledge of his surroundings. @YLDio

YLD Blog

YLD Blog

YLD's latest thoughts on Software Engineering, Design and Digital Products