-
Notifications
You must be signed in to change notification settings - Fork 464
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #712 from thiru85/dynamodb-ack
update: Change ACK lab to use DynamoDB instead of RDS
- Loading branch information
Showing
15 changed files
with
229 additions
and
202 deletions.
There are no files selected for viewing
5 changes: 3 additions & 2 deletions
5
manifests/modules/automation/controlplanes/ack/.workshop/cleanup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/bin/bash | ||
|
||
echo "Deleting RDS resources created by ACK..." | ||
echo "Deleting resources created by ACK..." | ||
|
||
kubectl delete namespace catalog > /dev/null | ||
eksctl delete iamserviceaccount --name carts-ack --namespace carts --cluster $EKS_CLUSTER_NAME -v 0 > /dev/null | ||
kubectl delete table items -n carts --ignore-not-found=true > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
manifests/modules/automation/controlplanes/ack/dynamodb/deployment.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: carts | ||
namespace: carts | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: carts | ||
envFrom: | ||
- configMapRef: | ||
name: carts-ack | ||
serviceAccountName: carts-ack |
8 changes: 8 additions & 0 deletions
8
manifests/modules/automation/controlplanes/ack/dynamodb/dynamodb-ack-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: carts-ack | ||
namespace: carts | ||
data: | ||
CARTS_DYNAMODB_TABLENAME: "${EKS_CLUSTER_NAME}-carts-ack" | ||
CARTS_DYNAMODB_ENDPOINT: https://dynamodb.${AWS_REGION}.amazonaws.com |
25 changes: 25 additions & 0 deletions
25
manifests/modules/automation/controlplanes/ack/dynamodb/dynamodb-create.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: dynamodb.services.k8s.aws/v1alpha1 | ||
kind: Table | ||
metadata: | ||
name: items | ||
namespace: carts | ||
spec: | ||
keySchema: | ||
- attributeName: id | ||
keyType: HASH | ||
attributeDefinitions: | ||
- attributeName: id | ||
attributeType: 'S' | ||
- attributeName: customerId | ||
attributeType: 'S' | ||
billingMode: PAY_PER_REQUEST | ||
tableName: "${EKS_CLUSTER_NAME}-carts-ack" | ||
globalSecondaryIndexes: | ||
- indexName: idx_global_customerId | ||
keySchema: | ||
- attributeName: customerId | ||
keyType: HASH | ||
- attributeName: id | ||
keyType: RANGE | ||
projection: | ||
projectionType: 'ALL' |
9 changes: 9 additions & 0 deletions
9
manifests/modules/automation/controlplanes/ack/dynamodb/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
bases: | ||
- ../../../../../base-application/carts | ||
resources: | ||
- dynamodb-ack-configmap.yaml | ||
- dynamodb-create.yaml | ||
patches: | ||
- deployment.yaml |
Binary file added
BIN
+226 KB
website/docs/automation/controlplanes/ack/assets/ack-desired-current-ddb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-26 KB
website/docs/automation/controlplanes/ack/assets/ack-desired-current.jpg
Binary file not shown.
Binary file added
BIN
+543 KB
website/docs/automation/controlplanes/ack/assets/cart-items-present.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-32.8 KB
website/docs/automation/controlplanes/ack/assets/eks-workshop-ack.jpg
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,24 @@ | ||
--- | ||
title: "How it works" | ||
title: "How does ACK work?" | ||
sidebar_position: 5 | ||
--- | ||
|
||
Each ACK service controller is packaged into a separate container image that is published in a public repository corresponding to an individual ACK service controller. For each AWS service that we wish to provision, resources for the corresponding controller must be installed in the Amazon EKS cluster. | ||
Each ACK service controller is packaged into a separate container image that is published in a public repository corresponding to an individual ACK service controller. For each AWS service that we wish to provision, resources for the corresponding controller must be installed in the Amazon EKS cluster. We've already done this in the ```prepare-environment``` step. Helm charts and official container images for ACK are available [here](https://gallery.ecr.aws/aws-controllers-k8s). | ||
|
||
The controllers for both Amazon RDS and Amazon EC2 have been pre-installed in the cluster, each running as a deployment in their respective namespaces. For example, let's take a look at the running RDS controller: | ||
In this section of the workshop, as we will be working with Amazon DynamoDB, the ACK controllers for DynamoDB has been pre-installed in the cluster, running as a deployment in its own Kubernetes namespace. To see what's under the hood, lets run the below. | ||
|
||
```bash | ||
$ kubectl describe deployment -n ack-rds ack-rds | ||
$ kubectl describe deployment ack-dynamodb -n ack-dynamodb | ||
``` | ||
|
||
This controller will watch for Kubernetes custom resources for RDS such as `rds.services.k8s.aws.DBInstance` and will make API calls to RDS based on the configuration in those resources created. As resources are created, the controller will feed back status updates to the custom resources in the `Status` fields. | ||
:::info | ||
kubectl also contains useful `-oyaml` and `-ojson` flags which extract either the full YAML or JSON manifests of the deployment definition instead of the formatted output. | ||
::: | ||
|
||
This controller will watch for Kubernetes custom resources for DynamoDB such as `dynamodb.services.k8s.aws.Table` and will make API calls to the DynamoDB endpoint based on the configuration in these resources created. As resources are created, the controller will feed back status updates to the custom resources in the `Status` fields. For more information about the spec of the manifest, click [here](https://aws-controllers-k8s.github.io/community/reference/). | ||
|
||
If you'd like to dive deeper into the mechanics of what objects and API calls the controller listens for, run: | ||
|
||
```bash | ||
$ kubectl get crd | ||
``` |
Oops, something went wrong.