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

Table not found when creating GlobalTable resource #1034

Closed
acunabit opened this issue Oct 18, 2021 · 4 comments
Closed

Table not found when creating GlobalTable resource #1034

acunabit opened this issue Oct 18, 2021 · 4 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@acunabit
Copy link

acunabit commented Oct 18, 2021

Describe the bug

I am trying to create a global table and I am getting the following error:

ack-dynamodb-controller-5c4f76b845-xpdlk controller 2021-10-18T04:34:25.065Z	
ERROR	controller-runtime.controller	Reconciler error	{"controller": "globaltable", "request": "kube-system/ack", "error": "TableNotFoundException: Table not found: Table: 'acktable' not found in region: 'us-east-1'."}

Does the DynamoDb controller uses DynamoDB Global Tables V2 (version 2019.11.21) or DynamoDB Global Tables V1 (version 2017.11.29)?

If it's using V1, could you confirm if I need to create the table in both regions before creating the global table resource? Is V2 going to be supported in the near future? Thank you very much.

Steps to reproduce

  1. Create the resources
cat  <<EOF | kubectl apply -f -
apiVersion: dynamodb.services.k8s.aws/v1alpha1
kind: GlobalTable
metadata:
  namespace: kube-system
  name: ack
  labels:
    table: acktable
    version: v1.0.0
    helm.sh/chart: dynamodb-v1.0.0
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dynamodb
    app.kubernetes.io/instance: ack
spec:
  globalTableName: acktable
  replicationGroup:
    - regionName: ap-southeast-2
    - regionName: us-east-1
---
# Source: dynamodb/templates/table.yaml
apiVersion: dynamodb.services.k8s.aws/v1alpha1
kind: Table
metadata:
  namespace: kube-system
  name: ack
  labels:
    table: acktable
    version: v1.0.0
    helm.sh/chart: dynamodb-v1.0.0
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: dynamodb
    app.kubernetes.io/instance: ack
spec:
  tableName: acktable
  billingMode: PAY_PER_REQUEST
  attributeDefinitions:
    - attributeName: ForumName
      attributeType: S
    - attributeName: Subject2
      attributeType: S
  keySchema:
    - attributeName: ForumName
      keyType: HASH
    - attributeName: Subject2
      keyType: RANGE
  streamSpecification:
    streamEnabled: true
    streamViewType: NEW_AND_OLD_IMAGES
EOF

Expected outcome
DynamoDb table created in both regions.

Environment

  • Kubernetes version
    1.19
  • Using EKS (yes/no), if so version?
    yes : eks.6
  • AWS service targeted (S3, RDS, etc.)
    DynamoDB
@acunabit acunabit added the kind/bug Categorizes issue or PR as related to a bug. label Oct 18, 2021
@a-hilaly a-hilaly reopened this Oct 18, 2021
@a-hilaly
Copy link
Member

Hey @acunabit, here is the model we use to generate the dynamodb controller: https://github.com/aws/aws-sdk-go/blob/main/models/apis/dynamodb/2012-08-10/api-2.json#L4.

could you confirm if I need to create the table in both regions before creating the global table resource?

That's correct.

@a-hilaly
Copy link
Member

I didn't know that there two version of DynamoDB Global Tables.. i'll dive into this and see how is it impacting the code generation.

@acunabit
Copy link
Author

Hey @acunabit, here is the model we use to generate the dynamodb controller: https://github.com/aws/aws-sdk-go/blob/main/models/apis/dynamodb/2012-08-10/api-2.json#L4.

could you confirm if I need to create the table in both regions before creating the global table resource?

That's correct.

Thank you very much for your response @a-hilaly.

@a-hilaly a-hilaly closed this as completed Nov 5, 2021
@TaylorSMarks
Copy link

@a-hilaly - Did you figure out whether you're using the 2017 Version or the 2019 Version? Based on the docs and your comment that the table needs to already exist in all regions it sounds like you're using the 2017 version.

The GlobalTable documentation need a lot of improvements here:

  1. Mention that the table needs to already exist in all regions first.
  2. Mention that it's using version 2017 (unless it's not.)
  3. Provide any working example of using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants