Skip to content

cronjob apprepo-kubeapps-sync-datahub fails #8272

Open
@Dan753

Description

@Dan753

Describe the bug
cronjob apprepo-kubeapps-sync-datahub is failing

To Reproduce
When kuebeapps-internal-apprepository-controller is trying to create the cronjob apprepo-kubeapps-sync-datahub
it fails with the error:

E0128 02:17:21.012201 1 controller.go:466] Unable to create Job "apprepo-kubeapps-sync-datahub-repo-" for AppRepository "kubeapps/datahub-repo":
Job.batch "apprepo-kubeapps-sync-datahub-repo-rcsrm" is invalid: spec.template.spec.containers[0].volumeMounts[1].mountPath:
Invalid value: "/usr/local/share/ca-certificates": must be unique
E0128 02:17:21.012236 1 controller.go:281] error syncing "kubeapps/datahub-repo": Job.batch "apprepo-kubeapps-sync-datahub-repo-rcsrm"
is invalid: spec.template.spec.containers[0].volumeMounts[1].mountPath: Invalid value: "/usr/local/share/ca-certificates": must be unique

The must be unique error code is a storage error that occurs when k8s try to mount multiple source volumes to the same destination path within
apprepo-kubeapps-sync-datahub container specification. More specifically, it means that every mountPath in the volumeMounts section of the container must be unique.
But in the cronjob apprepo-kubeapps-sync-datahub-repo specifications there is only one volume to be mounted to /usr/local/share/ca-certificates:

  • name apprepo-datahub-repo-secrets
    secret
    secretname: apprepo-datahub-repo-secrets
    In spite of only one secret is to be mounted the error points to an attempt that multiple distintct secret sources are to be merged under a flat structue.
    When checking the the secret apprepo-datahub-repo-secrets one can see that it is managed by helm.
    In the same time in the apprepo-kubeapps-sync-datahub-repo cronjob the volume creation is managed by the apprepository-controller.
    One explanation could be that when the job is run the apprepository-controller is recreating the volume secret thus duplicating the already created secret

Expected behavior
cronjob apprepo-kubeapps-sync-datahub needs to complete successful

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Version [2.12.1]
  • Kubernetes version [1.28.7]
  • Package version [17.1.2]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugAn issue that reports a defect in an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions