{
  "$id": "https://json.schemastore.org/helmfile.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "repository": {
      "type": "object",
      "required": ["name"],
      "properties": {
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "certFile": {
          "type": "string"
        },
        "keyFile": {
          "type": "string"
        },
        "caFile": {
          "type": "string"
        },
        "username": {
          "type": "string"
        },
        "password": {
          "type": "string"
        },
        "oci": {
          "type": "boolean"
        },
        "passCredentials": {
          "type": "boolean"
        }
      }
    },
    "helmDefaults": {
      "type": "object",
      "description": "Default values to set for args along with dedicated keys that can be set by contributors, cli args take precedence over these.",
      "properties": {
        "tillerNamespace": {
          "type": "string"
        },
        "tillerless": {
          "type": "boolean"
        },
        "kubeContext": {
          "type": "string"
        },
        "cleanupOnFail": {
          "type": "boolean"
        },
        "args": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string"
              }
            ]
          }
        },
        "verify": {
          "type": "boolean"
        },
        "wait": {
          "type": "boolean"
        },
        "waitForJobs": {
          "type": "boolean"
        },
        "timeout": {
          "type": "number"
        },
        "recreatePods": {
          "type": "boolean"
        },
        "force": {
          "type": "boolean"
        },
        "tls": {
          "type": "boolean"
        },
        "tlsCACert": {
          "type": "string"
        },
        "tlsCert": {
          "type": "string"
        },
        "tlsKey": {
          "type": "string"
        },
        "historyMax": {
          "type": "number",
          "description": "limit the maximum number of revisions saved per release. Use 0 for no limit.",
          "default": 10
        },
        "createNamespace": {
          "type": "boolean"
        }
      }
    },
    "release": {
      "type": "object",
      "properties": {
        "atomic": {
          "type": "boolean"
        },
        "chart": {
          "type": "string"
        },
        "cleanupOnFail": {
          "type": "boolean",
          "default": false
        },
        "condition": {
          "type": "string"
        },
        "createNamespace": {
          "type": "boolean"
        },
        "devel": {
          "type": "boolean",
          "description": "if used with charts museum allows to pull unstable charts for deployment, for example: if 1.2.3 and 1.2.4-dev versions exist and set to true, 1.2.4-dev will be pulled (default false)",
          "default": false
        },
        "disableValidation": {
          "type": "boolean"
        },
        "disableValidationOnInstall": {
          "type": "boolean"
        },
        "disableOpenAPIValidation": {
          "type": "boolean"
        },
        "force": {
          "type": "boolean"
        },
        "historyMax": {
          "type": "number"
        },
        "hooks": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/hook"
          }
        },
        "installed": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string"
            },
            {
              "type": "object"
            }
          ]
        },
        "kubeContext": {
          "type": "string"
        },
        "labels": {
          "$ref": "#/definitions/map"
        },
        "missingFileHandler": {
          "type": "string",
          "$ref": "#/definitions/missingFileHandler"
        },
        "name": {
          "type": "string"
        },
        "namespace": {
          "type": "string",
          "examples": ["default"]
        },
        "recreatePods": {
          "type": "boolean"
        },
        "secrets": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "set": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "file": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "values": {
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "number"
                        }
                      ]
                    }
                  }
                }
              },
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                }
              }
            ]
          }
        },
        "skipDeps": {
          "type": "boolean",
          "description": "When set to `true`, skips running `helm dep up` and `helm dep build` on this release's chart.",
          "default": false
        },
        "tillerNamespace": {
          "type": "string"
        },
        "tillerless": {
          "type": "boolean"
        },
        "timeout": {
          "type": "number"
        },
        "tls": {
          "type": "boolean"
        },
        "tlsCACert": {
          "type": "string"
        },
        "tlsCert": {
          "type": "string"
        },
        "tlsKey": {
          "type": "string"
        },
        "values": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/definitions/map"
              }
            ]
          }
        },
        "verify": {
          "type": "boolean"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "integer"
            }
          ]
        },
        "wait": {
          "type": "boolean"
        },
        "waitForJobs": {
          "type": "boolean"
        }
      },
      "required": ["name", "chart"]
    },
    "helmfile": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "required": ["path"],
          "properties": {
            "path": {
              "type": "string"
            },
            "selectors": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  }
                ]
              }
            },
            "values": {
              "type": "array",
              "items": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "object",
                    "properties": {
                      "key1": {
                        "type": "string"
                      }
                    }
                  }
                ]
              }
            }
          }
        }
      ]
    },
    "missingFileHandler": {
      "type": "string",
      "enum": ["Error", "Warn", "Info", "Debug"]
    },
    "environment": {
      "type": "object",
      "properties": {
        "values": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/definitions/map"
              }
            ]
          }
        },
        "secrets": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "missingFileHandler": {
          "$ref": "#/definitions/missingFileHandler"
        },
        "kubeContext": {
          "type": "string"
        }
      }
    },
    "hook": {
      "type": "object",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "showlogs": {
          "type": "boolean"
        },
        "command": {
          "type": "string"
        },
        "args": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ]
          }
        }
      }
    },
    "map": {
      "type": "object",
      "patternProperties": {
        "[a-zA-Z\\d_-]+": {
          "anyOf": [
            {
              "type": "object"
            },
            {
              "type": "boolean"
            },
            {
              "type": "string"
            },
            {
              "type": "array"
            },
            {
              "type": "null"
            },
            {
              "type": "integer"
            }
          ]
        }
      }
    }
  },
  "properties": {
    "apiVersions": {
      "type": "array",
      "description": "Configure a fixed list of API versions to pass to 'helm template' via the --api-versions flag with the below:",
      "items": {
        "type": "string",
        "examples": ["example/v1"]
      }
    },
    "bases": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "type": "string"
          }
        ]
      }
    },
    "environments": {
      "type": "object",
      "description": "The list of environments managed by helmfile.",
      "default": {
        "default": {}
      },
      "examples": [
        {
          "default": {
            "values": []
          }
        }
      ],
      "patternProperties": {
        "[a-zA-Z\\d_-]+": {
          "$ref": "#/definitions/environment"
        }
      }
    },
    "commonLabels": {
      "type": "object",
      "description": "these labels will be applied to all releases in a Helmfile. Useful in templating if you have a helmfile per environment or customer and don't want to copy the same label to each release",
      "$ref": "#/definitions/map"
    },
    "helmBinary": {
      "type": "string",
      "description": "Path to alternative helm binary (--helm-binary)",
      "examples": ["path/to/helm3"]
    },
    "helmDefaults": {
      "$ref": "#/definitions/helmDefaults"
    },
    "helmfiles": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/helmfile"
      }
    },
    "hooks": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/hook"
      }
    },
    "missingFileHandler": {
      "$ref": "#/definitions/missingFileHandler"
    },
    "releases": {
      "type": "array",
      "description": "Helmfile runs various helm commands to converge the current state in the live cluster to the desired state defined here.",
      "items": {
        "$ref": "#/definitions/release"
      }
    },
    "repositories": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/repository"
      }
    }
  },
  "title": "Helmfile config schema"
}