k8up-io / k8up

Kubernetes and OpenShift Backup Operator
https://k8up.io/
Apache License 2.0
717 stars 66 forks source link

RestoreSpec.podConfigRef doesn't seem to work #1019

Open deitmerit opened 1 month ago

deitmerit commented 1 month ago

Description

I would like to use RestoreSpec.podConfigRef (to set podAffinity rules, which I need to be able to restore a backup to a ReadWriteOnce PV). However, they don't seem to work.

This is how I set up my Restore and PodConfig resources:

apiVersion: k8up.io/v1
kind: PodConfig
metadata:
  name: restore-podconfig
spec:
  template:
    spec:
      containers: [ ]
      affinity:
        podAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            - topologyKey: kubernetes.io/hostname
              labelSelector:
                matchExpressions:
                  - key: app.kubernetes.io/name
                    operator: In
                    values:
                      - foo
---
apiVersion: k8up.io/v1
kind: Restore
metadata:
  name: restore
spec:
  podConfigRef:
    name: restore-podconfig
  restoreMethod:
    folder:
      claimName: pvc-foo
  backend:
    s3: [...]
    repoPasswordSecretRef:
      name: backup-encryption
      key: password

The generated restore pod has no affinity set at all.

BTW, for backups I do the same, and it works.

Additional Context

No response

Logs

No response

Expected Behavior

I expect the generated restore pods to have the affinity set as specified in the PodConfig resource.

Steps To Reproduce

No response

Version of K8up

v4.8.1

Version of Kubernetes

v1.31.1

Distribution of Kubernetes

Talos 1.8