- Terraform
- kubectl
- GCP project
-
Create service account in GCP project and download the json file
-
Create
terraform.tfvars
gcp_credentials_file = "XXXXXX.json"
gcp_project = "XXXX-XXXX-XXXX"
allow_ips = [
"XXX.XXX.XX.XX/XX",
"XXX.XXX.XX.XX/XX",
]
- Apply GCP resources
$ terraform init
$ terraform apply
- Apply k8s resources
$ kubectl apply -f k8s.yaml
- Check ingress or load balancer on GCP to get the IP address (security policy may take several minutes to work)
$ kubectl get ingress -n example-cloud-armor
NAME HOSTS ADDRESS PORTS AGE
example-cloud-armor * XX.XXX.XX.XX 80 25m
- Destroy k8s resources
$ kubectl delete -f k8s.yaml
- Destroy GCP resources
$ terraform destroy