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

MeshFaultInjections 정책 구성 참조

원문 보기 위키 갱신

MeshFaultInjections 정책 구성 참조 (MeshFaultInjections Policy Configuration Reference)

이 문서는 MeshFaultInjections 정책의 설정 구조를 확인할 수 있는 구성 참조 문서예요 Kuma MeshFaultInjection 리소스 스펙이 JSON 스키마 형태로 정리되어 있어서 from, default 같은 각 필드가 어떤 역할을 하는지 그대로 살펴볼 수 있어요 요청 지연(delay)이나 응답 중단(abort) 같은 장애 주입 동작을 대상 그룹별로 어떻게 지정하고, 몇 퍼센트의 요청에 적용할지 정하는 방법이 궁금하다면 이 문서를 참고하면 좋아요

출처: 문서

본문

구성

{
  "description": "Spec is the specification of the Kuma MeshFaultInjection resource.",
  "properties": {
    "from": {
      "description": "From list makes a match between clients and corresponding configurations",
      "items": {
        "properties": {
          "default": {
            "description": "Default is a configuration specific to the group of destinations referenced in\n'targetRef'",
            "properties": {
              "http": {
                "description": "Http allows to define list of Http faults between dataplanes.",
                "items": {
                  "description": "FaultInjection defines the configuration of faults between dataplanes.",
                  "properties": {
                    "abort": {
                      "description": "Abort defines a configuration of not delivering requests to destination\nservice and replacing the responses from destination dataplane by\npredefined status code",
                      "properties": {
                        "httpStatus": {
                          "description": "HTTP status code which will be returned to source side",
                          "format": "int32",
                          "type": "integer"
                        },
                        "percentage": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "description": "Percentage of requests on which abort will be injected, has to be\neither int or decimal represented as string.",
                          "x-kubernetes-int-or-string": true
                        }
                      },
                      "required": [
                        "httpStatus",
                        "percentage"
                      ],
                      "type": "object"
                    },
                    "delay": {
                      "description": "Delay defines configuration of delaying a response from a destination",
                      "properties": {
                        "percentage": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "description": "Percentage of requests on which delay will be injected, has to be\neither int or decimal represented as string.",
                          "x-kubernetes-int-or-string": true
                        },
                        "value": {
                          "description": "The duration during which the response will be delayed",
                          "type": "string"
                        }
                      },
                      "required": [
                        "percentage",
                        "value"
                      ],
                      "type": "object"
                    },
                    "responseBandwidth": {
                      "description": "ResponseBandwidth defines a configuration to limit the speed of\nresponding to the requests",
                      "properties": {
                        "limit": {
                          "description": "Limit is represented by value measure in Gbps, Mbps, kbps, e.g.\n10kbps",
                          "type": "string"
                        },
                        "percentage": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "description": "Percentage of requests on which response bandwidth limit will be\neither int or decimal represented as string.",
                          "x-kubernetes-int-or-string": true
                        }
                      },
                      "required": [
                        "limit",
                        "percentage"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "targetRef": {
            "description": "TargetRef is a reference to the resource that represents a group of\ndestinations.",
            "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": [
          "targetRef"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "rules": {
      "description": "Rules defines inbound fault injection configuration",
      "items": {
        "properties": {
          "default": {
            "description": "Default defines fault configuration",
            "properties": {
              "http": {
                "description": "Http allows to define list of Http faults between dataplanes.",
                "items": {
                  "description": "FaultInjection defines the configuration of faults between dataplanes.",
                  "properties": {
                    "abort": {
                      "description": "Abort defines a configuration of not delivering requests to destination\nservice and replacing the responses from destination dataplane by\npredefined status code",
                      "properties": {
                        "httpStatus": {
                          "description": "HTTP status code which will be returned to source side",
                          "format": "int32",
                          "type": "integer"
                        },
                        "percentage": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "description": "Percentage of requests on which abort will be injected, has to be\neither int or decimal represented as string.",
                          "x-kubernetes-int-or-string": true
                        }
                      },
                      "required": [
                        "httpStatus",
                        "percentage"
                      ],
                      "type": "object"
                    },
                    "delay": {
                      "description": "Delay defines configuration of delaying a response from a destination",
                      "properties": {
                        "percentage": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "description": "Percentage of requests on which delay will be injected, has to be\neither int or decimal represented as string.",
                          "x-kubernetes-int-or-string": true
                        },
                        "value": {
                          "description": "The duration during which the response will be delayed",
                          "type": "string"
                        }
                      },
                      "required": [
                        "percentage",
                        "value"
                      ],
                      "type": "object"
                    },
                    "responseBandwidth": {
                      "description": "ResponseBandwidth defines a configuration to limit the speed of\nresponding to the requests",
                      "properties": {
                        "limit": {
                          "description": "Limit is represented by value measure in Gbps, Mbps, kbps, e.g.\n10kbps",
                          "type": "string"
                        },
                        "percentage": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "description": "Percentage of requests on which response bandwidth limit will be\neither int or decimal represented as string.",
                          "x-kubernetes-int-or-string": true
                        }
                      },
                      "required": [
                        "limit",
                        "percentage"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "matches": {
            "description": "Matches defines list of matches for which fault injection will be applied",
            "items": {
              "properties": {
                "sni": {
                  "description": "SNI defines a matcher configuration for matching by SNI value carried on the TLS connection",
                  "properties": {
                    "type": {
                      "description": "Type defines how to match traffic by SNI. Only `Exact` is supported.",
                      "enum": [
                        "Exact"
                      ],
                      "type": "string"
                    },
                    "value": {
                      "description": "Value is the SNI carried on the TLS connection that needs to match for the configuration to be applied",
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "value"
                  ],
                  "type": "object"
                },
                "spiffeID": {
                  "description": "SpiffeID defines a matcher configuration for SpiffeID matching",
                  "properties": {
                    "type": {
                      "description": "Type defines how to match incoming traffic by SpiffeID. `Exact` or `Prefix` are allowed.",
                      "enum": [
                        "Exact",
                        "Prefix"
                      ],
                      "type": "string"
                    },
                    "value": {
                      "description": "Value is SpiffeID of a client that needs to match for the configuration to be applied",
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "value"
                  ],
                  "type": "object"
                }
              },
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "default"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "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"
    },
    "to": {
      "description": "To list makes a match between clients and corresponding configurations",
      "items": {
        "properties": {
          "default": {
            "description": "Default is a configuration specific to the group of destinations referenced in\n'targetRef'",
            "properties": {
              "http": {
                "description": "Http allows to define list of Http faults between dataplanes.",
                "items": {
                  "description": "FaultInjection defines the configuration of faults between dataplanes.",
                  "properties": {
                    "abort": {
                      "description": "Abort defines a configuration of not delivering requests to destination\nservice and replacing the responses from destination dataplane by\npredefined status code",
                      "properties": {
                        "httpStatus": {
                          "description": "HTTP status code which will be returned to source side",
                          "format": "int32",
                          "type": "integer"
                        },
                        "percentage": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "description": "Percentage of requests on which abort will be injected, has to be\neither int or decimal represented as string.",
                          "x-kubernetes-int-or-string": true
                        }
                      },
                      "required": [
                        "httpStatus",
                        "percentage"
                      ],
                      "type": "object"
                    },
                    "delay": {
                      "description": "Delay defines configuration of delaying a response from a destination",
                      "properties": {
                        "percentage": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "description": "Percentage of requests on which delay will be injected, has to be\neither int or decimal represented as string.",
                          "x-kubernetes-int-or-string": true
                        },
                        "value": {
                          "description": "The duration during which the response will be delayed",
                          "type": "string"
                        }
                      },
                      "required": [
                        "percentage",
                        "value"
                      ],
                      "type": "object"
                    },
                    "responseBandwidth": {
                      "description": "ResponseBandwidth defines a configuration to limit the speed of\nresponding to the requests",
                      "properties": {
                        "limit": {
                          "description": "Limit is represented by value measure in Gbps, Mbps, kbps, e.g.\n10kbps",
                          "type": "string"
                        },
                        "percentage": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "description": "Percentage of requests on which response bandwidth limit will be\neither int or decimal represented as string.",
                          "x-kubernetes-int-or-string": true
                        }
                      },
                      "required": [
                        "limit",
                        "percentage"
                      ],
                      "type": "object"
                    }
                  },
                  "type": "object"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "targetRef": {
            "description": "TargetRef is a reference to the resource that represents a group of\ndestinations.",
            "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": [
          "targetRef"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "type": "object"
}

더 알아보기 (Learn more)

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