Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Velero backup but not restore helm charts using deployment name selector #8560

Open
masalinas opened this issue Dec 27, 2024 · 4 comments
Open

Comments

@masalinas
Copy link

masalinas commented Dec 27, 2024

What steps did you take and what happened:

  1. deploy a helm chart
$ helm install poc-k8s-keycloak-angular oci://registry-1.docker.io/ofertoio/poc-k8s-keycloak-angular-chart

The chart is deployed ok

  1. backup a helm chart using its name:
$ velero backup create poc-k8s-keycloak-angular-chart-backup --selector app.kubernetes.io/name=poc-k8s-keycloak-angular-
chart

The backup is created ok

  1. List your helm installed:
$ helm -n default list

The helm is showed ok.

  1. remove a helm chart:
$ helm delete poc-k8s-keycloak-angular-chart

The chart is removed ok.

  1. restore the helm chart
$ velero restore create --from-backup poc-k8s-keycloak-angular-chart-backup

All chart resources (deployment, pod and service) are restores ok, but the helm labels not, so when you execute again

$ helm -n default list

My original helm chart is not showed

What did you expect to happen:
Restore all chart resources and the labels atatched to helm and continue using these resources as a original helm chart.

The following information will help us better understand what's going on:

I noticed that velero not restore the metadata labels attached to helm like these ones:

  labels:
    app.kubernetes.io/instance: poc-k8s-keycloak-angular
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: poc-k8s-keycloak-angular-chart
    app.kubernetes.io/version: 1.5.0
    helm.sh/chart: poc-k8s-keycloak-angular-chart-1.5.0
  annotations:
    deployment.kubernetes.io/revision: '1'
    meta.helm.sh/release-name: poc-k8s-keycloak-angular
    meta.helm.sh/release-namespace: default

Environment:

  • Helm version: v.3.16.4
  • Velero version (use velero version): 1.15.0
  • Velero features (use velero client config get features): Plugin AWS 1.11.0 compatible with velero 1.15.0
  • Kubernetes version (use kubectl version): 1.27.4
  • Kubernetes installer & version: minikube 1.31.2
  • Cloud provider or hardware configuration: localhost
  • OS (e.g. from /etc/os-release): ubuntu 24.04 LTS

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.

  • 👍 for "I would like to see this bug fixed as soon as possible"
  • 👎 for "There are more important bugs to focus on right now"
@masalinas masalinas changed the title Velero don't backup helm chart correctly Velero don't backup and restore helm chart correctly Dec 27, 2024
@masalinas masalinas changed the title Velero don't backup and restore helm chart correctly Velero don't backup and restore helm chart correctly using deployment name Dec 27, 2024
@masalinas masalinas changed the title Velero don't backup and restore helm chart correctly using deployment name Velero don't backup and restore helm chart using deployment name Dec 27, 2024
@masalinas masalinas changed the title Velero don't backup and restore helm chart using deployment name Velero backup but not restore helm chart using deployment name Dec 27, 2024
@masalinas masalinas changed the title Velero backup but not restore helm chart using deployment name Velero backup but not restore helm charts using deployment name selector Dec 27, 2024
@masalinas
Copy link
Author

masalinas commented Dec 29, 2024

I discovered a way to backup the chart:

velero backup create poc-k8s-keycloak-angular-chart --or-selector "app.kubernetes.io/name=poc-k8s-keycloak-angular or name=poc-k8s-keycloak-angular"

This command backup all resources and the helm secret attached to our resources . This is the best way to backup charts?

@blackpiglet
Copy link
Contributor

blackpiglet commented Dec 30, 2024

Is #8561 duplicated of this issue?
If it is, then I suggest we close #8561, and discuss in this one.

@blackpiglet
Copy link
Contributor

If you need to filter resources with multiple labels, and the relation between those labels are or, to me, the method you mentioned is the only way.

@masalinas
Copy link
Author

This ticket try to resolve the same task: backup charts in kubernetes:

Finally I discovered that using a --or-selector explained in this thread, it is possible backup the chart resources and the chart metadata at the same time, but this is the best way to do that?. I considere that use charts nowadays in kubernetes is an standard way to deploy your services, so I would like to know the best way to make backups using velero.

Yes I will close the ticket #8561 and continue with this one.

This is the debug bundle from my cluster:
bundle-2024-12-30-09-02-15.tar.gz

@reasonerjt reasonerjt self-assigned this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants