Skip to content

cronjob: Add labels to pod template #773

@pfaelzerchen

Description

@pfaelzerchen

Description of the change

Currently, under cronjob.cronjob.label one can only specify labels for the cronJob object itself. It would be nice to be able to specify labels for the cronjob pods within the spec.jobTemplate.spec.template.metdata.labels. For example by:

cronjob:
  enabled: true
  type: cronjob

  cronjob:
    jobLabel:
      app: nextcloud-cron

for

spec:
  jobTemplate:
    spec:
      template:
        metadata:
          labels:
            app: nextcloud-cron

Benefits

You can specify netpol rules for the job pods. This is mandatory if you already use fine-grained netpol rules for service communication, as the job would fail then.

Possible drawbacks

Can't think of any.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions