Skip to content
This repository has been archived by the owner on Sep 18, 2023. It is now read-only.

Add AWS Deployment #1

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Add AWS Deployment #1

wants to merge 12 commits into from

Conversation

arsci
Copy link

@arsci arsci commented Sep 10, 2019

Split TF into separate modules:

  • AWS Cluster Resources (new) (eks module)
  • Kafka Demo Resources (original) (kube module)

Added deployment commands to makefile
Added deployment information to readme

README.md Outdated

AWS Deployment is split into two sections, cluster deployment module (eks) and resource deployment module (kube). Local deployment assumes local cluster has been provisioned and is available and only deploys the kube terraform module. AWS Deployment will deploy both cluster and kube to AWS.

1. Setup AWS config and `terraform init`. Credentials and set local environment variable AWS_DEFAULT_REGION to your region for terraform.
Copy link
Member

@danielsiwiec danielsiwiec Sep 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to include the terraform directory

Suggested change
1. Setup AWS config and `terraform init`. Credentials and set local environment variable AWS_DEFAULT_REGION to your region for terraform.
1. Setup AWS config and `terraform init terraform`. Credentials and set local environment variable AWS_DEFAULT_REGION to your region for terraform.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in latest commit

README.md Outdated

2. Build the Docker images and deploy to ECR. Update terraform files to pull images from ECR. (`tweets-transformation`, `twitter-forwarder`, `kafka-streams`)

3. Fill in VPC and Subnet IDs for the AWS EKS config in `terraform/eks/eks.tf`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Can we create a dedicated VPC and subnet for this with terraform?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in latest commit

README.md Outdated

AWS Deployment is split into two sections, cluster deployment module (eks) and resource deployment module (kube). Local deployment assumes local cluster has been provisioned and is available and only deploys the kube terraform module. AWS Deployment will deploy both cluster and kube to AWS.

1. Setup AWS config and `terraform init`. Credentials and set local environment variable AWS_DEFAULT_REGION to your region for terraform.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something is not clear here, maybe a typo. What about the credentials?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made this a bit more clear: setting up local AWS CLI credentials, setting environment variables for terraform to pick up (profile, region), then initializing terraform.

README.md Outdated

1. Setup AWS config and `terraform init`. Credentials and set local environment variable AWS_DEFAULT_REGION to your region for terraform.

2. Build the Docker images and deploy to ECR. Update terraform files to pull images from ECR. (`tweets-transformation`, `twitter-forwarder`, `kafka-streams`)
Copy link
Member

@danielsiwiec danielsiwiec Sep 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be automated somehow? Maybe you could use this to introduce an local vs aws switch?
Maybe this trick would be helpful to conditionally create AWS resources only if a variable is set?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also not very clear what needs to be updated and with what values.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added switch to point to image repository based on variable flag. If AWS, terraform will point to ECR, if local deployment terraform will point to local docker repository.

README.md Outdated

#### Revert to local deployment

Update kubectl to point to your local Kubernetes cluster.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add how? Or at least a link to instructions?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added command on how to switch back to local docker kubernetes cluster

* `tf.apply.aws` (EKS TF module)
* `configure.aws.kubeconfig` (Configures kubectl on your system for EKS endpoint)
* `configure.helm.svcaccount` (Configures helm service account in EKS)
* `tf.apply.local` (Deploys kafka-demo to the EKS cluster)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. This is a bit confusing, that tf.apply.local is run for the AWS setup. Perhaps rename it to something else, maybe tf.apply.eks and tf.apply.app or something like that?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to app instead of local.

…ventions, AWS deployment to include VPC & Subnets, automatic switch for docker local and ECR based on deployment type, general fixes, updated README
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants