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

replicas can't restore #5722

Closed
631068264 opened this issue Dec 29, 2022 · 6 comments
Closed

replicas can't restore #5722

631068264 opened this issue Dec 29, 2022 · 6 comments

Comments

@631068264
Copy link

631068264 commented Dec 29, 2022

What steps did you take and what happened:
[A clear and concise description of what the bug is, and what commands you ran.)

I try a simple example

apiVersion: v1
kind: Namespace
metadata:
  name: nginx-example
  labels:
    app: nginx

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  namespace: nginx-example
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - image: nginx
        name: nginx
        ports:
        - containerPort: 80

bundle-2022-12-29-15-28-06.tar.gz

After backup ,change replicas to 3 from 2 , the restore result get success but number of replicas is 3 not 2

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • Velero version (use velero version): 1.8
  • Velero features (use velero client config get features):
  • Kubernetes version (use kubectl version): v1.18.6
  • Kubernetes installer & version:
  • Cloud provider or hardware configuration:
  • OS (e.g. from /etc/os-release):
@631068264 631068264 changed the title "Restore of ReplicaSet, xxxx-769f67b68 skipped: it already exists in the cluster and is the same as the backed up version" Restore get PartiallyFailed Dec 29, 2022
@631068264 631068264 changed the title Restore get PartiallyFailed replicas can't not restore Dec 29, 2022
@631068264 631068264 changed the title replicas can't not restore replicas can't restore Dec 29, 2022
@blackpiglet
Copy link
Contributor

@631068264
I think this is how Velero works. Velero can only restore the state of cluster when backup is created. Velero cannot reflect the state of cluster after backup dynamically.

@631068264
Copy link
Author

631068264 commented Jan 3, 2023

When I backup the replicas is 2,then after restore the replicas must 2, whatever I do before restore. I think this is the basic reason for me to backup. Why Velero can't do that ? @blackpiglet

What does the state include? Not inculude replicas ?

@blackpiglet
Copy link
Contributor

blackpiglet commented Jan 3, 2023

I had some misunderstanding.
After restore, the result's replica is 3, not 2.

The restore is applied to the same cluster as where the backup is created, right?
If the backed up deployment is still there, Velero will skip the resource during restore process.

@631068264
Copy link
Author

631068264 commented Jan 3, 2023

Yes , this is what I want to say.

So to achieve what I want , I must delete the backed resources even they have some changes before restore they in the same cluster?

@blackpiglet
Copy link
Contributor

Yes. Velero will not overwrite the existing resources in cluster. This way is more conservative, but it's more safe to not trigger some unexpected issues.

@631068264
Copy link
Author

OK I see , thanks.

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

2 participants