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

Using wrong region in cloud formation headers #155

Open lightsofapollo opened 5 years ago

lightsofapollo commented 5 years ago

I am running the example step:

kubectl apply -f examples/cloudformationtemplates

My operator is coming up okay but in the logs I see many errors like the following:

time="2019-01-21T12:22:58Z" level=error msg="error uploading cloudformation" error="AuthorizationHeaderMalformed: The authorization header is malformed; the region 'us-east-1' is wrong; expecting 'us-west-2'\n\tstatus code: 400, request id: 1D9A7AE140E06315, host id: plrfrXdM8Bh6EOZ6x9b2nOg+YcwN1mjip+ZxzuvuRuWWwTYLRK4cIqqXm+Hmalw0le4KSmeC/y0=" hostname=aws-service-operator-bff9678bd-v9k2n

NOTE: I have configured my resources on east-1 so it's a non starter to try things out on west-2 I am hoping I made some silly error.

abbreviated configuration

  - kind: Deployment
    apiVersion: apps/v1beta1
    metadata:
      name: aws-service-operator
      namespace: aws-service-operator
    spec:
      replicas: 1
      template:
        metadata:
          annotations:
            iam.amazonaws.com/role: arn:aws:iam::xxxx:role/aws-service-operator.conduitvc-kubernetes.aws.conduit.ventures
          labels:
            app: aws-service-operator
        spec:
          serviceAccountName: aws-service-operator
          containers:
            - name: aws-service-operator
              image: awsserviceoperator/aws-service-operator:v0.0.1-alpha2
              imagePullPolicy: Always
              # I tired adding this without any results.
              env:
                - name: AWS_REGION
                  value: us-east-1
              args:
                - server
                - --cluster-name=conduitvc-kubernetes
                - --region=us-east-1
                - --account-id=xxxxx
christopherhein commented 5 years ago

@lightsofapollo thanks for catching this error, I think we need to do 2 things, have you created an S3 bucket for storing the resources? Out of the box you don't need to kubectl apply -f examples/cloudformationtemplates UNLESS you are changing the underlaying templates, they are supplied as a fallback out of a shared bucket.

If you are planning on changing them you will need to create a new bucket (outside of the operator, 1 day I hope to dog food the project and reconfigure itself) then you will need to set the --bucket flag. Set that to the name of the bucket and as long as it's in the same region as your cluster us-east-1 it should work as expected.

This is actually a documentation miss on the readme.adoc if you are interesting in putting a small PR I'll happily merge it.

marcindulak commented 5 years ago

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