chickenzord / kube-annotate

Kubernetes mutating admission webhook to automatically annotate pods
MIT License
12 stars 3 forks source link

Update proposal (still maintained?) #3

Open caruccio opened 1 year ago

caruccio commented 1 year ago

Hello.

I'm looking for something like this project to annotate arbitrary objects, using label selectors and jsonpath matchers.

My first use-case is to add some annotations to Ingress objects only if they match a specific host. I believe the config would be something like this:

# config.yaml
- apiVersion: networking.k8s.io/v1
  kind: Ingress
  namespaceSelector:
    team: web
  selector:
    app: frontend
  annotations:
    haproxy.router.openshift.io/response-header.X-Robots-Tag: "noindex, nofollow"
  matches:
  - '$.spec.rules[?(@.host=="www.example.com")]'
- ...

Is it something you are willing to accept a PR? If not, please let me known and I'll fork it to (try) to implement it myself (not a golang programer though).

Best, Mateus