본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

MeshProxyPatches 정책 설정 레퍼런스

원문 보기 위키 갱신

MeshProxyPatches 정책 설정 레퍼런스 (MeshProxyPatches Policy Configuration Reference)

이 문서는 Kuma의 MeshProxyPatch 정책 리소스 설정 스키마를 정리한 레퍼런스예요. 리소스의 전체 구조와 함께, appendModifications 목록을 통해 Envoy Cluster 같은 프록시 리소스에 jsonpatch 연산을 적용하는 방식을 필드 단위로 설명해 줘요. 각 필드의 설명과 타입, 필수 항목이 코드 예시와 함께 정리되어 있어서 정책을 직접 작성하거나 검토할 때 참고하기 좋아요.

출처: 문서

본문

구성

{
  "description": "Spec is the specification of the Kuma MeshProxyPatch resource.",
  "properties": {
    "default": {
      "description": "Default is a configuration specific to the group of destinations\nreferenced in 'targetRef'.",
      "properties": {
        "appendModifications": {
          "description": "AppendModifications is a list of modifications applied on the selected proxy.",
          "items": {
            "properties": {
              "cluster": {
                "description": "Cluster is a modification of Envoy's Cluster resource.",
                "properties": {
                  "jsonPatches": {
                    "description": "JsonPatches specifies list of jsonpatches to apply to on Envoy's Cluster\nresource",
                    "items": {
                      "description": "JsonPatchBlock is one json patch operation block.",
                      "properties": {
                        "from": {
                          "description": "From is a jsonpatch from string, used by move and copy operations.",
                          "type": "string"
                        },
                        "op": {
                          "description": "Op is a jsonpatch operation string.",
                          "enum": [
                            "add",
                            "remove",
                            "replace",
                            "move",
                            "copy"
                          ],
                          "type": "string"
                        },
                        "path": {
                          "description": "Path is a jsonpatch path string.",
                          "type": "string"
                        },
                        "value": {
                          "description": "Value must be a valid json value used by replace and add operations.",
                          "x-kubernetes-preserve-unknown-fields": true
                        }
                      },
                      "required": [
                        "op",
                        "path"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "match": {
                    "description": "Match is a set of conditions that have to be matched for modification operation to happen.",
                    "properties": {
                      "name": {
                        "description": "Name of the cluster to match.",
                        "type": "string"
                      },
                      "origin": {
                        "description": "Origin is the name of the component or plugin that generated the resource.\n\nHere is the list of well-known origins:\ninbound - resources generated for handling incoming traffic.\noutbound - resources generated for handling outgoing traffic.\ntransparent - resources generated for transparent proxy functionality.\nprometheus - resources generated when Prometheus metrics are enabled.\ndirect-access - resources generated for Direct Access functionality.\ningress - resources generated for Zone Ingress.\negress - resources generated for Zone Egress.\ngateway - resources generated for MeshGateway.\n\nThe list is not complete, because policy plugins can introduce new resources.\nFor example MeshTrace plugin can create Cluster with \"mesh-trace\" origin.",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "operation": {
                    "description": "Operation to execute on matched cluster.",
                    "enum": [
                      "Add",
                      "Remove",
                      "Patch"
                    ],
                    "type": "string"
                  },
                  "value": {
                    "description": "Value of xDS resource in YAML format to add or patch.\n\nPatch merges the value into the matched cluster, and repeated fields are\nappended to what the cluster already has. Circuit breaker thresholds are\nthe exception: Envoy resolves them by routing priority and ignores every\nthreshold after the first one of a given priority, so appending would be\ndead config. They are merged into the existing threshold with the same\npriority instead, and a value listing one priority twice keeps only the\nfirst entry.",
                    "type": "string"
                  }
                },
                "required": [
                  "operation"
                ],
                "type": "object"
              },
              "httpFilter": {
                "description": "HTTPFilter is a modification of Envoy HTTP Filter\navailable in HTTP Connection Manager in a Listener resource.",
                "properties": {
                  "jsonPatches": {
                    "description": "JsonPatches specifies list of jsonpatches to apply to on Envoy's\nHTTP Filter available in HTTP Connection Manager in a Listener resource.",
                    "items": {
                      "description": "JsonPatchBlock is one json patch operation block.",
                      "properties": {
                        "from": {
                          "description": "From is a jsonpatch from string, used by move and copy operations.",
                          "type": "string"
                        },
                        "op": {
                          "description": "Op is a jsonpatch operation string.",
                          "enum": [
                            "add",
                            "remove",
                            "replace",
                            "move",
                            "copy"
                          ],
                          "type": "string"
                        },
                        "path": {
                          "description": "Path is a jsonpatch path string.",
                          "type": "string"
                        },
                        "value": {
                          "description": "Value must be a valid json value used by replace and add operations.",
                          "x-kubernetes-preserve-unknown-fields": true
                        }
                      },
                      "required": [
                        "op",
                        "path"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "match": {
                    "description": "Match is a set of conditions that have to be matched for modification operation to happen.",
                    "properties": {
                      "listenerName": {
                        "description": "Name of the listener to match.",
                        "type": "string"
                      },
                      "listenerTags": {
                        "additionalProperties": {
                          "type": "string"
                        },
                        "description": "Listener tags available in Listener#Metadata#FilterMetadata[io.kuma.tags]",
                        "type": "object"
                      },
                      "name": {
                        "description": "Name of the HTTP filter. For example \"envoy.filters.http.local_ratelimit\"",
                        "type": "string"
                      },
                      "origin": {
                        "description": "Origin is the name of the component or plugin that generated the resource.\n\nHere is the list of well-known origins:\ninbound - resources generated for handling incoming traffic.\noutbound - resources generated for handling outgoing traffic.\ntransparent - resources generated for transparent proxy functionality.\nprometheus - resources generated when Prometheus metrics are enabled.\ndirect-access - resources generated for Direct Access functionality.\ningress - resources generated for Zone Ingress.\negress - resources generated for Zone Egress.\ngateway - resources generated for MeshGateway.\n\nThe list is not complete, because policy plugins can introduce new resources.\nFor example MeshTrace plugin can create Cluster with \"mesh-trace\" origin.",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "operation": {
                    "description": "Operation to execute on matched listener.",
                    "enum": [
                      "Remove",
                      "Patch",
                      "AddFirst",
                      "AddBefore",
                      "AddAfter",
                      "AddLast"
                    ],
                    "type": "string"
                  },
                  "value": {
                    "description": "Value of xDS resource in YAML format to add or patch.",
                    "type": "string"
                  }
                },
                "required": [
                  "operation"
                ],
                "type": "object"
              },
              "listener": {
                "description": "Listener is a modification of Envoy's Listener resource.",
                "properties": {
                  "jsonPatches": {
                    "description": "JsonPatches specifies list of jsonpatches to apply to on Envoy's Listener\nresource",
                    "items": {
                      "description": "JsonPatchBlock is one json patch operation block.",
                      "properties": {
                        "from": {
                          "description": "From is a jsonpatch from string, used by move and copy operations.",
                          "type": "string"
                        },
                        "op": {
                          "description": "Op is a jsonpatch operation string.",
                          "enum": [
                            "add",
                            "remove",
                            "replace",
                            "move",
                            "copy"
                          ],
                          "type": "string"
                        },
                        "path": {
                          "description": "Path is a jsonpatch path string.",
                          "type": "string"
                        },
                        "value": {
                          "description": "Value must be a valid json value used by replace and add operations.",
                          "x-kubernetes-preserve-unknown-fields": true
                        }
                      },
                      "required": [
                        "op",
                        "path"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "match": {
                    "description": "Match is a set of conditions that have to be matched for modification operation to happen.",
                    "properties": {
                      "name": {
                        "description": "Name of the listener to match.",
                        "type": "string"
                      },
                      "origin": {
                        "description": "Origin is the name of the component or plugin that generated the resource.\n\nHere is the list of well-known origins:\ninbound - resources generated for handling incoming traffic.\noutbound - resources generated for handling outgoing traffic.\ntransparent - resources generated for transparent proxy functionality.\nprometheus - resources generated when Prometheus metrics are enabled.\ndirect-access - resources generated for Direct Access functionality.\ningress - resources generated for Zone Ingress.\negress - resources generated for Zone Egress.\ngateway - resources generated for MeshGateway.\n\nThe list is not complete, because policy plugins can introduce new resources.\nFor example MeshTrace plugin can create Cluster with \"mesh-trace\" origin.",
                        "type": "string"
                      },
                      "tags": {
                        "additionalProperties": {
                          "type": "string"
                        },
                        "description": "Tags available in Listener#Metadata#FilterMetadata[io.kuma.tags]",
                        "type": "object"
                      }
                    },
                    "type": "object"
                  },
                  "operation": {
                    "description": "Operation to execute on matched listener.",
                    "enum": [
                      "Add",
                      "Remove",
                      "Patch"
                    ],
                    "type": "string"
                  },
                  "value": {
                    "description": "Value of xDS resource in YAML format to add or patch.",
                    "type": "string"
                  }
                },
                "required": [
                  "operation"
                ],
                "type": "object"
              },
              "networkFilter": {
                "description": "NetworkFilter is a modification of Envoy Listener's filter.",
                "properties": {
                  "jsonPatches": {
                    "description": "JsonPatches specifies list of jsonpatches to apply to on Envoy Listener's\nfilter.",
                    "items": {
                      "description": "JsonPatchBlock is one json patch operation block.",
                      "properties": {
                        "from": {
                          "description": "From is a jsonpatch from string, used by move and copy operations.",
                          "type": "string"
                        },
                        "op": {
                          "description": "Op is a jsonpatch operation string.",
                          "enum": [
                            "add",
                            "remove",
                            "replace",
                            "move",
                            "copy"
                          ],
                          "type": "string"
                        },
                        "path": {
                          "description": "Path is a jsonpatch path string.",
                          "type": "string"
                        },
                        "value": {
                          "description": "Value must be a valid json value used by replace and add operations.",
                          "x-kubernetes-preserve-unknown-fields": true
                        }
                      },
                      "required": [
                        "op",
                        "path"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "match": {
                    "description": "Match is a set of conditions that have to be matched for modification operation to happen.",
                    "properties": {
                      "listenerName": {
                        "description": "Name of the listener to match.",
                        "type": "string"
                      },
                      "listenerTags": {
                        "additionalProperties": {
                          "type": "string"
                        },
                        "description": "Listener tags available in Listener#Metadata#FilterMetadata[io.kuma.tags]",
                        "type": "object"
                      },
                      "name": {
                        "description": "Name of the network filter. For example \"envoy.filters.network.ratelimit\"",
                        "type": "string"
                      },
                      "origin": {
                        "description": "Origin is the name of the component or plugin that generated the resource.\n\nHere is the list of well-known origins:\ninbound - resources generated for handling incoming traffic.\noutbound - resources generated for handling outgoing traffic.\ntransparent - resources generated for transparent proxy functionality.\nprometheus - resources generated when Prometheus metrics are enabled.\ndirect-access - resources generated for Direct Access functionality.\ningress - resources generated for Zone Ingress.\negress - resources generated for Zone Egress.\ngateway - resources generated for MeshGateway.\n\nThe list is not complete, because policy plugins can introduce new resources.\nFor example MeshTrace plugin can create Cluster with \"mesh-trace\" origin.",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "operation": {
                    "description": "Operation to execute on matched listener.",
                    "enum": [
                      "Remove",
                      "Patch",
                      "AddFirst",
                      "AddBefore",
                      "AddAfter",
                      "AddLast"
                    ],
                    "type": "string"
                  },
                  "value": {
                    "description": "Value of xDS resource in YAML format to add or patch.",
                    "type": "string"
                  }
                },
                "required": [
                  "operation"
                ],
                "type": "object"
              },
              "virtualHost": {
                "description": "VirtualHost is a modification of Envoy's VirtualHost\nreferenced in HTTP Connection Manager in a Listener resource.",
                "properties": {
                  "jsonPatches": {
                    "description": "JsonPatches specifies list of jsonpatches to apply to on Envoy's\nVirtualHost resource",
                    "items": {
                      "description": "JsonPatchBlock is one json patch operation block.",
                      "properties": {
                        "from": {
                          "description": "From is a jsonpatch from string, used by move and copy operations.",
                          "type": "string"
                        },
                        "op": {
                          "description": "Op is a jsonpatch operation string.",
                          "enum": [
                            "add",
                            "remove",
                            "replace",
                            "move",
                            "copy"
                          ],
                          "type": "string"
                        },
                        "path": {
                          "description": "Path is a jsonpatch path string.",
                          "type": "string"
                        },
                        "value": {
                          "description": "Value must be a valid json value used by replace and add operations.",
                          "x-kubernetes-preserve-unknown-fields": true
                        }
                      },
                      "required": [
                        "op",
                        "path"
                      ],
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "match": {
                    "description": "Match is a set of conditions that have to be matched for modification operation to happen.",
                    "properties": {
                      "name": {
                        "description": "Name of the VirtualHost to match.",
                        "type": "string"
                      },
                      "origin": {
                        "description": "Origin is the name of the component or plugin that generated the resource.\n\nHere is the list of well-known origins:\ninbound - resources generated for handling incoming traffic.\noutbound - resources generated for handling outgoing traffic.\ntransparent - resources generated for transparent proxy functionality.\nprometheus - resources generated when Prometheus metrics are enabled.\ndirect-access - resources generated for Direct Access functionality.\ningress - resources generated for Zone Ingress.\negress - resources generated for Zone Egress.\ngateway - resources generated for MeshGateway.\n\nThe list is not complete, because policy plugins can introduce new resources.\nFor example MeshTrace plugin can create Cluster with \"mesh-trace\" origin.",
                        "type": "string"
                      },
                      "routeConfigurationName": {
                        "description": "Name of the RouteConfiguration resource to match.",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "operation": {
                    "description": "Operation to execute on matched listener.",
                    "enum": [
                      "Add",
                      "Remove",
                      "Patch"
                    ],
                    "type": "string"
                  },
                  "value": {
                    "description": "Value of xDS resource in YAML format to add or patch.",
                    "type": "string"
                  }
                },
                "required": [
                  "match",
                  "operation"
                ],
                "type": "object"
              }
            },
            "type": "object"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "targetRef": {
      "description": "TargetRef is a reference to the resource the policy takes an effect on.\nThe resource could be either a real store object or virtual resource\ndefined inplace.",
      "properties": {
        "kind": {
          "description": "Kind of the referenced resource",
          "enum": [
            "Mesh",
            "MeshSubset",
            "MeshGateway",
            "MeshService",
            "MeshExternalService",
            "MeshMultiZoneService",
            "MeshServiceSubset",
            "MeshHTTPRoute",
            "Dataplane"
          ],
          "type": "string"
        },
        "labels": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Labels are used to select group of MeshServices that match labels. Either Labels or\nName and Namespace can be used.",
          "type": "object"
        },
        "mesh": {
          "description": "Mesh is reserved for future use to identify cross mesh resources.",
          "type": "string"
        },
        "name": {
          "description": "Name of the referenced resource. Can only be used with kinds: `MeshService`,\n`MeshServiceSubset` and `MeshGatewayRoute`",
          "type": "string"
        },
        "namespace": {
          "description": "Namespace specifies the namespace of target resource. If empty only resources in policy namespace\nwill be targeted.",
          "type": "string"
        },
        "proxyTypes": {
          "description": "ProxyTypes specifies the data plane types that are subject to the policy. When not specified,\nall data plane types are targeted by the policy.",
          "items": {
            "enum": [
              "Sidecar",
              "Gateway"
            ],
            "type": "string"
          },
          "type": "array"
        },
        "sectionName": {
          "description": "SectionName is used to target specific section of resource.\nFor example, you can target port from MeshService.ports[] by its name. Only traffic to this port will be affected.",
          "type": "string"
        },
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Tags used to select a subset of proxies by tags. Can only be used with kinds\n`MeshSubset` and `MeshServiceSubset`",
          "type": "object"
        }
      },
      "required": [
        "kind"
      ],
      "type": "object"
    }
  },
  "required": [
    "default"
  ],
  "type": "object"
}

더 알아보기 (Learn more)

이 문서에는 원문에서 추출한 별도의 관련 문서 링크가 없어요.