vmware-tanzu / helm-charts

Contains Helm charts for Kubernetes related open source tools
https://vmware-tanzu.github.io/helm-charts/
Apache License 2.0
248 stars 360 forks source link

kube2iam AWS/S3 BackupStorageLocation is unavailable #401

Open sb-tmd-dev opened 2 years ago

sb-tmd-dev commented 2 years ago

What steps did you take and what happened: followed the steps at

and troubleshooting here:

created a policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeVolumes",
                "ec2:DescribeSnapshots",
                "ec2:CreateTags",
                "ec2:CreateVolume",
                "ec2:CreateSnapshot",
                "ec2:DeleteSnapshot"
            ],
            "Resource": "*"
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetObject",
                "s3:DeleteObject",
                "s3:PutObject",
                "s3:AbortMultipartUpload",
                "s3:ListMultipartUploadParts"
            ],
            "Resource": [
                "arn:aws:s3:::velero-backups/*"
            ]
        },
        {
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::velero-backups"
            ]
        }
    ]
}

created a role named velero-irsa attached above policy and setup with Trust Policy:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Federated": "arn:aws:iam::<ACCOUNT_ID>:oidc-provider/oidc.eks.<AWS_REGION>.amazonaws.com/id/<REDACTED>"
            },
            "Action": "sts:AssumeRoleWithWebIdentity",
            "Condition": {
                "StringEquals": {
                    "oidc.eks.<AWS_REGION>.amazonaws.com/id/<REDACTED>:sub": "system:serviceaccount:infra:velero-sa"
                }
            }
        }
    ]
}

installed in namespace infra

From values.yaml

serviceAccount:
  server:
    create: true
    name: "velero-sa"
credentials:
  # Whether a secret should be used. Set to false if using oidc sa to iam role
  useSecret: false

What did you expect to happen: BackupStorageLocation is in status available

Environment:

KrisJohnstone commented 1 year ago

You haven't added an annotation on the service account with the role you created.