You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+76-48Lines changed: 76 additions & 48 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,26 +1,46 @@
1
1
=======
2
2
# Datafold AWS module
3
3
4
-
This repository provisions resources on AWS, preparing them for a deployment of the
5
-
application on an EKS cluster.
4
+
This repository provisions infrastructure resources on AWS for deploying Datafold using the datafold-operator.
6
5
7
6
## About this module
8
7
8
+
**⚠️ Important**: This module is now **optional**. If you already have EKS infrastructure in place, you can configure the required resources independently. This module is primarily intended for customers who need to set up the complete infrastructure stack for EKS deployment.
9
+
10
+
The module provisions AWS infrastructure resources that are required for Datafold deployment. Application configuration is now managed through the `datafoldapplication` custom resource on the cluster using the datafold-operator, rather than through Terraform application directories.
11
+
12
+
## Breaking Changes
13
+
14
+
### Load Balancer Deployment (Default Changed)
15
+
16
+
**Breaking Change**: The load balancer is **no longer deployed by default**. The default behavior has been toggled to `deploy_lb = false`.
17
+
18
+
-**Previous behavior**: Load balancer was deployed by default
19
+
-**New behavior**: Load balancer deployment is disabled by default
20
+
-**Action required**: If you need a load balancer, you must explicitly set `deploy_lb = true` in your configuration, so that you don't lose it. (in the case it does happen, you need to redeploy it and then update your DNS to the new LB CNAME).
21
+
22
+
### Application Directory Removal
23
+
24
+
- The "application" directory is no longer part of this repository
25
+
- Application configuration is now managed through the `datafoldapplication` custom resource on the cluster
26
+
9
27
## Prerequisites
10
28
11
29
* An AWS account, preferably a new isolated one.
12
30
* Terraform >= 1.4.6
13
31
* A customer contract with Datafold
14
32
* The application does not work without credentials supplied by sales
15
33
* Access to our public helm-charts repository
34
+
* The datafold-operator installed on your EKS cluster
35
+
* Application configuration is managed through the `datafoldapplication` custom resource
16
36
17
37
The full deployment will create the following resources:
18
38
19
39
* AWS VPC
20
40
* AWS subnets
21
41
* AWS S3 bucket for clickhouse backups
22
-
* AWS Application Load Balancer
23
-
* AWS ACM certificate
42
+
* AWS Application Load Balancer (optional, disabled by default)
43
+
* AWS ACM certificate (if load balancer is enabled)
24
44
* Three EBS volumes for local data storage
25
45
* AWS RDS Postgres database
26
46
* An EKS cluster
@@ -29,6 +49,8 @@ The full deployment will create the following resources:
29
49
* Updating load balancer target group to point to specific pods in the cluster
30
50
* Rescaling the nodegroup between 1-2 nodes
31
51
52
+
**Infrastructure Dependencies**: For a complete list of required infrastructure resources and detailed deployment guidance, see the [Datafold Dedicated Cloud AWS Deployment Documentation](https://docs.datafold.com/datafold-deployment/dedicated-cloud/aws).
53
+
32
54
## Negative scope
33
55
34
56
* This module will not provision DNS names in your zone.
@@ -43,37 +65,56 @@ Create the bucket and dynamodb table for terraform state file:
43
65
* Run `./run_bootstrap.sh` to create them. Enter the deployment_name when the question is asked.
44
66
* The `deployment_name` is important. This is used for the k8s namespace and datadog unified logging tags and other places.
45
67
* Suggestion: `company-datafold`
46
-
* Transfer the name of that bucket and table into the `backend.hcl` (symlinked into both infra and application)
68
+
* Transfer the name of that bucket and table into the `backend.hcl`
47
69
* Set the `target_account_profile` and `region` where the bucket / table are stored.
48
70
*`backend.hcl` is only about where the terraform state file is located.
49
71
50
-
The example directory contains a single deployment example, which cleanly separates the
51
-
underlying runtime infra from the application deployment into kubernetes. Some specific
52
-
elements from the `infra` directory are copied and encrypted into the `application` directory.
72
+
The example directory contains a single deployment example for infrastructure setup.
53
73
54
74
Setting up the infrastructure:
55
75
56
76
* It is easiest if you have full admin access in the target project.
57
-
* Pre-create the ACM certificate you want to use on AWS and validate it in your DNS.
58
77
* Pre-create a symmetric encryption key that is used to encrypt/decrypt secrets of this deployment.
59
78
* Use the alias instead of the `mrk` link. Put that into `locals.tf`
60
-
* Refer to that certificate in main.tf using it's domain name: (Replace "datafold.acme.com")
61
-
* Change the settings in locals.tf (the versions in infra and application are sym-linked)
79
+
***Certificate Requirements** (depends on load balancer deployment method):
80
+
***If deploying load balancer from this Terraform module** (`deploy_lb = true`): Pre-create and validate the ACM certificate in your DNS, then refer to that certificate in main.tf using its domain name (Replace "datafold.acme.com")
81
+
***If deploying load balancer from within Kubernetes**: The certificate will be created automatically, but you must wait for it to become available and then validate it in your DNS after the deployment is complete
82
+
* Change the settings in locals.tf
62
83
* provider_region = which region you want to deploy in.
63
84
* aws_profile = The profile you want to use to issue the deployments. Targets the deployment account.
64
85
* kms_profile = Can be the same profile, unless you want the encryption key elsewhere.
65
86
* kms_key = A pre-created symmetric KMS key. It's only purpose is for encryption/decryption of deployment secrets.
66
87
* deployment_name = The name of the deployment, used in kubernetes namespace, container naming and datadog "deployment" Unified Tag)
67
-
* Run `terraform init -backend-config=../backend.hcl` in both application and infra directory.
68
-
* Our team will reach out to give you two secrets files:
69
-
*`application_secrets.yaml` goes into the `application` directory.
70
-
*`infra_secrets.yaml` goes into the `infra` directory.
71
-
* Encrypt both files with sops and call both `secrets.yaml`
88
+
* Run `terraform init -backend-config=../backend.hcl` in the infra directory.
89
+
72
90
* Run `terraform apply` in `infra` directory. This should complete ok.
73
-
* Check in the console if you see the load balancer, the EKS cluster, etc.
74
-
* Run `terraform apply` in `application` directory.
75
-
* Check the settings made in the `main.tf` file. Maybe you want to set "datadog.install" to `false`.
76
-
* Check with your favourite kubernetes tool if you see the namespace and several datafold pods running there.
91
+
* Check in the console if you see the EKS cluster, RDS database, etc.
92
+
* If you enabled load balancer deployment, check for the load balancer as well.
93
+
94
+
**Application Deployment**: After infrastructure is ready, deploy the application using the datafold-operator. See the [Datafold Helm Charts repository](https://github.com/datafold/helm-charts) for detailed application deployment instructions.
95
+
96
+
## Infrastructure Dependencies
97
+
98
+
This module is designed to provide the complete infrastructure stack for Datafold deployment. However, if you already have EKS infrastructure in place, you can choose to configure the required resources independently.
- IAM roles and service accounts for cluster operations
106
+
- Load balancer (optional, can be managed by AWS Load Balancer Controller)
107
+
- VPC and networking components
108
+
- SSL certificate (validation timing depends on deployment method):
109
+
-**Terraform-managed LB**: Certificate must be pre-created and validated
110
+
-**Kubernetes-managed LB**: Certificate created automatically, validated post-deployment
111
+
112
+
**Alternative Approaches**:
113
+
-**Use this module**: Provides complete infrastructure setup for new deployments
114
+
-**Use existing infrastructure**: Configure required resources manually or through other means
115
+
-**Hybrid approach**: Use this module for some components and existing infrastructure for others
116
+
117
+
For detailed specifications of each required component, see the [Datafold Dedicated Cloud AWS Deployment Documentation](https://docs.datafold.com/datafold-deployment/dedicated-cloud/aws). For application deployment instructions, see the [Datafold Helm Charts repository](https://github.com/datafold/helm-charts).
77
118
78
119
## About subnets and where they get created
79
120
@@ -89,37 +130,24 @@ it's AZ in the module. Thus:
89
130
-[10.0.0.0/24] will get deployed in us-east-1a
90
131
-[10.0.1.0/24] will get deployed in us-east-1b
91
132
92
-
To deploy to three AZ's, you should override the public/private subnet settings. Then it will iterate across
93
-
3 elements, but the order of the AZ's will be the same by default.
94
-
95
-
You can add an "exclusion list" to the AZ ID's. The AZ ID is not the same as the AZ name. The AZ name on AWS
96
-
is shuffled between their actual location across all AWS accounts. This means that your us-east-1a might be
97
-
use1-az1 for you, but it might be use1-az4 for an account elsewhere. So if you need to match AZ's, you should
98
-
match Availability zone ID's, not Availability zone names. The AZ ID is visible in the EC2 screen in the
99
-
"settings" screen. There you see a list of enabled AZ's, their ID and their name.
100
-
101
-
To specifically select particular AZ ID's, exclude the ones you do not want in the az_id_exclude_filter.
102
-
This is a list. That way, you can restrict this to only AZ's you want. Unfortunately it is an exclude filter
103
-
and not an include filter. That means if AWS adds additional AZ's, it could create replacements for a future AZ.
104
-
105
-
Good news is that when there letters in use, I'd expect those letters to be maintained per AZ ID once they exist.
106
-
Just for new accounts these can be shuffled all over again. So from terraform state perspective, things should
107
-
be consistent at least.
108
-
109
-
### Initializing the application
110
-
111
-
Herea are the steps to initialize databases and the initial site settings:
112
-
113
-
Establish a shell into the `<deployment>-dfshell` container.
114
-
It is likely that the scheduler and server containers are crashing in a loop.
133
+
To deploy to three AZ's, you should override the public/private subnet settings. Then it will iterate
134
+
across 3 elements, but the order of the AZ's will be the same by default.
115
135
116
-
All we need to is to run these commands:
136
+
You can add an "exclusion list" to the AZ ID's. The AZ ID is not the same as the AZ name. The AZ name
137
+
on AWS is shuffled between their actual location across all AWS accounts. This means that your
138
+
us-east-1a might be use1-az1 for you, but it might be use1-az4 for an account elsewhere. So if you
139
+
need to match AZ's, you should match Availability zone ID's, not Availability zone names. The AZ ID
140
+
is visible in the EC2 screen in the "settings" screen. There you see a list of enabled AZ's, their
0 commit comments