{
  "description": "Canary is the Schema for the Canary API.",
  "type": "object",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "description": "CanarySpec defines the desired state of a Canary.",
      "type": "object",
      "required": [
        "targetRef",
        "analysis"
      ],
      "properties": {
        "provider": {
          "description": "Traffic managent provider",
          "type": "string"
        },
        "metricsServer": {
          "description": "Prometheus URL",
          "type": "string"
        },
        "progressDeadlineSeconds": {
          "description": "Deployment progress deadline",
          "type": "number"
        },
        "targetRef": {
          "description": "Target selector",
          "type": "object",
          "required": [
            "apiVersion",
            "kind",
            "name"
          ],
          "properties": {
            "apiVersion": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "DaemonSet",
                "Deployment",
                "Service"
              ]
            },
            "name": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "autoscalerRef": {
          "description": "Scaler selector",
          "type": "object",
          "required": [
            "apiVersion",
            "kind",
            "name"
          ],
          "properties": {
            "apiVersion": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "HorizontalPodAutoscaler",
                "ScaledObject"
              ]
            },
            "name": {
              "type": "string"
            },
            "primaryScalerQueries": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            "primaryScalerReplicas": {
              "type": "object",
              "properties": {
                "minReplicas": {
                  "type": "integer",
                  "minimum": 1
                },
                "maxReplicas": {
                  "type": "integer",
                  "minimum": 1
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "ingressRef": {
          "description": "Ingress selector",
          "type": "object",
          "required": [
            "apiVersion",
            "kind",
            "name"
          ],
          "properties": {
            "apiVersion": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "Ingress"
              ]
            },
            "name": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "routeRef": {
          "description": "APISIX route selector",
          "type": "object",
          "required": [
            "apiVersion",
            "kind",
            "name"
          ],
          "properties": {
            "apiVersion": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "ApisixRoute"
              ]
            },
            "name": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "upstreamRef": {
          "description": "Gloo Upstream selector",
          "type": "object",
          "required": [
            "apiVersion",
            "kind",
            "name"
          ],
          "properties": {
            "apiVersion": {
              "type": "string"
            },
            "kind": {
              "type": "string",
              "enum": [
                "Upstream"
              ]
            },
            "name": {
              "type": "string"
            },
            "namespace": {
              "type": "string"
            }
          },
          "additionalProperties": false
        },
        "service": {
          "description": "Kubernetes Service spec",
          "type": "object",
          "required": [
            "port"
          ],
          "properties": {
            "name": {
              "description": "Kubernetes service name",
              "type": "string"
            },
            "port": {
              "description": "Container port number",
              "type": "number"
            },
            "portName": {
              "description": "Container port name",
              "type": "string"
            },
            "appProtocol": {
              "description": "Application protocol of the port",
              "type": "string"
            },
            "trafficDistribution": {
              "description": "Traffic distribution of the service",
              "type": "string",
              "enum": [
                "PreferClose",
                "PreferSameZone",
                "PreferSameNode"
              ]
            },
            "targetPort": {
              "description": "Container target port name",
              "x-kubernetes-int-or-string": true
            },
            "portDiscovery": {
              "description": "Enable port discovery",
              "type": "boolean"
            },
            "headless": {
              "description": "Headless if set to true, generates headless Kubernetes services.",
              "type": "boolean"
            },
            "timeout": {
              "description": "HTTP or gRPC request timeout",
              "type": "string"
            },
            "meshName": {
              "description": "AppMesh mesh name",
              "type": "string"
            },
            "backends": {
              "description": "AppMesh backend array",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "hosts": {
              "description": "The list of host names for this service",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "delegation": {
              "description": "enable behaving as a delegate VirtualService",
              "type": "boolean"
            },
            "match": {
              "description": "URI match conditions",
              "type": "array",
              "items": {
                "properties": {
                  "authority": {
                    "oneOf": [
                      {
                        "not": {
                          "anyOf": [
                            {
                              "required": [
                                "exact"
                              ]
                            },
                            {
                              "required": [
                                "prefix"
                              ]
                            },
                            {
                              "required": [
                                "regex"
                              ]
                            }
                          ]
                        }
                      },
                      {
                        "required": [
                          "exact"
                        ]
                      },
                      {
                        "required": [
                          "prefix"
                        ]
                      },
                      {
                        "required": [
                          "regex"
                        ]
                      }
                    ],
                    "properties": {
                      "exact": {
                        "format": "string",
                        "type": "string"
                      },
                      "prefix": {
                        "format": "string",
                        "type": "string"
                      },
                      "regex": {
                        "description": "RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).",
                        "format": "string",
                        "type": "string"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "gateways": {
                    "description": "Names of gateways where the rule should be applied.",
                    "items": {
                      "format": "string",
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "headers": {
                    "additionalProperties": {
                      "oneOf": [
                        {
                          "not": {
                            "anyOf": [
                              {
                                "required": [
                                  "exact"
                                ]
                              },
                              {
                                "required": [
                                  "prefix"
                                ]
                              },
                              {
                                "required": [
                                  "regex"
                                ]
                              }
                            ]
                          }
                        },
                        {
                          "required": [
                            "exact"
                          ]
                        },
                        {
                          "required": [
                            "prefix"
                          ]
                        },
                        {
                          "required": [
                            "regex"
                          ]
                        }
                      ],
                      "properties": {
                        "exact": {
                          "format": "string",
                          "type": "string"
                        },
                        "prefix": {
                          "format": "string",
                          "type": "string"
                        },
                        "regex": {
                          "description": "RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).",
                          "format": "string",
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "type": "object"
                  },
                  "ignoreUriCase": {
                    "description": "Flag to specify whether the URI matching should be case-insensitive.",
                    "type": "boolean"
                  },
                  "method": {
                    "oneOf": [
                      {
                        "not": {
                          "anyOf": [
                            {
                              "required": [
                                "exact"
                              ]
                            },
                            {
                              "required": [
                                "prefix"
                              ]
                            },
                            {
                              "required": [
                                "regex"
                              ]
                            }
                          ]
                        }
                      },
                      {
                        "required": [
                          "exact"
                        ]
                      },
                      {
                        "required": [
                          "prefix"
                        ]
                      },
                      {
                        "required": [
                          "regex"
                        ]
                      }
                    ],
                    "properties": {
                      "exact": {
                        "format": "string",
                        "type": "string"
                      },
                      "prefix": {
                        "format": "string",
                        "type": "string"
                      },
                      "regex": {
                        "description": "RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).",
                        "format": "string",
                        "type": "string"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "name": {
                    "description": "The name assigned to a match.",
                    "format": "string",
                    "type": "string"
                  },
                  "port": {
                    "description": "Specifies the ports on the host that is being addressed.",
                    "type": "integer"
                  },
                  "queryParams": {
                    "additionalProperties": {
                      "oneOf": [
                        {
                          "not": {
                            "anyOf": [
                              {
                                "required": [
                                  "exact"
                                ]
                              },
                              {
                                "required": [
                                  "prefix"
                                ]
                              },
                              {
                                "required": [
                                  "regex"
                                ]
                              }
                            ]
                          }
                        },
                        {
                          "required": [
                            "exact"
                          ]
                        },
                        {
                          "required": [
                            "prefix"
                          ]
                        },
                        {
                          "required": [
                            "regex"
                          ]
                        }
                      ],
                      "properties": {
                        "exact": {
                          "format": "string",
                          "type": "string"
                        },
                        "prefix": {
                          "format": "string",
                          "type": "string"
                        },
                        "regex": {
                          "description": "RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).",
                          "format": "string",
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "description": "Query parameters for matching.",
                    "type": "object"
                  },
                  "scheme": {
                    "oneOf": [
                      {
                        "not": {
                          "anyOf": [
                            {
                              "required": [
                                "exact"
                              ]
                            },
                            {
                              "required": [
                                "prefix"
                              ]
                            },
                            {
                              "required": [
                                "regex"
                              ]
                            }
                          ]
                        }
                      },
                      {
                        "required": [
                          "exact"
                        ]
                      },
                      {
                        "required": [
                          "prefix"
                        ]
                      },
                      {
                        "required": [
                          "regex"
                        ]
                      }
                    ],
                    "properties": {
                      "exact": {
                        "format": "string",
                        "type": "string"
                      },
                      "prefix": {
                        "format": "string",
                        "type": "string"
                      },
                      "regex": {
                        "description": "RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).",
                        "format": "string",
                        "type": "string"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "sourceLabels": {
                    "additionalProperties": {
                      "format": "string",
                      "type": "string"
                    },
                    "type": "object"
                  },
                  "sourceNamespace": {
                    "description": "Source namespace constraining the applicability of a rule to workloads in that namespace.",
                    "format": "string",
                    "type": "string"
                  },
                  "uri": {
                    "oneOf": [
                      {
                        "not": {
                          "anyOf": [
                            {
                              "required": [
                                "exact"
                              ]
                            },
                            {
                              "required": [
                                "prefix"
                              ]
                            },
                            {
                              "required": [
                                "regex"
                              ]
                            }
                          ]
                        }
                      },
                      {
                        "required": [
                          "exact"
                        ]
                      },
                      {
                        "required": [
                          "prefix"
                        ]
                      },
                      {
                        "required": [
                          "regex"
                        ]
                      }
                    ],
                    "properties": {
                      "exact": {
                        "format": "string",
                        "type": "string"
                      },
                      "prefix": {
                        "format": "string",
                        "type": "string"
                      },
                      "regex": {
                        "description": "RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).",
                        "format": "string",
                        "type": "string"
                      }
                    },
                    "type": "object",
                    "additionalProperties": false
                  },
                  "withoutHeaders": {
                    "additionalProperties": {
                      "oneOf": [
                        {
                          "not": {
                            "anyOf": [
                              {
                                "required": [
                                  "exact"
                                ]
                              },
                              {
                                "required": [
                                  "prefix"
                                ]
                              },
                              {
                                "required": [
                                  "regex"
                                ]
                              }
                            ]
                          }
                        },
                        {
                          "required": [
                            "exact"
                          ]
                        },
                        {
                          "required": [
                            "prefix"
                          ]
                        },
                        {
                          "required": [
                            "regex"
                          ]
                        }
                      ],
                      "properties": {
                        "exact": {
                          "format": "string",
                          "type": "string"
                        },
                        "prefix": {
                          "format": "string",
                          "type": "string"
                        },
                        "regex": {
                          "description": "RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).",
                          "format": "string",
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "description": "withoutHeader has the same syntax with the header, but has opposite meaning.",
                    "type": "object"
                  }
                },
                "type": "object",
                "additionalProperties": false
              }
            },
            "retries": {
              "description": "Retry policy for HTTP requests",
              "type": "object",
              "properties": {
                "attempts": {
                  "description": "Number of retries for a given request",
                  "format": "int32",
                  "type": "integer"
                },
                "perTryTimeout": {
                  "description": "Timeout per retry attempt for a given request",
                  "type": "string"
                },
                "retryOn": {
                  "description": "Specifies the conditions under which retry takes place",
                  "format": "string",
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "rewrite": {
              "description": "Rewrite HTTP URIs",
              "type": "object",
              "properties": {
                "uri": {
                  "format": "string",
                  "type": "string"
                },
                "authority": {
                  "format": "string",
                  "type": "string"
                },
                "type": {
                  "format": "string",
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "mirror": {
              "description": "Mirror defines a schema for a filter that mirrors requests.",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "backendRef": {
                    "properties": {
                      "group": {
                        "default": "",
                        "maxLength": 253,
                        "pattern": "^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$",
                        "type": "string"
                      },
                      "kind": {
                        "default": "Service",
                        "maxLength": 63,
                        "minLength": 1,
                        "pattern": "^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$",
                        "type": "string"
                      },
                      "name": {
                        "maxLength": 253,
                        "minLength": 1,
                        "type": "string"
                      },
                      "namespace": {
                        "maxLength": 63,
                        "minLength": 1,
                        "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
                        "type": "string"
                      },
                      "port": {
                        "format": "int32",
                        "maximum": 65535,
                        "minimum": 1,
                        "type": "integer"
                      }
                    },
                    "required": [
                      "name"
                    ],
                    "type": "object",
                    "x-kubernetes-validations": [
                      {
                        "message": "Must have port for Service reference",
                        "rule": "(size(self.group) == 0 && self.kind == 'Service') ? has(self.port) : true"
                      }
                    ],
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              },
              "required": [
                "backendRef"
              ]
            },
            "headers": {
              "description": "Headers operations",
              "type": "object",
              "properties": {
                "request": {
                  "properties": {
                    "add": {
                      "additionalProperties": {
                        "format": "string",
                        "type": "string"
                      },
                      "type": "object"
                    },
                    "remove": {
                      "items": {
                        "format": "string",
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "set": {
                      "additionalProperties": {
                        "format": "string",
                        "type": "string"
                      },
                      "type": "object"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                },
                "response": {
                  "properties": {
                    "add": {
                      "additionalProperties": {
                        "format": "string",
                        "type": "string"
                      },
                      "type": "object"
                    },
                    "remove": {
                      "items": {
                        "format": "string",
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "set": {
                      "additionalProperties": {
                        "format": "string",
                        "type": "string"
                      },
                      "type": "object"
                    }
                  },
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "gateways": {
              "description": "The list of Istio gateway for this virtual service",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "gatewayRefs": {
              "description": "The list of parent Gateways for a HTTPRoute",
              "maxItems": 32,
              "type": "array",
              "items": {
                "required": [
                  "name"
                ],
                "type": "object",
                "properties": {
                  "group": {
                    "default": "gateway.networking.k8s.io",
                    "maxLength": 253,
                    "pattern": "^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$",
                    "type": "string"
                  },
                  "kind": {
                    "default": "Gateway",
                    "maxLength": 63,
                    "minLength": 1,
                    "pattern": "^[a-zA-Z]([-a-zA-Z0-9]*[a-zA-Z0-9])?$",
                    "type": "string"
                  },
                  "name": {
                    "maxLength": 253,
                    "minLength": 1,
                    "type": "string"
                  },
                  "namespace": {
                    "maxLength": 63,
                    "minLength": 1,
                    "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
                    "type": "string"
                  },
                  "sectionName": {
                    "maxLength": 253,
                    "minLength": 1,
                    "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$",
                    "type": "string"
                  },
                  "port": {
                    "format": "int32",
                    "maximum": 65535,
                    "minimum": 1,
                    "type": "integer"
                  }
                },
                "additionalProperties": false
              }
            },
            "corsPolicy": {
              "description": "Istio Cross-Origin Resource Sharing policy (CORS)",
              "type": "object",
              "properties": {
                "allowCredentials": {
                  "type": "boolean"
                },
                "allowHeaders": {
                  "items": {
                    "format": "string",
                    "type": "string"
                  },
                  "type": "array"
                },
                "allowMethods": {
                  "description": "List of HTTP methods allowed to access the resource",
                  "items": {
                    "format": "string",
                    "type": "string"
                  },
                  "type": "array"
                },
                "allowOrigin": {
                  "description": "The list of origins that are allowed to perform CORS requests.",
                  "items": {
                    "format": "string",
                    "type": "string"
                  },
                  "type": "array"
                },
                "allowOrigins": {
                  "description": "String patterns that match allowed origins",
                  "type": "array",
                  "items": {
                    "type": "object",
                    "oneOf": [
                      {
                        "required": [
                          "exact"
                        ]
                      },
                      {
                        "required": [
                          "prefix"
                        ]
                      },
                      {
                        "required": [
                          "regex"
                        ]
                      }
                    ],
                    "properties": {
                      "exact": {
                        "format": "string",
                        "type": "string"
                      },
                      "prefix": {
                        "format": "string",
                        "type": "string"
                      },
                      "regex": {
                        "format": "string",
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "exposeHeaders": {
                  "items": {
                    "format": "string",
                    "type": "string"
                  },
                  "type": "array"
                },
                "maxAge": {
                  "type": "string"
                }
              },
              "additionalProperties": false
            },
            "trafficPolicy": {
              "description": "Istio traffic policy",
              "type": "object",
              "properties": {
                "connectionPool": {
                  "type": "object",
                  "properties": {
                    "http": {
                      "description": "HTTP connection pool settings.",
                      "type": "object",
                      "properties": {
                        "h2UpgradePolicy": {
                          "description": "Specify if http1.1 connection should be upgraded to http2 for the associated destination.",
                          "enum": [
                            "DEFAULT",
                            "DO_NOT_UPGRADE",
                            "UPGRADE"
                          ],
                          "type": "string"
                        },
                        "http1MaxPendingRequests": {
                          "description": "Maximum number of pending HTTP requests to a destination.",
                          "format": "int32",
                          "type": "integer"
                        },
                        "http2MaxRequests": {
                          "description": "Maximum number of requests to a backend.",
                          "format": "int32",
                          "type": "integer"
                        },
                        "idleTimeout": {
                          "description": "The idle timeout for upstream connection pool connections.",
                          "type": "string"
                        },
                        "maxRequestsPerConnection": {
                          "description": "Maximum number of requests per connection to a backend.",
                          "format": "int32",
                          "type": "integer"
                        },
                        "maxRetries": {
                          "format": "int32",
                          "type": "integer"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false
                },
                "loadBalancer": {
                  "description": "Settings controlling the load balancer algorithms.",
                  "type": "object",
                  "oneOf": [
                    {
                      "required": [
                        "simple"
                      ]
                    },
                    {
                      "properties": {
                        "consistentHash": {
                          "oneOf": [
                            {
                              "required": [
                                "httpHeaderName"
                              ]
                            },
                            {
                              "required": [
                                "httpCookie"
                              ]
                            },
                            {
                              "required": [
                                "useSourceIp"
                              ]
                            },
                            {
                              "required": [
                                "httpQueryParameterName"
                              ]
                            }
                          ]
                        }
                      },
                      "required": [
                        "consistentHash"
                      ]
                    }
                  ],
                  "properties": {
                    "consistentHash": {
                      "properties": {
                        "httpCookie": {
                          "description": "Hash based on HTTP cookie.",
                          "properties": {
                            "name": {
                              "description": "Name of the cookie.",
                              "format": "string",
                              "type": "string"
                            },
                            "path": {
                              "description": "Path to set for the cookie.",
                              "format": "string",
                              "type": "string"
                            },
                            "ttl": {
                              "description": "Lifetime of the cookie.",
                              "type": "string"
                            }
                          },
                          "type": "object",
                          "additionalProperties": false
                        },
                        "httpHeaderName": {
                          "description": "Hash based on a specific HTTP header.",
                          "format": "string",
                          "type": "string"
                        },
                        "httpQueryParameterName": {
                          "description": "Hash based on a specific HTTP query parameter.",
                          "format": "string",
                          "type": "string"
                        },
                        "minimumRingSize": {
                          "type": "integer"
                        },
                        "useSourceIp": {
                          "description": "Hash based on the source IP address.",
                          "type": "boolean"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "localityLbSetting": {
                      "properties": {
                        "distribute": {
                          "description": "Optional: only one of distribute or failover can be set.",
                          "items": {
                            "properties": {
                              "from": {
                                "description": "Originating locality, '/' separated, e.g.",
                                "format": "string",
                                "type": "string"
                              },
                              "to": {
                                "additionalProperties": {
                                  "type": "integer"
                                },
                                "description": "Map of upstream localities to traffic distribution weights.",
                                "type": "object"
                              }
                            },
                            "type": "object",
                            "additionalProperties": false
                          },
                          "type": "array"
                        },
                        "enabled": {
                          "description": "enable locality load balancing, this is DestinationRule-level and will override mesh wide settings in entirety.",
                          "type": "boolean"
                        },
                        "failover": {
                          "description": "Optional: only failover or distribute can be set.",
                          "items": {
                            "properties": {
                              "from": {
                                "description": "Originating region.",
                                "format": "string",
                                "type": "string"
                              },
                              "to": {
                                "format": "string",
                                "type": "string"
                              }
                            },
                            "type": "object",
                            "additionalProperties": false
                          },
                          "type": "array"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "simple": {
                      "enum": [
                        "ROUND_ROBIN",
                        "LEAST_CONN",
                        "RANDOM",
                        "PASSTHROUGH",
                        "LEAST_REQUEST"
                      ],
                      "type": "string"
                    },
                    "warmupDurationSecs": {
                      "description": "Represents the warmup duration of Service.",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                "outlierDetection": {
                  "description": "Settings controlling eviction of unhealthy hosts from the load balancing pool.",
                  "type": "object",
                  "properties": {
                    "baseEjectionTime": {
                      "description": "Minimum ejection duration.",
                      "type": "string"
                    },
                    "consecutive5xxErrors": {
                      "description": "Number of 5xx errors before a host is ejected from the connection pool.",
                      "type": "integer"
                    },
                    "consecutiveErrors": {
                      "format": "int32",
                      "type": "integer"
                    },
                    "consecutiveGatewayErrors": {
                      "description": "Number of gateway errors before a host is ejected from the connection pool.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "interval": {
                      "description": "Time interval between ejection sweep analysis.",
                      "type": "string"
                    },
                    "maxEjectionPercent": {
                      "format": "int32",
                      "type": "integer"
                    },
                    "minHealthPercent": {
                      "format": "int32",
                      "type": "integer"
                    }
                  },
                  "additionalProperties": false
                },
                "tls": {
                  "description": "Istio TLS related settings for connections to the upstream service",
                  "type": "object",
                  "properties": {
                    "caCertificates": {
                      "format": "string",
                      "type": "string"
                    },
                    "clientCertificate": {
                      "description": "REQUIRED if mode is `MUTUAL`.",
                      "format": "string",
                      "type": "string"
                    },
                    "mode": {
                      "enum": [
                        "DISABLE",
                        "SIMPLE",
                        "MUTUAL",
                        "ISTIO_MUTUAL"
                      ],
                      "type": "string"
                    },
                    "privateKey": {
                      "description": "REQUIRED if mode is `MUTUAL`.",
                      "format": "string",
                      "type": "string"
                    },
                    "sni": {
                      "description": "SNI string to present to the server during TLS handshake.",
                      "format": "string",
                      "type": "string"
                    },
                    "subjectAltNames": {
                      "items": {
                        "format": "string",
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "apex": {
              "description": "Metadata to add to the apex service",
              "type": "object",
              "properties": {
                "labels": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "annotations": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": false
            },
            "primary": {
              "description": "Metadata to add to the primary service",
              "type": "object",
              "properties": {
                "labels": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "annotations": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": false
            },
            "canary": {
              "description": "Metadata to add to the canary service",
              "type": "object",
              "properties": {
                "labels": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                },
                "annotations": {
                  "type": "object",
                  "additionalProperties": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": false
            },
            "unmanagedMetadata": {
              "description": "UnmanagedMetadata is a list of metadata keys that should be ignored by Flagger.",
              "type": "object",
              "properties": {
                "annotations": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "labels": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "skipAnalysis": {
          "description": "Skip analysis and promote canary",
          "type": "boolean"
        },
        "revertOnDeletion": {
          "description": "Revert mutated resources to original spec on deletion",
          "type": "boolean"
        },
        "suspend": {
          "description": "Suspend Canary disabling/pausing all canary runs",
          "type": "boolean"
        },
        "analysis": {
          "description": "Canary analysis for this canary",
          "type": "object",
          "oneOf": [
            {
              "required": [
                "interval",
                "threshold",
                "iterations"
              ]
            },
            {
              "required": [
                "interval",
                "threshold",
                "stepWeight"
              ]
            },
            {
              "required": [
                "interval",
                "threshold",
                "stepWeights"
              ]
            }
          ],
          "properties": {
            "interval": {
              "description": "Schedule interval for this canary",
              "type": "string",
              "pattern": "^[0-9]+(m|s)"
            },
            "iterations": {
              "description": "Number of checks to run for A/B Testing and Blue/Green",
              "type": "number"
            },
            "threshold": {
              "description": "Max number of failed checks before rollback",
              "type": "number"
            },
            "maxWeight": {
              "description": "Max traffic weight routed to canary",
              "type": "number"
            },
            "stepWeight": {
              "description": "Incremental traffic step weight for the analysis phase",
              "type": "number"
            },
            "stepWeights": {
              "description": "Incremental traffic step weights for the analysis phase",
              "type": "array",
              "items": {
                "type": "number"
              }
            },
            "stepWeightPromotion": {
              "description": "Incremental traffic step weight for the promotion phase",
              "type": "number"
            },
            "mirror": {
              "description": "Mirror traffic to canary",
              "type": "boolean"
            },
            "mirrorWeight": {
              "description": "Weight of traffic to be mirrored",
              "type": "number"
            },
            "primaryReadyThreshold": {
              "description": "Percentage of pods that need to be available to consider primary as ready",
              "type": "number"
            },
            "canaryReadyThreshold": {
              "description": "Percentage of pods that need to be available to consider canary as ready",
              "type": "number"
            },
            "match": {
              "description": "A/B testing match conditions",
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "headers": {
                    "type": "object",
                    "additionalProperties": {
                      "oneOf": [
                        {
                          "required": [
                            "exact"
                          ]
                        },
                        {
                          "required": [
                            "prefix"
                          ]
                        },
                        {
                          "required": [
                            "suffix"
                          ]
                        },
                        {
                          "required": [
                            "regex"
                          ]
                        }
                      ],
                      "type": "object",
                      "properties": {
                        "exact": {
                          "format": "string",
                          "type": "string"
                        },
                        "prefix": {
                          "format": "string",
                          "type": "string"
                        },
                        "suffix": {
                          "format": "string",
                          "type": "string"
                        },
                        "regex": {
                          "description": "RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax)",
                          "format": "string",
                          "type": "string"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "queryParams": {
                    "description": "Query parameters for matching.",
                    "type": "object",
                    "additionalProperties": {
                      "oneOf": [
                        {
                          "not": {
                            "anyOf": [
                              {
                                "required": [
                                  "exact"
                                ]
                              },
                              {
                                "required": [
                                  "prefix"
                                ]
                              },
                              {
                                "required": [
                                  "regex"
                                ]
                              }
                            ]
                          }
                        },
                        {
                          "required": [
                            "exact"
                          ]
                        },
                        {
                          "required": [
                            "prefix"
                          ]
                        },
                        {
                          "required": [
                            "regex"
                          ]
                        }
                      ],
                      "properties": {
                        "exact": {
                          "type": "string"
                        },
                        "prefix": {
                          "type": "string"
                        },
                        "regex": {
                          "description": "RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax).",
                          "type": "string"
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    }
                  },
                  "sourceLabels": {
                    "description": "Applicable only when the 'mesh' gateway is included in the service.gateways list",
                    "type": "object",
                    "additionalProperties": {
                      "format": "string",
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "metrics": {
              "description": "Metric check list for this canary",
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "description": "Name of the metric",
                    "type": "string"
                  },
                  "interval": {
                    "description": "Interval of the query",
                    "type": "string",
                    "pattern": "^[0-9]+(m|s)"
                  },
                  "threshold": {
                    "description": "Max value accepted for this metric",
                    "type": "number"
                  },
                  "thresholdRange": {
                    "description": "Range accepted for this metric",
                    "type": "object",
                    "properties": {
                      "min": {
                        "description": "Min value accepted for this metric",
                        "type": "number"
                      },
                      "max": {
                        "description": "Max value accepted for this metric",
                        "type": "number"
                      }
                    },
                    "additionalProperties": false
                  },
                  "query": {
                    "description": "Prometheus query",
                    "type": "string"
                  },
                  "templateRef": {
                    "description": "Metric template reference",
                    "type": "object",
                    "required": [
                      "name"
                    ],
                    "properties": {
                      "name": {
                        "description": "Name of this metric template",
                        "type": "string"
                      },
                      "namespace": {
                        "description": "Namespace of this metric template",
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  },
                  "templateVariables": {
                    "description": "Additional variables to be used in the metrics query (key-value pairs)",
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "alerts": {
              "description": "Alert list for this canary analysis",
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "providerRef",
                  "name"
                ],
                "properties": {
                  "name": {
                    "description": "Name of the this alert",
                    "type": "string"
                  },
                  "severity": {
                    "description": "Severity level can be info, warn, error (default info)",
                    "type": "string",
                    "enum": [
                      "",
                      "info",
                      "warn",
                      "error"
                    ]
                  },
                  "providerRef": {
                    "description": "Alert provider reference",
                    "type": "object",
                    "required": [
                      "name"
                    ],
                    "properties": {
                      "name": {
                        "description": "Name of the alert provider",
                        "type": "string"
                      },
                      "namespace": {
                        "description": "Namespace of the alert provider",
                        "type": "string"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              }
            },
            "webhooks": {
              "description": "Webhook list for this canary",
              "type": "array",
              "items": {
                "type": "object",
                "required": [
                  "name",
                  "url"
                ],
                "properties": {
                  "name": {
                    "description": "Name of the webhook",
                    "type": "string"
                  },
                  "type": {
                    "description": "Type of the webhook pre, post or during rollout",
                    "type": "string",
                    "enum": [
                      "",
                      "confirm-rollout",
                      "pre-rollout",
                      "rollout",
                      "confirm-promotion",
                      "post-rollout",
                      "event",
                      "rollback",
                      "confirm-traffic-increase"
                    ]
                  },
                  "muteAlert": {
                    "description": "Mute all alerts for the webhook",
                    "type": "boolean"
                  },
                  "url": {
                    "description": "URL address of this webhook",
                    "type": "string",
                    "format": "url"
                  },
                  "timeout": {
                    "description": "Request timeout for this webhook",
                    "type": "string",
                    "pattern": "^[0-9]+(m|s)"
                  },
                  "retries": {
                    "description": "Number of retries for this webhook",
                    "type": "number"
                  },
                  "disableTLS": {
                    "description": "Disable TLS verification for this webhook",
                    "type": "boolean"
                  },
                  "metadata": {
                    "description": "Metadata (key-value pairs) for this webhook",
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": false
              }
            },
            "sessionAffinity": {
              "description": "SessionAffinity represents the session affinity settings for a canary run.",
              "type": "object",
              "required": [
                "cookieName"
              ],
              "properties": {
                "cookieName": {
                  "description": "CookieName is the key that will be used for the session affinity cookie.",
                  "type": "string"
                },
                "primaryCookieName": {
                  "description": "CookieName is the key that will be used for the session affinity cookie.",
                  "type": "string"
                },
                "domain": {
                  "description": "Domain defines the host to which the cookie will be sent.",
                  "type": "string"
                },
                "httpOnly": {
                  "description": "HttpOnly forbids JavaScript from accessing the cookie, for example, through the Document.cookie property.",
                  "type": "boolean"
                },
                "maxAge": {
                  "description": "MaxAge indicates the number of seconds until the session affinity cookie will expire.",
                  "default": 86400,
                  "type": "number"
                },
                "partitioned": {
                  "description": "Partitioned indicates that the cookie should be stored using partitioned storage.",
                  "type": "boolean"
                },
                "path": {
                  "description": "Path indicates the path that must exist in the requested URL for the browser to send the Cookie header.",
                  "type": "string"
                },
                "sameSite": {
                  "description": "SameSite controls whether or not a cookie is sent with cross-site requests.",
                  "type": "string",
                  "enum": [
                    "Strict",
                    "Lax",
                    "None"
                  ]
                },
                "secure": {
                  "description": "Secure indicates that the cookie is sent to the server only when a request is made with the https: scheme (except on localhost)",
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "status": {
      "description": "CanaryStatus defines the observed state of a canary.",
      "type": "object",
      "properties": {
        "phase": {
          "description": "Analysis phase of this canary",
          "type": "string",
          "enum": [
            "",
            "Initializing",
            "Initialized",
            "Waiting",
            "Progressing",
            "WaitingPromotion",
            "Promoting",
            "Finalising",
            "Succeeded",
            "Failed",
            "Terminating",
            "Terminated"
          ]
        },
        "failedChecks": {
          "description": "Failed check count of the current canary analysis",
          "type": "number"
        },
        "canaryWeight": {
          "description": "Traffic weight routed to canary",
          "type": "number"
        },
        "iterations": {
          "description": "Iteration count of the current canary analysis",
          "type": "number"
        },
        "trackedConfigs": {
          "description": "TrackedConfig of this canary",
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        "lastAppliedSpec": {
          "description": "LastAppliedSpec of this canary",
          "type": "string"
        },
        "lastPromotedSpec": {
          "description": "LastPromotedSpec of this canary",
          "type": "string"
        },
        "lastTransitionTime": {
          "description": "LastTransitionTime of this canary",
          "format": "date-time",
          "type": "string"
        },
        "sessionAffinityCookie": {
          "description": "Session affinity cookie of the current canary run",
          "type": "string"
        },
        "previousSessionAffinityCookie": {
          "description": "Session affinity cookie of the previous canary run",
          "type": "string"
        },
        "conditions": {
          "description": "Status conditions of this canary",
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "type",
              "status",
              "reason"
            ],
            "properties": {
              "lastTransitionTime": {
                "description": "LastTransitionTime of this condition",
                "format": "date-time",
                "type": "string"
              },
              "lastUpdateTime": {
                "description": "LastUpdateTime of this condition",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "Message associated with this condition",
                "type": "string"
              },
              "reason": {
                "description": "Reason for the current status of this condition",
                "type": "string"
              },
              "status": {
                "description": "Status of this condition",
                "type": "string"
              },
              "type": {
                "description": "Type of this condition",
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    }
  }
}
