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

[addon module] velero - update version and add required values #693

Merged
merged 6 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 3 additions & 13 deletions docs/add-ons/velero.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,13 @@ velero_helm_config = {
name = "velero"
description = "A Helm chart for velero"
chart = "velero"
version = "2.29.8"
version = "2.30.0"
repository = "https://vmware-tanzu.github.io/helm-charts/"
namespace = "velero"
values = [templatefile("${path.module}/values.yaml", {
backup_s3_bucket = "<YOUR_BUCKET_NAME>",
bucket = "<YOUR_BUCKET_NAME>",
region = "<YOUR_BUCKET_REGION>"
})]

set_values = [
{
name = "serviceAccount.server.name"
value = local.name
},
{
name = "serviceAccount.server.create"
value = false
}
]
}
```

Expand Down
1 change: 1 addition & 0 deletions modules/kubernetes-addons/velero/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ pod/nginx 1/1 Running 0 21s
|------|------|
| [aws_iam_policy.velero](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy_document.velero](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | data source |
| [aws_region.current](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | data source |

## Inputs

Expand Down
9 changes: 5 additions & 4 deletions modules/kubernetes-addons/velero/main.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
data "aws_region" "current" {}

locals {
name = "velero"
namespace = try(var.helm_config.namespace, local.name)
Expand All @@ -16,11 +18,12 @@ module "helm_addon" {
name = local.name
description = "A Helm chart for velero"
chart = local.name
version = "2.29.8"
version = "2.30.0"
repository = "https://vmware-tanzu.github.io/helm-charts/"
namespace = local.namespace
values = [templatefile("${path.module}/values.yaml", {
backup_s3_bucket = var.backup_s3_bucket,
bucket = var.backup_s3_bucket,
region = data.aws_region.current.name
})]
},
var.helm_config
Expand Down Expand Up @@ -62,7 +65,6 @@ data "aws_iam_policy_document" "velero" {
"ec2:CreateSnapshot",
"ec2:DeleteSnapshot",
]

resources = ["*"]
}

Expand All @@ -74,7 +76,6 @@ data "aws_iam_policy_document" "velero" {
"s3:AbortMultipartUpload",
"s3:ListMultipartUploadParts",
]

resources = ["arn:${var.addon_context.aws_partition_id}:s3:::${var.backup_s3_bucket}/*"]
}

Expand Down
19 changes: 12 additions & 7 deletions modules/kubernetes-addons/velero/values.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
configuration:
provider: aws
backupStorageLocation:
bucket: ${backup_s3_bucket}

initContainers:
- name: velero-plugin-for-aws
image: velero/velero-plugin-for-aws:v1.4.1
imagePullPolicy: IfNotPresent
image: velero/velero-plugin-for-aws:v1.5.0
volumeMounts:
- mountPath: /target
name: plugins

configuration:
provider: aws
backupStorageLocation:
bucket: ${bucket}
volumeSnapshotLocation:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you elaborate on some of these changes, why they are important as defaults, etc. please

Copy link
Contributor Author

@Hokwang Hokwang Jun 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please refer to https://github.com/vmware-tanzu/velero-plugin-for-aws/blob/main/volumesnapshotlocation.md
it is required value.
When you don't use volumeSnapshotLocation.region, install could be success,
but backup always Partialy Failed,
it shows

$ velero backup logs daily-backup3 | grep -v "level=info"
time="2022-06-28T05:19:27Z" level=error msg="Error getting volume snapshotter for volume snapshot location" backup=velero/daily-backup3 error="rpc error: code = Unknown desc = missing region in aws configuration" error.file="/go/src/velero-plugin-for-aws/velero-plugin-for-aws/volume_snapshotter.go:82" error.function="main.(*VolumeSnapshotter).Init" logSource="pkg/backup/item_backupper.go:453" name=pvc-60373ea9-b6cd-4a62-8eb8-d51f3eb0e64c namespace= persistentVolume=pvc-60373ea9-b6cd-4a62-8eb8-d51f3eb0e64c resource=persistentvolumes volumeSnapshotLocation=default

config:
region: ${region}

credentials:
useSecret: false