Skip to content

Commit c32f3fc

Browse files
authored
Merge pull request #340 from osamamagdy/feat--add-gcp-support
Feat add gcp support
2 parents 85cba01 + 41f8627 commit c32f3fc

40 files changed

+3078
-79
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ updates:
3838
directory: "/azure"
3939
schedule:
4040
interval: "monthly"
41+
- package-ecosystem: "terraform"
42+
directory: "/gcp"
43+
schedule:
44+
interval: "monthly"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ db.zip
2020
*.auto.tfvars
2121
node_modules
2222
.npm
23+
gcp/k8s/secret-volume.yml

azure/build-and-deploy-azure.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ export AZ_VAULT_URI="$(terraform output -raw vault_uri)"
5757
export AZ_KEY_VAULT_TENANT_ID="$(terraform output -raw tenant_id)"
5858
export AZ_KEY_VAULT_NAME="$(terraform output -raw vault_name)"
5959

60+
export AZ_STORAGE_ACCOUNT="$(terraform output -chdir=./shared-state -raw storage_account_name)"
61+
6062
# Set the kubeconfig
6163
az aks get-credentials --resource-group $RESOURCE_GROUP --name $CLUSTER_NAME
6264

@@ -150,6 +152,7 @@ echo "You can find the app password in password.txt"
150152

151153
helm upgrade --install mj ../helm/wrongsecrets-ctf-party \
152154
--set="balancer.env.K8S_ENV=azure" \
155+
--set="balancer.env.REACT_APP_AZ_BLOB_URL=https://${AZ_STORAGE_ACCOUNT}.blob.core.windows.net/tfstate" \
153156
--set="balancer.env.REACT_APP_ACCESS_PASSWORD=${APP_PASSWORD}" \
154157
--set="balancer.env.REACT_APP_CREATE_TEAM_HMAC_KEY=${CREATE_TEAM_HMAC}" \
155158
--set="balancer.env.AZ_KEY_VAULT_NAME=${AZ_KEY_VAULT_NAME}" \

azure/k8s-nginx-lb-script-cleanup.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ echo "If you applied the ctfd ingress, you need to delete it manually"
2222
# Give some time for the controller to remove cleaned ingresses
2323
sleep 5
2424

25-
echo "Cleanup helm chart"
26-
helm uninstall ingress-nginx \
27-
-n ingress-nginx
28-
29-
echo "Delete the namespace"
25+
echo "Delete the ingress-nginx namespace"
3026

3127
kubectl delete namespace ingress-nginx
3228

azure/shared-state/main.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ terraform {
33
required_providers {
44
azurerm = {
55
version = "~> 3.0"
6+
source = "hashicorp/azurerm"
67
}
78
random = {
89
version = "~> 3.0"
10+
source = "hashicorp/random"
911
}
1012
}
1113
}
@@ -16,7 +18,7 @@ provider "azurerm" {
1618
}
1719

1820
# If you're using an existing resource group, modify this part. That'll definitely be the case if you're using shared state!
19-
# Note that you'll need to find/replace references to "arurerm_resource_group.default" to "data.azurerm_resource_group.default"
21+
# Note that you'll need to find/replace references to "azurerm_resource_group.default" to "data.azurerm_resource_group.default"
2022
#data "azurerm_resource_group" "default" {
2123
# name = "owasp-wrongsecrets"
2224
#}

gcp/.terraform.lock.hcl

Lines changed: 82 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)