Juju requires creating webhook prefixed with model name

Bug #1872751 reported by Kenneth Koski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Yang Kelvin Liu

Bug Description

I have a charm that deploys a workload that acts as a mutating and validating webhook. If the workload pod doesn't see the mutatingwebhookconfiguration or validatingwebhookconfiguration resources when it boots up, it will create them itself, but can't set them up correctly, as it doesn't have CA info for an HTTPS connection. The issue is that I can't prevent this from happening, as I'm unable to create a mutating/validating without the model name prefixed to it.

As a concrete example, the katib-controller workload pod will boot up, and check to see if mutatingwebhookconfiguration/katib-mutating-webhook-config exists. If it doesn't, it creates it with invalid data. I then tried to create this resource myself with the "mutatingwebhookconfiguration" field of kubernetesResources in the operator pod, so that the workload pod would see that it already exists and skip creating it. However, Juju created mutatingwebhookconfiguration/kubeflow-katib-mutating-webhook-config, which means that the workload pod went and created mutatingwebhookconfiguration/katib-mutating-webhook-config, and now I have two of those resources, one of which is broken.

Tags: k8s
Revision history for this message
Ian Booth (wallyworld) wrote :

The issue is that webhooks are global resources. Unless we prefix with the model name, it's possible to deploy 2 bundles to different models and they will overwrite each other's resources.

The correct juju way to do this is to use relation data to coordinate between workloads instead of looking for hard coded data.

Revision history for this message
Kenneth Koski (knkski) wrote :

Unfortunately there's not much we can do as far as coercing the workload pod into the juju way. Right now, I'm solving it by `kubectl delete`ing the workload-created webhooks. Is there any way we could handle that better in Juju?

Revision history for this message
Ian Booth (wallyworld) wrote :

We can look at providing an optional name attribute to override what Juju does to disambiguate the name used. It's better than kubectl deleting stuff but long term we'd want to fix upstream for sure.

tags: added: k8s
Changed in juju:
milestone: none → 2.8-beta1
status: New → Triaged
importance: Undecided → High
Changed in juju:
assignee: nobody → Yang Kelvin Liu (kelvin.liu)
Revision history for this message
Yang Kelvin Liu (kelvin.liu) wrote :

https://github.com/juju/juju/pull/11490 will be landed to 2.8 to fix this.

Changed in juju:
status: Triaged → In Progress
Ian Booth (wallyworld)
Changed in juju:
status: In Progress → Fix Committed
Harry Pidcock (hpidcock)
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.