Skip to content

Instantly share code, notes, and snippets.

@juicemia
Created January 25, 2022 15:27
Show Gist options
  • Save juicemia/fd41e3702e9234eb241f0d6cea5a70e3 to your computer and use it in GitHub Desktop.
Save juicemia/fd41e3702e9234eb241f0d6cea5a70e3 to your computer and use it in GitHub Desktop.
Manifest that causes kubernetes provider to break
resource "kubernetes_manifest" "ratelimit_http_filter" {
manifest = {
"apiVersion" = "networking.istio.io/v1alpha3"
"kind" = "EnvoyFilter"
"metadata" = {
"name" = "ratelimit-http"
"namespace" = "namespace"
}
"spec" = {
"configPatches" = [
{
"applyTo" = "CLUSTER"
"match" = {
"cluster" = {
"service" = "envoy-limitsvc.namespace.svc.cluster.local"
}
}
"patch" = {
"operation" = "ADD"
"value" = {
"connect_timeout" = "10s"
"http2_protocol_options" = {}
"lb_policy" = "ROUND_ROBIN"
"load_assignment" = {
"cluster_name" = "rate_limit_cluster"
"endpoints" = [
{
"lb_endpoints" = [
{
"endpoint" = {
"address" = {
"socket_address" = {
"address" = "envoy-limitsvc.namespace.svc.cluster.local"
"port_value" = 42081
}
}
}
},
]
},
]
}
"name" = "rate_limit_cluster"
"type" = "STRICT_DNS"
}
}
},
{
"applyTo" = "HTTP_FILTER"
"match" = {
"context" = "GATEWAY"
"listener" = {
"filterChain" = {
"filter" = {
"name" = "envoy.filters.network.http_connection_manager"
"subFilter" = {
"name" = "envoy.filters.http.router"
}
}
}
}
}
"patch" = {
"operation" = "INSERT_BEFORE"
"value" = {
"name" = "envoy.filters.http.router"
"typed_config" = {
"@type" = "type.googleapis.com/envoy.extensions.filters.http.ratelimit.v3.RateLimit"
"domain" = "domain"
"failure_mode_deny" = false
"rate_limit_service" = {
"grpc_service" = {
"envoy_grpc" = {
"cluster_name" = "rate_limit_cluster"
}
"timeout" = "10s"
}
"transport_api_version" = "V3"
}
}
}
}
},
]
"workloadSelector" = {
"labels" = {
"istio" = "ingressgateway"
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment