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

Pod restart after each backup when Mutating Webhook enabled #396

Closed
hossainemruz opened this issue Mar 25, 2018 · 3 comments
Closed

Pod restart after each backup when Mutating Webhook enabled #396

hossainemruz opened this issue Mar 25, 2018 · 3 comments
Labels
Milestone

Comments

@hossainemruz
Copy link
Contributor

Pod restart after each backup when Mutating Webhook is enabled.
Stash Version: 0.7.0-rc.2
kubectl version: v1.9.0
How to recreate ?

  1. Install stash with --enable-mutating-webhook
  2. Create Restic.
  3. Create a deployment that has label that match Restic selector.

Now, after each backup the pod will restart.

Reason:
Reason is not clear yet. It seems every time there is an unexpected type:"" filed toggle between oldRestic and NewRestic.
Here is backend part oldRestic.

  "backend": {
         "storageSecretName": "local-secret",
         "local": {
            "hostPath": {
               "path": "/data/stash-test/restic-repo",
               "type": ""
            },
            "mountPath": "/safe/data"
         }
      },

Here is backend part of newRestic

  "backend": {
         "storageSecretName": "local-secret",
         "local": {
            "hostPath": {
               "path": "/data/stash-test/restic-repo"
            },
            "mountPath": "/safe/data"
         }
      },

This two part seems to be interchange after each backup. This cause patch deployment after every backup. resourceVersion of Restic is changed after every backup. As resourceVersion of Restic is used as annotation of Pod, it restart after each backup.

@tamalsaha tamalsaha added the bug label Mar 25, 2018
@tamalsaha tamalsaha added this to the 0.7.0 milestone Mar 25, 2018
@tamalsaha
Copy link
Member

This cause patch deployment after every backup. resourceVersion of Restic is changed after every backup. As resourceVersion of Restic is used as annotation of Pod, it restart after each backup.

I think that is the problem

@tamalsaha
Copy link
Member

type ResticStatus struct {
	FirstBackupTime          *metav1.Time `json:"firstBackupTime,omitempty"`
	LastBackupTime           *metav1.Time `json:"lastBackupTime,omitempty"`
	LastSuccessfulBackupTime *metav1.Time `json:"lastSuccessfulBackupTime,omitempty"`
	LastBackupDuration       string       `json:"lastBackupDuration,omitempty"`
	BackupCount              int64        `json:"backupCount,omitempty"`
}

@tamalsaha
Copy link
Member

This changes after every backup. So, causes restarts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants