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

Deploy Velero Helm Chart #744

Closed
costrouc opened this issue Jul 28, 2021 · 4 comments
Closed

Deploy Velero Helm Chart #744

costrouc opened this issue Jul 28, 2021 · 4 comments
Labels
status: stale 🥖 Not up to date with the default branch - needs update type: enhancement 💅🏼 New feature or request

Comments

@costrouc
Copy link
Member

Summary

Breaking the backup story into smaller problems. Initially would like to simply deploy the velero helm chart. No work is needed to actually start testing out the velero deployment.

Proposed implementation

Create a velero directory within https://github.com/Quansight/qhub/tree/main/qhub/template/%7B%7B%20cookiecutter.repo_directory%20%7D%7D/infrastructure/modules/kubernetes/services. The velero helm chart should follow a pattern very similar to https://github.com/Quansight/qhub/tree/main/qhub/template/%7B%7B%20cookiecutter.repo_directory%20%7D%7D/infrastructure/modules/kubernetes/services/jupyterhub. Add a module referene to https://github.com/Quansight/qhub/blob/main/qhub/template/%7B%7B%20cookiecutter.repo_directory%20%7D%7D/infrastructure/kubernetes.tf that depends on module.kubernetes-initialization. The node group selector should be the general node pool. Additionally there should be an integration added to the qhub-config.yaml with. Enabled should be false by default. Ensure to add the new option to qhub/schema.py.

velero:
   enabled: true/false

Acceptance Criteria

  • Upon velero enabled in the qhub config.yaml it should deploy the velero helm chart with all resources successfully running

Tasks to complete

Related to

@costrouc costrouc added the type: enhancement 💅🏼 New feature or request label Jul 28, 2021
@costrouc
Copy link
Member Author

Completed:
I was able to create modules for Velero using the cookiecutter by rendering the qhub-config.yaml file and update the kubernetes.tf file.
Did check the local deployment if there is any print statement for the velero service. but no luck

Pending things:

  1. Deploying Velero using helm chart in qhub for one of the cloud provider to have a point of reference as end result.
  2. Updating the velero/values.yaml using refrence from clearml/values.yaml file
  3. Deploy velero again using the updated values.yaml and debug further

Points to discuss:

  1. Do we have to give user an option or a choice to integrate velero in the qhub-config.yaml file or it can be made a mandate.

@costrouc
Copy link
Member Author

### Velero install using the client in AWS:

Create AWS s3 bucket

