~ knotless Search/
↑↓ move↵ open⇧↵ all results

johnandersen777.bsky.social/socialweb-computer-console

console.socialweb.computer: kcp, kubectl and ssh compiled to wasm in a browser tab with a terminal; a kcp fork

0
0
main
30 lines · 976 B Raw History
# Applied in the PROVIDER workspace.
#
# Server-less alternative to the webhook: a ValidatingAdmissionPolicy runs CEL
# inside kcp -- no external server, no certs. kcp makes VAPs cluster-aware the
# same way as webhooks: define them in the provider workspace and they apply to
# every consumer that binds the export.
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicy
metadata:
  name: cowboy-intent-policy
spec:
  failurePolicy: Fail
  matchConstraints:
    resourceRules:
    - apiGroups: ["wildwest.dev"]
      apiVersions: ["v1alpha1"]
      operations: ["CREATE", "UPDATE"]
      resources: ["cowboys"]
  validations:
  - expression: '!has(object.spec.intent) || object.spec.intent != "bad"'
    message: 'spec.intent must not be "bad"'
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingAdmissionPolicyBinding
metadata:
  name: cowboy-intent-policy-binding
spec:
  policyName: cowboy-intent-policy
  validationActions: ["Deny"]