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
A set of templates meant to work with [Zero], the templated result is a ready to scale infrastructure boilerplate built on top of AWS EKS baked with all best practices we have accumulated.
3
3
4
-
# AWS EKS Stack
4
+
## Repository structure
5
+
The root folder is used for declaring parameters required by the templates, and [Zero][zero] will gather the required parameters and parse the templates as individual repositories for user to maintain.
6
+
```sh
7
+
/ # file in the root directory is for initializing the user's repo and declaring metadata
8
+
|-- Makefile #make command triggers the initialization of repository
9
+
|-- zero-module.yml #module declares required parameters and credentials
10
+
|
11
+
|# files in templates become the repo for users
12
+
| templates/
13
+
||# this makefile is used both during init and
14
+
||# on-going needs/utilities for user to maintain their infrastructure
15
+
||-- Makefile
16
+
||-- terraform/
17
+
|||-- bootstrap/ #initial setup
18
+
|||-- environments/ #infrastructure setup
19
+
||||-- production/
20
+
||||-- staging/
21
+
||-- kubernetes
22
+
|||-- terraform
23
+
||||-- environments #k8s-ultities
24
+
|||||-- production/
25
+
|||||-- staging/
26
+
```
5
27
6
-
This is a [zero](https://github.com/commitdev/zero) module which sets up a
28
+
## AWS EKS Stack
29
+
The Zero-awk-eks stack is designed with scalability and maintainability in mind, this repo is a series of templates indented to be filled in with modules parameters, and executed by zero
30
+
This is a [Zero][zero] module which sets up a
7
31
hosting environment on AWS running Kubernetes. It will generate terraform output
8
-
which describes the environment mapped in this [architecture
which describes the environment mapped in this [architecture diagram][arch-diagram].
33
+
34
+
**Resource List**: [Link][resource-list]
10
35
11
36
**Prerequisites**
12
37
- Terraform installed
13
38
- Kubectl installed
14
39
- Wget installed
15
40
- A valid AWS account
16
-
-[Set up the AWS CLI](https://docs.aws.amazon.com/polly/latest/dg/setup-aws-cli.html)
17
-
-[A domain registered with Route53](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-register.html)
18
-
- Note: if you want to use different domain per environment (staging/poduction), you need to have multiple hosted zones. The available zones in Route53 can be found by running this command. `aws route53 list-hosted-zones`
41
+
-[Set up the AWS CLI][aws-cli]
42
+
-[A domain registered with Route53][aws-route53]
43
+
- Note: if you want to use different domain per environment (staging/production), you need to have multiple hosted zones. The available zones in Route53 can be found by running this command. `aws route53 list-hosted-zones`
19
44
20
45
## Getting Started
21
46
22
47
This is meant to be used with the `zero` tool and not directly. See
23
-
the [zero](https://github.com/commitdev/zero) repository for more
48
+
the [Zero][zero] repository for more
24
49
information. The tool will parse through configuration and fill in any
25
50
template variables which need to be encoded into the terraform configuration.
26
51
@@ -36,3 +61,15 @@ infrastructure:
36
61
- EC2 (t2.small): $0.023 USD / hr
37
62
38
63
EC2 instance sizing can be configured in [terraform/environments/staging/main.tf](terraform/environments/staging/main.tf)
-[Set up the AWS CLI](https://docs.aws.amazon.com/polly/latest/dg/setup-aws-cli.html)
9
-
-[A domain registered with Route53](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/domain-register.html)
10
-
- Note: if you want to use different domain per environment (staging/poduction), you need to have multiple hosted zones. The available zones in Route53 can be found by running this command. `aws route53 list-hosted-zones`
11
2
12
-
### Using the Kubernetes Cluster
3
+
# Overview
4
+
Your infrastructure should be up and running, your terraform repository is the source of truth for your infrastructure, here is [a list of components and resources][zero-resource-list] that comes with the EKS-stack
5
+
6
+
# How to
7
+
## Managing your Terraform
8
+
#### Why terraform
9
+
The repository follows infrastructure as code as a core principle, it allows repeatable and reproducible infrastructures and makes DevOps much more manageable; to learn more about it we suggest reading the [Terraform's workflow guide][tf-workflow].
10
+
11
+
#### Intended workflows
12
+
To make changes to the infrastructure you would modify the terraform code changing the components you wish to modify, then plan the changes with `terraform plan` to make sure you are making the desired changes; then apply the changes with `terraform apply` on your staging environment. Once you reach the satisfactory state, you should do the same on production environment and check-in the changes of your infrastructure code, as this repo should be the source of truth of your deployed infrastructure.
13
+
Our infrastructure is divided into a few areas.
14
+
1. Initial setup
15
+
-[remote state][tf-remote-state]
16
+
-[secrets][tf-secrets]
17
+
2. Infrastructure
18
+
-[production][tf-production-env]
19
+
-[staging][tf-staging-env]
20
+
3. Kubernetes utilities
21
+
-[production][tf-production-utilities]
22
+
-[staging][tf-staging-utilities]
23
+
24
+
25
+
#### Style guide, resources, and Configuring your infrastructure as code
26
+
For more information about the terraform in this repo, please see [Link][zero-tf-guide]
27
+
28
+
29
+
## Using the Kubernetes Cluster
13
30
14
31
Before using the cluster the first time you'll need to set up your local `kubectl` context:
15
32
```shell
@@ -26,13 +43,57 @@ kubectl get pods -A
26
43
To init and apply the terraform configs, simply run the `make` and specify the
Copy file name to clipboardExpand all lines: templates/terraform/README.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@
27
27
28
28
- All environments should contain the following:
29
29
30
-
`main.tf`: Toplevel terraform configuration file that instantiates the `environment` module.
30
+
`main.tf`: Top level terraform configuration file that instantiates the `environment` module.
31
31
32
32
- Configuration should be pushed "top->down" from the `environment` module to it's submodules.
33
33
@@ -40,7 +40,7 @@
40
40
`main.tf`: Module entrypoint where instantiation of resources happens.
41
41
`backend.tf`: Terraform remote state configuration.
42
42
`provider.tf`: Provider configuration.
43
-
`variables.tf`: Environment-specific variables are desclared here.
43
+
`variables.tf`: Environment-specific variables are declared here.
44
44
`versions.tf`: Terraform version information.
45
45
`files/`: (DEPRECATED)
46
46
@@ -78,9 +78,9 @@
78
78
79
79
- When to use the Terraform Kuberenetes Provider and when to use manifests?
80
80
81
-
- Use the Terraform Kubernetes Provider (`provider "kubernetes"`) whenever you are provisioning a resource that could be considered relatively static (think Ingress, RoleBinding, CluterRoleBinding, etc).
81
+
- Use the Terraform Kubernetes Provider (`provider "kubernetes"`) whenever you are provisioning a resource that could be considered relatively static (think Ingress, RoleBinding, ClusterRoleBinding, etc).
82
82
83
-
- Use conventional Kubernetes manifests / `kubectl` when provisioning resouirces that could be considered dynamic (think Deployments).
83
+
- Use conventional Kubernetes manifests / `kubectl` when provisioning resources that could be considered dynamic (think Deployments).
0 commit comments