Skip to content

Commit

Permalink
reorg
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Nov 10, 2021
1 parent c53240c commit 398f9f1
Show file tree
Hide file tree
Showing 39 changed files with 108 additions and 183 deletions.
4 changes: 0 additions & 4 deletions examples/full-cluster/OFF/empty/locals.tf

This file was deleted.

1 change: 0 additions & 1 deletion examples/full-cluster/OFF/empty/prefixes.tf

This file was deleted.

5 changes: 0 additions & 5 deletions examples/full-cluster/OFF/empty/test.tf

This file was deleted.

1 change: 0 additions & 1 deletion examples/full-cluster/OFF/empty/version.tf

This file was deleted.

1 change: 1 addition & 0 deletions examples/full-cluster/aws-auth/data.eks-subdirectory.tf
15 changes: 0 additions & 15 deletions examples/full-cluster/cluster-roles/data.eks.tf

This file was deleted.

29 changes: 0 additions & 29 deletions examples/full-cluster/cluster-roles/kubeconfig.tf

This file was deleted.

15 changes: 0 additions & 15 deletions examples/full-cluster/common-services/data.eks.tf

This file was deleted.

29 changes: 0 additions & 29 deletions examples/full-cluster/common-services/kubeconfig.tf

This file was deleted.

1 change: 1 addition & 0 deletions examples/full-cluster/data.eks-main.tf
20 changes: 17 additions & 3 deletions examples/full-cluster/efs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ export HTTP_PROXY=http://proxy.tco.census.gov:3128
export HTTPS_PROXY=http://proxy.tco.census.gov:3128
```

## Setup Steps

First, copy the `remote_state.yml` from the parent and update `directory` to be the current directory.

Then, make sure the `parent_rs` (parent remote state) is updated to the proper remote state, found in the
parent directory.

```hcl
# in parent_rs.tf
parent_rs = data.terraform_remote_state.{vpc-state-path}_{application-state-path}-eks-{cluster-name}.outputs
```

Update this with the proper remote state path, as pulled from the application directory for the cluster in the
parent directory.

## Terraform Automated

A `tf-run.data` file exists here, so the simplest way to implemnt is with the `tf-run.sh` script.
Expand All @@ -34,7 +50,7 @@ A `tf-run.data` file exists here, so the simplest way to implemnt is with the `t
% tf-run.sh apply
```

* example of the tf-run.sh`steps
* example of the `tf-run.sh` steps

This is part of a larger cluster configuration, so at the end of the run it indicates another directory
to visit when done.
Expand Down Expand Up @@ -62,10 +78,8 @@ It is highly recommended to use the `tf-run.sh` approach.

## Terraform Manual

First, copy the `remote_state.yml` from the parent and update `directory` to be the current directory.

```shell

tf-directory-setup.py -l none
setup-new-directory.sh
tf-init
Expand Down
1 change: 1 addition & 0 deletions examples/full-cluster/efs/data.eks-subdirectory.tf
15 changes: 0 additions & 15 deletions examples/full-cluster/efs/data.eks.tf

This file was deleted.

1 change: 1 addition & 0 deletions examples/full-cluster/efs/kubeconfig.eks-subdirectory.tf
29 changes: 0 additions & 29 deletions examples/full-cluster/efs/kubeconfig.tf

This file was deleted.

2 changes: 0 additions & 2 deletions examples/full-cluster/efs/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ locals {

# replace TF remote state accordingly in parent_rs with that from the parent directory, and be sure to make the link
locals {
parent_rs = data.terraform_remote_state.{vpc-state-path}_{application-state-path}-eks-{cluster-name}.outputs

vpc_id = local.parent_rs.cluster_vpc_id
subnet_ids = local.parent_rs.cluster_subnet_ids
cluster_worker_sg_id = local.parent_rs.cluster_worker_sg_id
Expand Down
1 change: 1 addition & 0 deletions examples/full-cluster/efs/parent_rs.tf
10 changes: 10 additions & 0 deletions examples/full-cluster/includes.d/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Includes.d

## parent_rs.tf

Update this with the proper remote state path, as pulled from the application directory for the cluster in the
main cluster directory. This is used throughout the cluster components.

```hcl
parent_rs = data.terraform_remote_state.{vpc-state-path}_{application-state-path}-eks-{cluster-name}.outputs
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions examples/full-cluster/includes.d/parent_rs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# replace TF remote state accordingly in parent_rs with that from the parent directory, and be sure to make the link
locals {
parent_rs = data.terraform_remote_state.{vpc-state-path}_{application-state-path}-eks-{cluster-name}.outputs
}
3 changes: 3 additions & 0 deletions examples/full-cluster/irsa-roles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# irsa-roles


