{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "properties": {
    "apiVersion": {
      "type": "string"
    },
    "kind": {
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "properties": {
        "recommenders": {
          "items": {
            "properties": {
              "name": {
                "type": "string"
              }
            },
            "required": [
              "name"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "resourcePolicy": {
          "properties": {
            "containerPolicies": {
              "items": {
                "properties": {
                  "containerName": {
                    "type": "string"
                  },
                  "controlledResources": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "controlledValues": {
                    "enum": [
                      "RequestsAndLimits",
                      "RequestsOnly"
                    ],
                    "type": "string"
                  },
                  "maxAllowed": {
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                      "x-kubernetes-int-or-string": true
                    },
                    "type": "object"
                  },
                  "memoryAggregationIntervalCount": {
                    "format": "int64",
                    "minimum": 1,
                    "type": "integer"
                  },
                  "memoryAggregationIntervalSeconds": {
                    "format": "int32",
                    "minimum": 1,
                    "type": "integer"
                  },
                  "minAllowed": {
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                      "x-kubernetes-int-or-string": true
                    },
                    "type": "object"
                  },
                  "mode": {
                    "enum": [
                      "Auto",
                      "Off"
                    ],
                    "type": "string"
                  },
                  "oomBumpUpRatio": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                    "x-kubernetes-int-or-string": true
                  },
                  "oomMinBumpUp": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "string"
                      }
                    ],
                    "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                    "x-kubernetes-int-or-string": true
                  },
                  "startupBoost": {
                    "properties": {
                      "cpu": {
                        "properties": {
                          "durationSeconds": {
                            "format": "int32",
                            "type": "integer"
                          },
                          "factor": {
                            "format": "int32",
                            "type": "integer"
                          },
                          "quantity": {
                            "anyOf": [
                              {
                                "type": "integer"
                              },
                              {
                                "type": "string"
                              }
                            ],
                            "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                            "x-kubernetes-int-or-string": true
                          },
                          "type": {
                            "enum": [
                              "Factor",
                              "Quantity"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "type"
                        ],
                        "type": "object",
                        "x-kubernetes-validations": [
                          {
                            "message": "factor is required when type is Factor and forbidden otherwise",
                            "rule": "(self.type == 'Factor') == has(self.factor)"
                          },
                          {
                            "message": "quantity is required when type is Quantity and forbidden otherwise",
                            "rule": "(self.type == 'Quantity') == has(self.quantity)"
                          }
                        ]
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              },
              "type": "array"
            }
          },
          "type": "object"
        },
        "startupBoost": {
          "properties": {
            "cpu": {
              "properties": {
                "durationSeconds": {
                  "format": "int32",
                  "type": "integer"
                },
                "factor": {
                  "format": "int32",
                  "type": "integer"
                },
                "quantity": {
                  "anyOf": [
                    {
                      "type": "integer"
                    },
                    {
                      "type": "string"
                    }
                  ],
                  "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                  "x-kubernetes-int-or-string": true
                },
                "type": {
                  "enum": [
                    "Factor",
                    "Quantity"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "type"
              ],
              "type": "object",
              "x-kubernetes-validations": [
                {
                  "message": "factor is required when type is Factor and forbidden otherwise",
                  "rule": "(self.type == 'Factor') == has(self.factor)"
                },
                {
                  "message": "quantity is required when type is Quantity and forbidden otherwise",
                  "rule": "(self.type == 'Quantity') == has(self.quantity)"
                }
              ]
            }
          },
          "type": "object"
        },
        "targetRef": {
          "properties": {
            "apiVersion": {
              "type": "string"
            },
            "kind": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "kind",
            "name"
          ],
          "type": "object",
          "x-kubernetes-map-type": "atomic"
        },
        "updatePolicy": {
          "properties": {
            "evictAfterOOMSeconds": {
              "format": "int32",
              "minimum": 1,
              "type": "integer"
            },
            "evictionRequirements": {
              "items": {
                "properties": {
                  "changeRequirement": {
                    "enum": [
                      "TargetHigherThanRequests",
                      "TargetLowerThanRequests"
                    ],
                    "type": "string"
                  },
                  "resources": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  }
                },
                "required": [
                  "changeRequirement",
                  "resources"
                ],
                "type": "object"
              },
              "type": "array"
            },
            "minReplicas": {
              "format": "int32",
              "type": "integer"
            },
            "updateMode": {
              "enum": [
                "Off",
                "Initial",
                "Recreate",
                "InPlaceOrRecreate",
                "InPlace",
                "Auto"
              ],
              "type": "string"
            }
          },
          "type": "object"
        }
      },
      "required": [
        "targetRef"
      ],
      "type": "object"
    },
    "status": {
      "properties": {
        "conditions": {
          "items": {
            "properties": {
              "lastTransitionTime": {
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "observedGeneration": {
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "reason": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "status",
              "type"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "observedGeneration": {
          "format": "int64",
          "minimum": 0,
          "type": "integer"
        },
        "recommendation": {
          "properties": {
            "containerRecommendations": {
              "items": {
                "properties": {
                  "containerName": {
                    "type": "string"
                  },
                  "lowerBound": {
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                      "x-kubernetes-int-or-string": true
                    },
                    "type": "object"
                  },
                  "target": {
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                      "x-kubernetes-int-or-string": true
                    },
                    "type": "object"
                  },
                  "uncappedTarget": {
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                      "x-kubernetes-int-or-string": true
                    },
                    "type": "object"
                  },
                  "upperBound": {
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "integer"
                        },
                        {
                          "type": "string"
                        }
                      ],
                      "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                      "x-kubernetes-int-or-string": true
                    },
                    "type": "object"
                  }
                },
                "required": [
                  "target"
                ],
                "type": "object"
              },
              "type": "array"
            }
          },
          "type": "object"
        }
      },
      "type": "object"
    }
  },
  "required": [
    "spec"
  ],
  "type": "object"
}
