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

"s3ForcePathStyle" entry gets duplicated with AWS plugin #219

Closed
vzabawski opened this issue Feb 19, 2021 · 13 comments · Fixed by #243
Closed

"s3ForcePathStyle" entry gets duplicated with AWS plugin #219

vzabawski opened this issue Feb 19, 2021 · 13 comments · Fixed by #243
Assignees
Labels

Comments

@vzabawski
Copy link

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

I add Velero chart configuration to my values.yaml:

velero:
  enabled: true
  configuration:
    provider: aws
    backupStorageLocation:
      provider: aws
      name: default
      bucket: jenkins-backups-prod
      config:
        region: eu-de-2
        s3ForcePathStyle: true
        s3Url: https://objectstore-3.eu-de-2.example.com

Rendered yaml contains duplicated entries:

apiVersion: velero.io/v1
kind: BackupStorageLocation
metadata:
  name: default
  annotations:
    "helm.sh/hook": post-install,post-upgrade
    "helm.sh/hook-delete-policy": "before-hook-creation"
  labels:
    app.kubernetes.io/name: velero
    app.kubernetes.io/instance: jenkins
    app.kubernetes.io/managed-by: Helm
    helm.sh/chart: velero-2.14.8
spec:
  provider: aws
  objectStorage:
    bucket: jenkins-backups-prod
  config:
    region: eu-de-2
    s3ForcePathStyle: true
    s3Url: https://objectstore-3.eu-de-2.example.com
    signatureVersion: "4"
    s3ForcePathStyle: "true"
---

Quoting true in values.yaml doesn't change the behavior, it just creates 2 entries, where each true is quoted.

Environment:

  • helm version (use helm version):
    version.BuildInfo{Version:"v3.5.2", GitCommit:"167aac70832d3a384f65f9745335e9fb40169dc2", GitTreeState:"dirty", GoVersion:"go1.15.7"}
  • helm chart version:
    2.14.8
@jenting
Copy link
Collaborator

jenting commented Feb 22, 2021

@vzabawski Thank you for reporting this. If you like, could you file a PR to addressing this? Thank you.

@jenting jenting added the good first issue Good for newcomers label Feb 22, 2021
@vzabawski
Copy link
Author

I suggest removing the part that quotes true since it's plugin-specific config and add a warning to plugin configuration example about s3ForcePathStyle, that it should be quoted. I don't see any other simple solution, to be honest. :)

@jenting
Copy link
Collaborator

jenting commented Feb 24, 2021

I suggest removing the part that quotes true since it's plugin-specific config and add a warning to plugin configuration example about s3ForcePathStyle, that it should be quoted. I don't see any other simple solution, to be honest. :)

Yes, I agree with you.
But wouldn't this break the existing plugin behavior and force the user must upgrade the plugin version 🤔 ?

@vzabawski
Copy link
Author

I suggest removing the part that quotes true since it's plugin-specific config and add a warning to plugin configuration example about s3ForcePathStyle, that it should be quoted. I don't see any other simple solution, to be honest. :)

Yes, I agree with you.
But wouldn't this break the existing plugin behavior and force the user must upgrade the plugin version 🤔 ?

To be honest, I can't be sure, but from what I see, the example shows that the value should be wrapped in double quotes: https://github.com/vmware-tanzu/velero-plugin-for-aws/blob/main/backupstoragelocation.md

@jenting
Copy link
Collaborator

jenting commented Feb 24, 2021

May I said that if the user existing configuration with

s3ForcePathStyle: true

after this PR merged and the user performs helm upgrade or helm install with the existing configuration, it would break the velero can't access the s3-compatible provider?

@vzabawski
Copy link
Author

I guess so. At the same time, duplicated entries do not block the deployment since duplicated keys are dropped in k8s. At least, deployed backupstoragelocation resource does not contain duplicated keys.

@jenting
Copy link
Collaborator

jenting commented Feb 24, 2021

I'd prefer not to change this. /cc @carlisia WDYT?

@carlisia
Copy link
Contributor

carlisia commented Mar 6, 2021

