{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/helmfile/latest.json",
  "title": "Helmfile config schema",
  "x-lintel": {
    "source": "https://www.schemastore.org/helmfile.json",
    "sourceSha256": "b759031a0990207393d6ce6261475f6dca229591787c76a70468cead528bebe5",
    "fileMatch": [
      "helmfile.yaml",
      "**/helmfile.d/**/*.yaml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "apiVersions": {
      "type": "array",
      "description": "Configure a fixed list of API versions to pass to 'helm template' via the `--api-versions` flag.",
      "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-Z0-9_-]+": {
          "$ref": "#/$defs/environment"
        }
      }
    },
    "commonLabels": {
      "$ref": "#/$defs/map",
      "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"
    },
    "helmBinary": {
      "type": "string",
      "description": "Path to alternative helm binary (--helm-binary)",
      "examples": [
        "path/to/helm3"
      ]
    },
    "helmDefaults": {
      "$ref": "#/$defs/helmDefaults"
    },
    "helmfiles": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/helmfile"
      }
    },
    "hooks": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/hook"
      }
    },
    "missingFileHandler": {
      "$ref": "#/$defs/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": "#/$defs/release"
      }
    },
    "repositories": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/repository"
      }
    }
  },
  "$defs": {
    "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": {
        "kubeContext": {
          "type": "string",
          "description": "Dedicated default key for kube-context (--kube-context)."
        },
        "cleanupOnFail": {
          "type": "boolean",
          "description": "When true, cleans up any new resources created during a failed release.",
          "default": false
        },
        "args": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string"
              }
            ]
          }
        },
        "verify": {
          "type": "boolean",
          "description": "Verify the chart before upgrading (only works with packaged charts not directories).",
          "default": false
        },
        "wait": {
          "type": "boolean",
          "description": "Wait for k8s resources via --wait.",
          "default": false
        },
        "waitForJobs": {
          "type": "boolean",
          "description": "If true and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. It will wait for as long as --timeout",
          "default": false
        },
        "timeout": {
          "type": "number",
          "description": "Time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks, and waits on pod/pvc/svc/deployment readiness)",
          "default": 300
        },
        "recreatePods": {
          "type": "boolean",
          "description": "Performs pods restart for the resource if applicable.",
          "default": false
        },
        "force": {
          "type": "boolean",
          "description": "Forces resource update through delete/recreate if needed.",
          "default": false
        },
        "historyMax": {
          "type": "number",
          "description": "Limit the maximum number of revisions saved per release. Use 0 for no limit.",
          "default": 10
        },
        "createNamespace": {
          "type": "boolean",
          "description": "When using helm 3.2+, automatically create release namespaces if they do not exist.",
          "default": true
        },
        "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
        },
        "reuseValues": {
          "type": "boolean",
          "description": "If set to true, reuses the last release's values and merges them with ones provided in helmfile.",
          "default": false
        },
        "skipDeps": {
          "description": "When set to `true`, skips running `helm dep up` and `helm dep build` on this release's chart.",
          "type": "boolean",
          "default": false
        },
        "cascade": {
          "type": "string",
          "description": "Cascade `--cascade` to helmv3 delete, available values: background, foreground, or orphan.",
          "default": "background",
          "enum": [
            "background",
            "foreground",
            "orphan"
          ]
        },
        "postRenderer": {
          "type": "string",
          "description": "Propagate `--post-renderer` to helmv3 template and helm install.",
          "examples": [
            "path/to/postRenderer"
          ]
        },
        "insecureSkipTLSVerify": {
          "type": "boolean",
          "description": "Is true if the TLS verification should be skipped when fetching remote chart.",
          "default": false
        }
      }
    },
    "release": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the release."
        },
        "namespace": {
          "type": "string",
          "description": "The namespace to install the release into."
        },
        "chart": {
          "description": "The chart name to be installed. The chart name can be either: 1) a chart reference: <https://helm.sh/docs/topics/charts/#chart-references>, 2) a path to a directory containing a chart, 3) a path to a packaged chart, or 4) a URL.",
          "type": "string"
        },
        "atomic": {
          "type": "boolean",
          "description": "Restores previous state in case of failed release.",
          "default": false
        },
        "cleanupOnFail": {
          "type": "boolean",
          "description": "When true, cleans up any new resources created during a failed release.",
          "default": false
        },
        "kubeContext": {
          "type": "string",
          "description": "--kube-context to be passed to helm commands.\nDefaults tp an empty string, which means the standard kubeconfig, either ~/kubeconfig or the file pointed by $KUBECONFIG environment variable)",
          "default": ""
        },
        "condition": {
          "type": "string",
          "description": "Wen set, helmfile will only attempt to install the release if the condition is true"
        },
        "createNamespace": {
          "type": "boolean",
          "description": "When using helm 3.2+, automatically create release namespaces if they do not exist.",
          "default": true
        },
        "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
        },
        "disableValidation": {
          "description": "Disables validation of the rendered templates before releasing.",
          "type": "boolean",
          "default": false
        },
        "disableValidationOnInstall": {
          "type": "boolean",
          "description": "Passes --disable-validation to helm 3 diff plugin, this requires diff plugin >= 3.1.2",
          "default": false
        },
        "disableOpenAPIValidation": {
          "type": "boolean",
          "description": "Passes --disable-openapi-validation to helm 3 diff plugin, this requires diff plugin >= 3.1.2",
          "default": false
        },
        "historyMax": {
          "type": "number",
          "description": "Limit the maximum number of revisions saved per release. Use 0 for no limit.",
          "default": 10
        },
        "skipDeps": {
          "description": "When set to `true`, skips running `helm dep up` and `helm dep build` on this release's chart.",
          "type": "boolean",
          "default": false
        },
        "cascade": {
          "type": "string",
          "description": "Cascade `--cascade` to helmv3 delete, available values: background, foreground, or orphan",
          "default": "background",
          "enum": [
            "background",
            "foreground",
            "orphan"
          ]
        },
        "postRenderer": {
          "type": "string",
          "description": "Propagate `--post-renderer` to helmv3 template and helm install.",
          "examples": [
            "path/to/postRenderer"
          ]
        },
        "insecureSkipTLSVerify": {
          "type": "boolean",
          "description": "Is true if the TLS verification should be skipped when fetching remote chart",
          "default": false
        },
        "hooks": {
          "description": "Hooks allow to trigger actions at certain points in helm's lifecycle.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/hook"
          }
        },
        "installed": {
          "description": "Set `false` to uninstall this release on sync.",
          "default": true,
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "string"
            },
            {
              "type": "object"
            }
          ]
        },
        "labels": {
          "$ref": "#/$defs/map"
        },
        "missingFileHandler": {
          "$ref": "#/$defs/missingFileHandler",
          "type": "string"
        },
        "secrets": {
          "type": "array",
          "description": "Will attempt to decrypt it using helm-secrets plugin",
          "items": {
            "type": "string"
          }
        },
        "inherit": {
          "type": "array",
          "description": "Inherit from one or more release templates",
          "items": {
            "type": "object",
            "properties": {
              "template": {
                "type": "string"
              },
              "except": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": [
              "template"
            ]
          }
        },
        "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"
                  }
                }
              }
            ]
          }
        },
        "timeout": {
          "type": "number",
          "description": "Time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks, and waits on pod/pvc/svc/deployment readiness)",
          "default": 300
        },
        "recreatePods": {
          "type": "boolean",
          "description": "Performs pods restart for the resource if applicable",
          "default": false
        },
        "force": {
          "type": "boolean",
          "description": "Forces resource update through delete/recreate if needed.",
          "default": false
        },
        "values": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "$ref": "#/$defs/map"
              }
            ]
          }
        },
        "verify": {
          "type": "boolean"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "integer"
            }
          ]
        },
        "wait": {
          "type": "boolean",
          "description": "Wait for k8s resources via --wait.",
          "default": false
        },
        "waitForJobs": {
          "type": "boolean",
          "description": "If set and --wait enabled, will wait until all Jobs have been completed before marking the release as successful. It will wait for as long as --timeout.",
          "default": false
        },
        "needs": {
          "type": "array",
          "description": "Define dependencies between releases. This release will only be installed after all releases in the needs list are installed.",
          "items": {
            "type": "string"
          }
        },
        "dependencies": {
          "type": "array",
          "description": "Add chart dependencies without forking. Can be local paths or OCI charts.",
          "items": {
            "type": "object",
            "properties": {
              "chart": {
                "type": "string"
              },
              "version": {
                "type": "string"
              },
              "alias": {
                "type": "string"
              }
            },
            "required": [
              "chart"
            ]
          }
        },
        "strategicMergePatches": {
          "type": "array",
          "description": "Apply strategic merge patches to Kubernetes resources using Kustomize.",
          "items": {
            "type": "string"
          }
        },
        "transformers": {
          "type": "array",
          "description": "Apply Kustomize transformers to add labels, annotations, etc.",
          "items": {
            "type": "string"
          }
        },
        "jsonPatches": {
          "type": "array",
          "description": "Apply JSON patches to Kubernetes resources.",
          "items": {
            "type": "object"
          }
        },
        "adopt": {
          "type": "array",
          "description": "Adopt existing resources into Helm management.",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "name"
      ],
      "anyOf": [
        {
          "required": [
            "chart"
          ]
        },
        {
          "required": [
            "inherit"
          ]
        }
      ]
    },
    "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": "#/$defs/map"
              }
            ]
          }
        },
        "secrets": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "missingFileHandler": {
          "$ref": "#/$defs/missingFileHandler"
        },
        "kubeContext": {
          "type": "string"
        }
      }
    },
    "hook": {
      "type": "object",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "prepare",
              "preapply",
              "presync",
              "preuninstall",
              "postuninstall",
              "postsync",
              "cleanup"
            ]
          }
        },
        "showlogs": {
          "type": "boolean"
        },
        "command": {
          "type": "string"
        },
        "args": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "string"
              }
            ]
          }
        }
      }
    },
    "map": {
      "type": "object",
      "patternProperties": {
        "[a-zA-Z0-9_-]+": {
          "anyOf": [
            {
              "type": "object"
            },
            {
              "type": "boolean"
            },
            {
              "type": "string"
            },
            {
              "type": "array"
            },
            {
              "type": "null"
            },
            {
              "type": "integer"
            }
          ]
        }
      }
    }
  }
}
