Hi, I have GKE Autopilot cluster up-and-running with Traefik ingress controller in-place. I would like to enable and configure Cloud Armour but it seems like it only can be used with HTTP(S) Load Balancer. Traefik ingress is using TCP Load Balancer. What are the options for me to enable Cloud Armour?
Google Cloud Armor can work with Traefik. However, it requires a few crucial changes to make it work.
First you need to change the type of service how the ingress controller (e.g. Traefik) is deployed to Nodeport and assign the specific annotation that refers to backend config with Cloud armor rule.
Then you need to obtain a global IP address from GCP.
Then you need to create a catch-all Ingress rule with the annotation that matches the IP address obtained from the previous step. That rule should forward all traffic to the Traefik service created.
Create security policy in Cloud Armor using Google console.
Created backend config using backend CRD that matches the name from the first step.
Create just regular Ingress and IngressRoute object and your network traffic will be protected through Google Cloud Armor.
The entire network flow looks like following;
Customer -> Internet -> Global GCE IP -> GCE ingress controller -> Catch all ingres -> traefik service -> traefik ingress controller -> whoami service -> whoami pod
I am about to create the blog post with all the necessary configuration and code snippets to make that process more readable.
Well, this is the way how I managed to configure Cloud Armor with Ingress controller, I believe that the same is also true for another ingress controller.
If you have some insights to share please let me know, thank you
Hi @jakubhajek yeah that a decent solution. I don't have better alternative, just a thought about the latency. But yeah need to perform load test to find out the actual latency.
You are welcome @stashordiyenko - let us know the results of your tests, the feedback, and improvements concerning that integration are more than welcome Thank you
Thanks a lot for you blog post. You didn't mention how to change the service type of Traefik service as by default it is installed with tcp load balancer in front. Jakub mentioned that the service type should be changed to NodePort. Could you add this information to your article?
I didn't progress with Cloud Armor and was looking to other WAF solutions with terraform support in the market. Going to come back to evaluation later next month.
i created an ingress over traefik service by using backend service of traefik with port 8080.
Then i get global IP. when i visit that ip its not hitting traefik admin panel.
My goal is to apply clous armor policy rule on that ip.