Allow standard CRD YAML in customResourceDefinition in pod_spec_set

Bug #1821069 reported by Kenneth Koski
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Ian Booth

Bug Description

The current implementation of passing in `customResourceDefinition` in `pod_spec_set` is kind of tricky, as `pod_spec_set` has a different notion of how that YAML should look, and the property names don't all line up. There's also no error reporting if an invalid property is included (see https://github.com/juju-solutions/layer-caas-base/issues/17), which makes it difficult to know coming in how to use `customResourceDefinition` in `pod_spec_set`.

Would it be possible to introspect the passed-in YAML and if it looks like regular K8S CRD YAML, just pass it straight through to K8S?

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

The yaml sent by the charm to specify crd is now something like this:

is a map of specs keyed on name

customResourceDefinitions:
  pytorchjobs.kubeflow.org:
    group: kubeflow.org
    version: v1beta1
    names:
      kind: PyTorchJob
      plural: pytorchjobs
      singular: pytorchjob
    scope: Namespaced
    validation:
      openAPIV3Schema:
        properties:
          spec:
            properties:
              pytorchReplicaSpecs:
                properties:
                  Master:
                    properties:
                      replicas:
                        maximum: 1
                        minimum: 1
                        type: integer
                  Worker:
                    properties:
                      replicas:
                        minimum: 1
                        type: integer

Changed in juju:
milestone: none → 2.5.4
status: New → In Progress
importance: Undecided → High
assignee: nobody → Ian Booth (wallyworld)
Revision history for this message
Ian Booth (wallyworld) wrote :

And here's how I changed the kubeflow-tf-job-operator charm's kubeflow_tf_job_operator.py for example: https://pastebin.ubuntu.com/p/R5spCXjnHk/

Changed in juju:
status: In Progress → Fix Committed
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.