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

Error creating SNS Topic in the deployment #145

Open yujunz opened 5 years ago

yujunz commented 5 years ago

Error message from the deployment

time="2018-11-30T08:17:49Z" level=info msg="Getting kubernetes context" hostname=aws-service-operator-7cdddf9cb5-bb5hj
time="2018-11-30T08:17:49Z" level=info msg="Registering resources" hostname=aws-service-operator-7cdddf9cb5-bb5hj
time="2018-11-30T08:17:52Z" level=info msg="Region: cn-north-1" hostname=aws-service-operator-7cdddf9cb5-bb5hj
time="2018-11-30T08:17:52Z" level=info msg="Watching the resources" hostname=aws-service-operator-7cdddf9cb5-bb5hj
time="2018-11-30T08:17:52Z" level=error msg="Error creating SNS Topic with error 'InvalidParameter: Invalid parameter: Topic Name\n\tstatus code:400, request id: eaea90b9-9630-58ba-80d6-c4c362402f01'" hostname=aws-service-operator-7cdddf9cb5-bb5hj
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1107ff7]

goroutine 1 [running]:
github.com/awslabs/aws-service-operator/pkg/queue.(*Queue).Register(0xc42040d380, 0x1457df9, 0x8, 0x1426b00, 0xc42024b548, 0x0, 0xc4203aa6e0, 0x0, 0xc42024b4a8, 0x4289c4, ...)
        /Users/heichris/Code/src/github.com/awslabs/aws-service-operator/pkg/queue/queue.go:94 +0x187
github.com/awslabs/aws-service-operator/pkg/operator/s3bucket.(*Controller).StartWatch(0xc4203cea20, 0x0, 0x0, 0xc4200ae840, 0x0, 0x0)
        /Users/heichris/Code/src/github.com/awslabs/aws-service-operator/pkg/operator/s3bucket/controller.go:67 +0x201
github.com/awslabs/aws-service-operator/pkg/server.(*Server).Run(0xc4203fe000, 0xc4200ae840)
        /Users/heichris/Code/src/github.com/awslabs/aws-service-operator/pkg/server/server.go:106 +0x9d1
main.glob..func2(0x1ec8be0, 0xc42036fa40, 0x0, 0x3)
        /Users/heichris/Code/src/github.com/awslabs/aws-service-operator/cmd/aws-service-operator/server.go:33 +0x1d3
github.com/awslabs/aws-service-operator/vendor/github.com/spf13/cobra.(*Command).execute(0x1ec8be0, 0xc42036f950, 0x3, 0x3, 0x1ec8be0, 0xc42036f950)
        /Users/heichris/Code/src/github.com/awslabs/aws-service-operator/vendor/github.com/spf13/cobra/command.go:766 +0x2c1
github.com/awslabs/aws-service-operator/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x1ec8980, 0x1, 0x1, 0xc4200c0670)
        /Users/heichris/Code/src/github.com/awslabs/aws-service-operator/vendor/github.com/spf13/cobra/command.go:852 +0x30a
github.com/awslabs/aws-service-operator/vendor/github.com/spf13/cobra.(*Command).Execute(0x1ec8980, 0x1, 0x1)
        /Users/heichris/Code/src/github.com/awslabs/aws-service-operator/vendor/github.com/spf13/cobra/command.go:800 +0x2b
main.main()
        /Users/heichris/Code/src/github.com/awslabs/aws-service-operator/cmd/aws-service-operator/main.go:34 +0x66
christopherhein commented 5 years ago

Thanks for filing this @yujunz what is the name of the cluster you specified? is it based on a dns spec?

yujunz commented 5 years ago

It is a private cluster, named bluebell.k8s.local

Full deployment configuration attached.

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"apps/v1beta1","kind":"Deployment","metadata":{"annotations":{},"name":"aws-service-operator","namespace":"aws-service-operator"},"spec":{"replicas":1,"template":{"metadata":{"annotations":{"iam.amazonaws.com/role":"aws-service-operator.bluebell.k8s.local"},"labels":{"app":"aws-service-operator"}},"spec":{"containers":[{"args":["server","--cluster-name=bluebell.k8s.local","--region=cn-north-1","--account-id=<hidden>"],"image":"awsserviceoperator/aws-service-operator:v0.0.1-alpha2","imagePullPolicy":"Always","name":"aws-service-operator"}],"serviceAccountName":"aws-service-operator"}}}}
  creationTimestamp: 2018-11-30T08:17:43Z
  generation: 1
  labels:
    app: aws-service-operator
  name: aws-service-operator
  namespace: aws-service-operator
  resourceVersion: "2752961"
  selfLink: /apis/extensions/v1beta1/namespaces/aws-service-operator/deployments/aws-service-operator
  uid: 69699719-f478-11e8-ab6f-02cd3d588256
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app: aws-service-operator
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      annotations:
        iam.amazonaws.com/role: aws-service-operator.bluebell.k8s.local
      creationTimestamp: null
      labels:
        app: aws-service-operator
    spec:
      containers:
      - args:
        - server
        - --cluster-name=bluebell.k8s.local
        - --region=cn-north-1
        - --account-id=<hidden>
        image: awsserviceoperator/aws-service-operator:v0.0.1-alpha2
        imagePullPolicy: Always
        name: aws-service-operator
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: aws-service-operator
      serviceAccountName: aws-service-operator
      terminationGracePeriodSeconds: 30
status:
  conditions:
  - lastTransitionTime: 2018-11-30T08:17:43Z
    lastUpdateTime: 2018-11-30T08:17:49Z
    message: ReplicaSet "aws-service-operator-7cdddf9cb5" has successfully progressed.
    reason: NewReplicaSetAvailable
    status: "True"
    type: Progressing
  - lastTransitionTime: 2018-12-12T02:29:45Z
    lastUpdateTime: 2018-12-12T02:29:45Z
    message: Deployment does not have minimum availability.
    reason: MinimumReplicasUnavailable
    status: "False"
    type: Available
  observedGeneration: 1
  replicas: 1
  unavailableReplicas: 1
  updatedReplicas: 1
christopherhein commented 5 years ago

for the cluster name attribute try replacing the . with - at least for the operator. . aren't valid keys in the name of an SNS topic.

christopherhein commented 5 years ago

@yujunz did this work? If so could you close the issue?