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 integration in the test environment #903

Merged
merged 7 commits into from
Jul 5, 2023
Merged

Commits on Jul 4, 2023

  1. Move minio module to drenv

    Promote ramenctl.minio helper module to drenv.minio so we can use it in
    the velero addon. This is module is not really generic and depend on the
    specific way we deploy the minio addon, but we don't have a better place
    for this now.
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    nirs committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    e8286a8 View commit details
    Browse the repository at this point in the history
  2. Add velero to required tools for drenv

    To install and debug *Velero* we need the `velero` tool. Add it to the
    required tools list like all other tools.
    
    I think we can simplify this later by installing the tools
    automatically, but we can improve this later.
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    nirs committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    6023212 View commit details
    Browse the repository at this point in the history
  3. Add minimal velero environment

    For testing velero it is much faster to use a small and simpler
    environment.
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    nirs committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    9e399a7 View commit details
    Browse the repository at this point in the history
  4. Deploy velero on the cluster

    Use the velero command (new requirement) to install velero on the
    managed clusters.
    
    Installing velero also installs velero crds, so previous code to install
    them was removed.
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    nirs committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    577f612 View commit details
    Browse the repository at this point in the history
  5. Add velero self test

    The test deploy nginx, creates a backup, delete the namespace and store
    nginx from the backup. Finally it cleans up so we don't leave anything
    on the cluster.
    
    The test is idempotent - if the tests fails and leave junk around, the
    next run will delete backups and restores and start from scratch.
    
    Issues:
    
    - Restore completes successfully - but has a warning. The deployment
      looks correct and the warning looks like expected behavior when
      backing up all resources blindly.
    
        $ velero restore get
        NAME                          BACKUP         STATUS      STARTED                         COMPLETED                       ERRORS   WARNINGS   CREATED                         SELECTOR
        nginx-backup-20230602013503   nginx-backup   Completed   2023-06-02 01:35:03 +0300 IDT   2023-06-02 01:35:04 +0300 IDT   0        1          2023-06-02 01:35:03 +0300 IDT   <none>
    
        $ velero restore describe | grep Warn
        Warnings:
            nginx-example:  could not restore, Endpoints "my-nginx" already
            exists. Warning: the in-cluster version is different than the
            backed-up version.
    
        $ kubectl get all -n nginx-example
        NAME                                    READY   STATUS    RESTARTS   AGE
        pod/nginx-deployment-7c89967545-zgb7h   1/1     Running   0          41s
        pod/nginx-deployment-7c89967545-zrf2s   1/1     Running   0          41s
    
        NAME               TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
        service/my-nginx   LoadBalancer   10.103.206.98   <pending>     80:32334/TCP   41s
    
        NAME                               READY   UP-TO-DATE   AVAILABLE   AGE
        deployment.apps/nginx-deployment   2/2     2            2           41s
    
        NAME                                          DESIRED   CURRENT   READY   AGE
        replicaset.apps/nginx-deployment-7c89967545   2         2         2       41s
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    nirs committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    062b746 View commit details
    Browse the repository at this point in the history
  6. Rename ramen s3 secret

    We need to add a velero s3 secret for the velero bucket. Rename the
    ramen s3 secret to so we can have consistent and clear names.
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    nirs committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    2c2ea1a View commit details
    Browse the repository at this point in the history
  7. Add velero configuration to ramenctl config

    Velero uses the same s3 bucket using the same s3 profile, but it needs a
    different secret stored at `veleroNamespaceSecretKeyRef`.  The secret is
    created by `velero install`.
    
    Seems to be complete, but not tested with ramen yet.
    
    Signed-off-by: Nir Soffer <nsoffer@redhat.com>
    nirs committed Jul 4, 2023
    Configuration menu
    Copy the full SHA
    41eb99c View commit details
    Browse the repository at this point in the history