59 changes: 59 additions & 0 deletions examples/full-cluster/irsa-roles/cluster-autoscaler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# irsa-roles: cluster-autoscaler

This sets up the needed IAM roles for service accounts for the cluster autoscaler.


## Terraform Automated

A `tf-run.data` file exists here, so the simplest way to implemnt is with the `tf-run.sh` script.

* copy the `remote_state.yml` from the parent and update `directory` to be the current directory
* run the tf-run.sh

```console
% tf-run.sh apply
```

* example of the tf-run.sh`steps

This is part of a larger cluster configuration, so at the end of the run it indicates another directory
to visit when done.

```console
% tf-run.sh list
* running action=plan
* START: tf-run.sh v1.1.2 start=1636561755 end= logfile=logs/run.plan.20211110.1636561755.log (not-created)
* reading from tf-run.data
* read 6 entries from tf-run.data
> list
** START: start=1636561755
* 1 COMMAND> tf-directory-setup.py -l none
* 2 COMMAND> setup-new-directory.sh
* 3 COMMAND> tf-init -upgrade
* 4 POLICY> (*.tf) aws_iam_policy.app_policy1
* 4 tf-plan -target=aws_iam_policy.app_policy1
* 5 tf-plan
* 6 COMMAND> tf-directory-setup.py -l s3
** END: start=1636561755 end=1636561755 elapsed=0 logfile=logs/run.plan.20211110.1636561755.log (not-created)
```

It is highly recommended to use the `tf-run.sh` approach.

## Terraform Manual

First, copy the `remote_state.yml` from the parent and update `directory` to be the current directory.

```shell
tf-directory-setup.py -l none
setup-new-directory.sh
tf-init
````

* Apply the rest

```shell
tf-apply
tf-directory-setup.py -l s3
```

## Post Setup Examination
2 changes: 0 additions & 2 deletions examples/full-cluster/irsa-roles/cluster-autoscaler/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ locals {

# replace TF remote state accordingly in parent_rs with that from the parent directory, and be sure to make the link
locals {
parent_rs = data.terraform_remote_state.applications_apps-adsd-eks_vpc_east_vpc3_apps_eks-adsd-cumulus-qa.outputs

vpc_id = local.parent_rs.cluster_vpc_id
subnet_ids = local.parent_rs.cluster_subnet_ids
cluster_worker_sg_id = local.parent_rs.cluster_worker_sg_id
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions examples/full-cluster/irsa-roles/data.eks-subdirectory.tf
15 changes: 0 additions & 15 deletions examples/full-cluster/irsa-roles/data.eks.tf

This file was deleted.

1 change: 1 addition & 0 deletions examples/full-cluster/irsa-roles/parent_rs.tf
9 changes: 0 additions & 9 deletions examples/full-cluster/irsa-roles/remote_state.yml

This file was deleted.

1 change: 1 addition & 0 deletions examples/full-cluster/kubeconfig.eks-main.tf
1 change: 1 addition & 0 deletions examples/full-cluster/tf-run.data
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ COMMENT EC2 key pairs
null_resource.generate_keypair
aws_key_pair.cluster_keypair
COMMAND tf-directory-setup.py -l s3
COMMENT be sure to add the setup/ec2-ssh-eks-{cluster} to git-secret, git-secret hide, add the setup/*secret and setup/*pub got git, and commit the entirety of the change

ALL

Expand Down

0 comments on commit 398f9f1

Please sign in to comment.