amazon-archives / aws-service-operator

AWS Service Operator allows you to create AWS resources using kubectl.
Apache License 2.0
732 stars 97 forks source link

S3 error: Unable to get the object https://s3.eu-west-1.amazonaws.com/aws-operator/ecrrepository.yaml #172

Open yanivpaz opened 5 years ago

yanivpaz commented 5 years ago

Hi There is no proper documentation on how to use

- (optional) The operator stores certain things in s3 create a bucket or provide an existing bucket for the operator to use i.e. aws s3 mb s3://foobar I am getting the error below when I try to create the ecr registry as explained in the example : time="2019-02-24T14:46:43Z" level=error msg="error creating ecrrepository 'example-repository-name-2'" error="ValidationError: S3 error: Unable to get the object https://s3.eu-west-1.amazonaws.com/aws-operator/ecrrepository.yaml\n\tstatus code: 400, request id: 00c1dd2e-3843-11e9-a2bc-47768777400d" hostname=aws-service-operator-85ff9558bb-hl2ml
yanivpaz commented 5 years ago

Seems that its related to https://github.com/awslabs/aws-service-operator/issues/155 --bucket is missing when creating the operator

I solved it by adding the --bucket flag: in configs/aws-service-operator.yaml args:

it seems that this bucket flag is mandatory in specific regions

marcindulak commented 5 years ago

The bucket argument needs to be mandatory.

"Bucket names must be unique across all existing bucket names in Amazon S3"

https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html

This means the bucket argument cannot have the default argument value of aws-operator https://github.com/awslabs/aws-service-operator/blob/76312848693937324f5920d771cde1abe2f51fdd/cmd/aws-service-operator/main.go#L57

Even generating a different default value of the s3 bucket name, using e.g. cluster-name + -aws-service-operator (see https://github.com/awslabs/aws-service-operator/issues/196) may result in a bucket name that is not globally unique.

marcindulak commented 5 years ago

https://github.com/awslabs/aws-service-operator/pull/194