Skip to content

lynnlin827/example-gcp-cloud-armor-with-k8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example - Cloud Armor with kubernetes

Requirements

  • Terraform
  • kubectl
  • GCP project

Run

  1. Create service account in GCP project and download the json file

  2. 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",
]
  1. Apply GCP resources
$ terraform init
$ terraform apply
  1. Apply k8s resources
$ kubectl apply -f k8s.yaml
  1. 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

Down

  1. Destroy k8s resources
$ kubectl delete -f k8s.yaml
  1. Destroy GCP resources
$ terraform destroy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages