system-upgrade-controller icon indicating copy to clipboard operation
system-upgrade-controller copied to clipboard

Support pod labels and annotations

Open mbwhelan opened this issue 4 years ago • 2 comments
trafficstars

Is your feature request related to a problem? Please describe. I need to be able to apply pod annotations for the created jobs so that my log collection framework can route the logs to the indexer.

Describe the solution you'd like

Support for setting labels and annotations on upgrade.cattle.io/v1:Plan custom resource.

The full path to spec...labels is whatever the owners would want, but it should generate the Job with the .spec.template.metadata. with the labels and annotations provided.

Example implementation:

---
apiVersion: upgrade.cattle.io/v1
kind: Plan
metadata:
  name: job-name
...
spec:
  metadata
    labels:
      my-custom-label: one
    annotations:
      logging.io/index: my-index
  concurrency: 1
...

It would then generate job manifests similar to this:

apiVersion: batch/v1
kind: Job
metadata:
  name: job-name-hostname
...
spec:
  template:
    metadata:
      name: job-name-hostname1
      labels:
        my-custom-label: one
      annotations:
        logging.io/index: my-index
...

mbwhelan avatar Oct 18 '21 20:10 mbwhelan

What if SUC took existing labels+annotations that aren't in a cattle.io "namespace" from the Plan and set them on the generated Job and Pod template? Are there use-cases where that might be problematic? :thinking:

dweomer avatar Oct 22 '21 04:10 dweomer

That should be fine also.

mbwhelan avatar Oct 22 '21 14:10 mbwhelan