I guess so. At the same time, duplicated entries do not block the deployment since duplicated keys are dropped in k8s. At least, deployed backupstoragelocation resource does not contain duplicated keys.

Yes, I'm inclined to leave this alone. We can leave it open and clean it up if/when there's an inevitable change that brakes backwards compatibility.

Thanks for the effort tho, @vzabawski 👍

@jenting jenting removed the good first issue Good for newcomers label Mar 10, 2021
@irizzant
Copy link

irizzant commented Apr 7, 2021

If the yaml rendered by the Helm chart is then given as input to kustomize version 3.9 and later, kustomize fails with:

Error: accumulating resources: accumulation err='accumulating resources from '../base': '/home/local/INTRANET/ivan.rizzante/kubernetes/gitops/velero/base' must resolve to a file': recursed accumulation of path '/home/local/INTRANET/ivan.rizzante/kubernetes/gitops/velero/base': received error yaml: unmarshal errors:
  line 22: mapping key "s3ForcePathStyle" already defined at line 20 for the following resource:
# Source: velero/templates/backupstoragelocation.yaml

This makes it a blocking issue

@jenting
Copy link
Collaborator

jenting commented Apr 9, 2021

@irizzant Thanks for the reporting, would you mind provides the kustomize command on how to apply the manifest to us? This would make us easier to understand it. Thank you.

@irizzant
Copy link

irizzant commented Apr 9, 2021

@jenting
I use the following values.yaml

configuration:
  # Cloud provider being used (e.g. aws, azure, gcp).
  provider: aws

  # Parameters for the `default` BackupStorageLocation. See
  # https://velero.io/docs/v1.5/api-types/backupstoragelocation/
  backupStorageLocation:
    # name is the name of the backup storage location where backups should be stored. If a name is not provided,
    # a backup storage location will be created with the name "default". Optional.
    name:
    # provider is the name for the backup storage location provider. If omitted
    # `configuration.provider` will be used instead.
    provider:
    # bucket is the name of the bucket to store backups in. Required.
    bucket: k8s-backups
    # caCert defines a base64 encoded CA bundle to use when verifying TLS connections to the provider.
    caCert:
    # prefix is the directory under which all Velero data should be stored within the bucket. Optional.
    prefix:

    # Additional provider-specific configuration. See link above
    # for details of required/optional fields for your provider.
    config: 
      region: sdb
      s3ForcePathStyle: "true"

And generate an upstream configuration like this with helm:
helm template velero --namespace velero -f values.yaml --include-crds vmware-tanzu/velero > base/upstream.yaml

Then I just run kustomize build base and I get that error.

@jenting
Copy link
Collaborator

jenting commented Apr 10, 2021

@irizzant Thank you. I filed a PR to address it, if you like, please try it 🙏

@irizzant
Copy link

@jenting looks like your PR with the values.yaml reported here generates:

# Source: velero/templates/backupstoragelocation.yaml
apiVersion: velero.io/v1
kind: BackupStorageLocation
metadata:
  name: default
  annotations:
    "helm.sh/hook": post-install,post-upgrade
    "helm.sh/hook-delete-policy": "before-hook-creation"
  labels:
    app.kubernetes.io/name: velero
    app.kubernetes.io/instance: velero
    app.kubernetes.io/managed-by: Helm
    helm.sh/chart: velero-2.16.1
spec:
  provider: aws
  objectStorage:
    bucket: k8s-backups
  config:
    region: "sdb"
    s3ForcePathStyle: "true"

Which as you can see has only one s3ForcePathStyle entry, so it looks good to me thanks

ndegory pushed a commit to ndegory/helm-charts that referenced this issue Jul 12, 2021
…e-tanzu#219)

* [prometheus-pushgateway] Add missing fields within values.yaml

Signed-off-by: Thomas Decaux <ebuildy@gmail.com>

* [prometheus-pushgateway]  Bump chart version

Signed-off-by: Thomas Decaux <ebuildy@gmail.com>

Co-authored-by: André Bauer <monotek@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants