kudobuilder / kudo

Kubernetes Universal Declarative Operator (KUDO)
https://kudo.dev
Apache License 2.0
1.17k stars 103 forks source link

Document triggering a plan via the k8s API #1759

Open simonvane opened 3 years ago

simonvane commented 3 years ago

What would you like to be added: Documentation of how to run a specific plan via the k8s API.

Why is this needed: We are using KUDO in a scenario where we need to automate our process. We cannot use kubectl in the process.

Further details: Running a specific plan is mentioned here using $ kubectl kudo plan trigger --name deploy --instance my-instance. We would like to do the same using the k8s API.

It looks like the code that is run by the command above is UpdateInstance.

Would it be a safe approach to patch the instance with the following (as the UpdateInstance method does)?

{
  "spec": {
    "planExecution": {
      "planName": "the-custom-plan",
      "uid": "633f03ba-024f-4c17-a74d-fb3f1a210a40"
    }
  }
}
simonvane commented 3 years ago

Would anyone be able to respond and let us know if what we are doing is safe please?