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: INSTRUCTOR.md
+21-3
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
Install terraform:
6
6
7
7
```
8
-
# Tested with terraform v0.15.4
8
+
# Tested with terraform v0.15.4, v1.0.2
9
9
brew install terraform
10
10
```
11
11
@@ -16,6 +16,20 @@ Install ansible:
16
16
pip3 install ansible
17
17
```
18
18
19
+
Provide credentials for both AWS and GCP:
20
+
```
21
+
# Authenticate with GCP. The easiest way to do this is to run
22
+
gcloud auth application-default login
23
+
# Authenticate with AWS. The easiest way to do this is to run
24
+
aws configure
25
+
```
26
+
27
+
Configure region and zone for your remote resources:
28
+
```
29
+
# Create a file named configuration.auto.tfvars, you can use as template the one called configuration-example.auto.tfvars
30
+
# This step is optional, but if you don't do it it will use default values from terraform.tfvars
31
+
# Use this file to configure your desired resources too
32
+
```
19
33
## Deploy
20
34
21
35
Go to the terraform directory:
@@ -37,7 +51,7 @@ terraform workspace list
37
51
terraform workspace select <workspace_name> || terraform workspace new <workspace_name>
38
52
```
39
53
40
-
Edit the `terraform.tfvars` file to adapt it to your needs:
54
+
Edit the `configuration.auto.tfvars` file to adapt it to your needs:
41
55
42
56
- Add as many entries to `environment` as desired (or none). Every entry can be considered an isolated unit from the others
43
57
- Inside an `environment` all parameters are optional, and default values are defined in the same file
@@ -69,7 +83,8 @@ If you don't already have the `lab` private key available locally, retrieve it f
69
83
---
70
84
71
85
```
72
-
ssh-add lab
86
+
eval "$(ssh-agent -s)"
87
+
ssh-add ~/.ssh/id_workshop
73
88
```
74
89
75
90
All solo.io enterprise products require a license key. If you'd like to preset limited-term keys on the student Virtual Machines, then set the `LICENSE_KEY` and `GLOO_MESH_LICENSE_KEY` and `PORTAL_LICENSE_KEY` environment variables on your workstation before running the `ansible-playbook` command.
@@ -85,6 +100,9 @@ Run the following command to deploy the Virtual Machines:
85
100
```
86
101
terraform apply -auto-approve
87
102
```
103
+
---
104
+
**NOTE**
105
+
Check TROUBLESHOOTING.md file in case you see errors
Copy file name to clipboardexpand all lines: TROUBLESHOOTING.md
+80-1
Original file line number
Diff line number
Diff line change
@@ -96,4 +96,83 @@ ssh-add -L
96
96
If not, add it to the agent (the file can be found in shared drive)
97
97
```
98
98
ssh-add ~/.ssh/rsa_solouser_github
99
-
```
99
+
```
100
+
101
+
# Terraform apply error 'resource not found'
102
+
There are strong dependencies among the resources created by terraform, and sometimes the child can't get the parent ready before the timeout.
103
+
104
+
Just run terraform apply again, with the same parameters, and terraform will resume the building
105
+
```
106
+
terraform apply
107
+
```
108
+
109
+
# Terraform apply failed
110
+
Run the same command again, terraform will complete the creation
111
+
112
+
# Terraform says it is locked
113
+
This can happen when a running apply is unexepctely closed, if you are sure there is not terraform process running
114
+
```
115
+
terraform force-unlock <lockid>
116
+
```
117
+
118
+
# Terraform is very slow
119
+
For a large number of resources (example 150 eks cluster => 4900 resources)
120
+
121
+
Increase the default level of parallelism (10) to a higher number. Be aware that too high numbers can cause rate-limit in cloud api and high cpu usage.
122
+
```
123
+
terraform apply -parallelism=150
124
+
```
125
+
126
+
Another, maybe better, alternative is to use different workspaces to build the same object in different namespaces.
127
+
These 3 commands can run in parallel, and every terraform process will deal with a portion of the final setup
128
+
```
129
+
TF_WORKSPACE=wkr-eks1 time terraform apply -parallelism=51 -auto-approve
130
+
TF_WORKSPACE=wkr-eks2 time terraform apply -parallelism=51 -auto-approve
131
+
TF_WORKSPACE=wkr-eks3 time terraform apply -parallelism=51 -auto-approve
132
+
```
133
+
134
+
After all commands are successful (you may need to retry some of them, as TF is not great handling large graphs of dependencies), you can see the outputs
135
+
```
136
+
TF_WORKSPACE=wkr-eks1 time terraform output eks_cluster_vm
137
+
TF_WORKSPACE=wkr-eks2 time terraform output eks_cluster_vm
138
+
TF_WORKSPACE=wkr-eks3 time terraform output eks_cluster_vm
139
+
```
140
+
141
+
And finally destroy them
142
+
```
143
+
TF_WORKSPACE=wkr-eks1 time terraform destroy -parallelism=51 -auto-approve -refresh=false
144
+
TF_WORKSPACE=wkr-eks2 time terraform destroy -parallelism=51 -auto-approve -refresh=false
145
+
TF_WORKSPACE=wkr-eks3 time terraform destroy -parallelism=51 -auto-approve -refresh=false
146
+
```
147
+
148
+
# Terraform says the maximum number of resources are created
0 commit comments