`BUCKET=velro-backup-kubernetes-cluster
REGION=us-west-2

aws s3api create-bucket \
    --bucket $BUCKET \
    --region $REGION \
    --create-bucket-configuration LocationConstraint=$REGION

Output:
OUtput:

{
    "Location": "http://velro-backup-kubernetes-cluster.s3.amazonaws.com/"
}

CREATE IAM USER FOR VELERO

aws iam create-user --user-name velero

Output

{
    "User": {
        "Path": "/",
        "UserName": "velero",
        "UserId": "AIDATXSUADQEIQD2RHZUL",
        "Arn": "arn:aws:iam::256800463880:user/velero",
        "CreateDate": "2021-07-07T12:55:19Z"
    }
}

velero install \ --provider aws \ --plugins velero/velero-plugin-for-aws:v1.2.0 \ --bucket $BUCKET \ --backup-location-config region=$REGION \ --snapshot-location-config region=$REGION \ --secret-file ./credentials-velero \ --use-restic

credentials-velero file content:
[default] aws_access_key_id=XXXXXXXXXXXXXX aws_secret_access_key=XXXXXXXXXXXXX

To create a backup
velero backup create testbackup

To restore a backup
velero backup restore testbackup

To create a schedule
velero create schedule testschedule "cronexpression"

image.png
image.png
image.png
image.png

Issue Identified while deploying velero using helm chart

Issue1: while deploying velero in qhub with aws cloud. I am encountering few error.

e apiextensions.k8s.io/v1 CustomResourceDefinition
W0722 10:44:33.007741   12294 warnings.go:70] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
W0722 10:44:34.440675   12294 warnings.go:70] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
W0722 10:44:35.663463   12294 warnings.go:70] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
W0722 10:44:36.583434   12294 warnings.go:70] apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition

I am not aware where i have to replace "apiextensions.k8s.io/v1beta1" with "apiextensions.k8s.io/v1" CustomResourceDefinition.

Issue 2:
After doing the describe pod for velero i see "Failed to pull image "velero/velero-plugin-for-aws:v1.5.2": rpc error: code = Unknown d │
│ esc = Error response from daemon: manifest for velero/velero-plugin-for-aws:v1.5.2 not found: manifest unknown: manifest unknown "
above issue is seen for

helm install velero vmware-tanzu/velero \
--namespace dev \
--create-namespace \
--set-file credentials.secretContents.cloud=/home/tarun/Documents/Learning_Books/learning/aws/credentials-velero \
--set configuration.provider=aws \
--set configuration.backupStorageLocation.name=aws \
--set configuration.backupStorageLocation.bucket=velro-backup-kubernetes-cluster \
--set configuration.backupStorageLocation.config.region=us-west-2 \
--set configuration.volumeSnapshotLocation.name=default \
--set configuration.volumeSnapshotLocation.config.region=us-west-2 \
--set initContainers[0].name=velero-plugin-for-aws \
--set initContainers[0].image=velero/velero-plugin-for-aws:v1.5.2 \
--set initContainers[0].volumeMounts[0].mountPath=/target \
--set initContainers[0].volumeMounts[0].name=plugins

Issue 3: For local deployment of velero as an inbuilt feature of qhub. "Deploy velero helm chart#23"
I am getting unauthorised error "Error: Get "https://192.168.49.2:8443/api/v1/namespaces/dev": dial tcp 192.168.49.2:8443: connect: no route to host"
and "Error: Unauthorized"
above errors were seen after integrating the velero deployment with qhub.
entry in the velero/values.yaml
`velero:
defaultCompany: "d1bd92a3b039400cbafc60a7a5b1e52b"
image:
repository: "velero/velero"
tag: "v1.5.2"
#dnsPolicy: "ClusterFirst"
initContainers: []

  • name: velero-plugin-for-aws
    image: velero/velero-plugin-for-aws:v1.1.0
    imagePullPolicy: IfNotPresent
    volumeMounts:
    - mountPath: /target
    name: plugins
    metrics:
    enabled: true
    scrapeInterval: 30s
    podAnnotations:
    prometheus.io/scrape: "true"
    prometheus.io/port: "8085"
    prometheus.io/path: "/metrics"
    serviceMonitor:
    enabled: true
    additionalLabels: {}
    configuration:
    provider: aws
    backupStorageLocation:
    name: aws
    bucket: velro-backup-kubernetes-cluster
    prefix: backup
    config:
    kmsKeyId: $KeyId}
    region: ${region}
    volumeSnapshotLocation:
    name: aws
    config:
    region: ${region}
    logLevel: debug
    credentials:
    useSecret: false
    deployRestic: false
    schedules:
    hourly-backup:
    schedule: "* * * * *"
    template:
    includeClusterResources: true
    includedNamespaces:
    • '*'
      includedResources:
    • '*'
      storageLocation: aws
      snapshotVolumes: true
      ttl: 720h0m0s````
      image.png
      image.png
      image.png

Velero deployment using helm chart with success

Add repository

helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts

helm install velero vmware-tanzu/velero
--namespace dev
--create-namespace
--set-file credentials.secretContents.cloud=/path/credentials-velero
--set configuration.provider=aws
--set configuration.backupStorageLocation.name=aws
--set configuration.backupStorageLocation.bucket=velro-backup-kubernetes-cluster
--set configuration.backupStorageLocation.config.region=us-west-2
--set configuration.volumeSnapshotLocation.name=us-west-2
--set configuration.volumeSnapshotLocation.config.region=us-west-2
--set initContainers[0].name=velero-plugin-for-aws
--set initContainers[0].image=velero/velero-plugin-for-aws:v1.2.0
--set initContainers[0].volumeMounts[0].mountPath=/target
--set initContainers[0].volumeMounts[0].name=plugins
--set configuration.volumeSnapshotLocation

Note : In the github repo of suggest to use the image tag as 1.6.2 but the deployment fails :
referring the issue created : vmware-tanzu/helm-charts#288

@github-actions
Copy link

This issue has been automatically marked as stale because there was no recent activity in 60 days. Remove the stale label or add a comment, otherwise, this issue will automatically be closed in 7 days if no further activity occurs.

@github-actions github-actions bot added the status: stale 🥖 Not up to date with the default branch - needs update label Sep 27, 2021
@github-actions
Copy link

github-actions bot commented Oct 4, 2021

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as completed Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: stale 🥖 Not up to date with the default branch - needs update type: enhancement 💅🏼 New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant