我们正在与 GKE 一起实施 Cloud Armor 策略,以限制对 Ingress 的访问,并仅允许 Armor 策略中列入白名单的 IP 范围。 步骤如下:
向节点服务帐户和 Kubernetes Engine 服务代理添加了
Security admin
感谢任何帮助,TIA!
Error syncing to GCP: error running backend syncing routine: failed to set security policy from "" to "armor-policy-name" for backend service backend-service-name (namespace/serverice-name:&ServiceBackendPort{Name:,Number:80,}): googleapi: Error 400: Invalid value for field 'resource': '{ "securityPolicy": "https://www.googleapis.com/compute/v1/projects/gcp_project_name/global/s...'. deny action is only supported for TCP and SSL load balancers., invalid
问题是您只能将
deny
操作与 TCP 或 SSL 负载均衡器结合使用。由于您要将策略附加到 Ingress,因此您需要使用 deny-403
、deny-404
或 deny-502
作为规则中的操作。
https://cloud.google.com/sdk/gcloud/reference/compute/security-policies/rules/create#--action