Last active
February 25, 2026 03:52
-
-
Save kjanat/556796a0a363a338ee9453a2613cfd53 to your computer and use it in GitHub Desktop.
Schema for ArgoCD Application Custom Resource Definition (BEWARE, AI GENERATED!!! Comment below if issues identified!) Based on: https://github.com/argoproj/argo-cd/blob/f5eaae7/docs/operator-manual/application.yaml. Refer to it using: https://gist.githubusercontent.com/kjanat/556796a0a363a338ee9453a2613cfd53/raw/argocd-application-schema.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "$schema": "http://json-schema.org/draft-07/schema#", | |
| "title": "ArgoCD Application", | |
| "description": "Schema for ArgoCD Application Custom Resource Definition", | |
| "type": "object", | |
| "required": ["apiVersion", "kind", "metadata", "spec"], | |
| "properties": { | |
| "apiVersion": { | |
| "type": "string", | |
| "const": "argoproj.io/v1alpha1", | |
| "description": "API version for ArgoCD Application" | |
| }, | |
| "kind": { | |
| "type": "string", | |
| "const": "Application", | |
| "description": "Resource kind" | |
| }, | |
| "metadata": { | |
| "type": "object", | |
| "required": ["name"], | |
| "properties": { | |
| "name": { "type": "string", "description": "Name of the application" }, | |
| "namespace": { | |
| "type": "string", | |
| "description": "Namespace for the application resource (usually argocd)" | |
| }, | |
| "finalizers": { | |
| "type": "array", | |
| "description": "Finalizers for cascade deletion behavior", | |
| "items": { | |
| "type": "string", | |
| "enum": [ | |
| "resources-finalizer.argocd.argoproj.io", | |
| "resources-finalizer.argocd.argoproj.io/background" | |
| ] | |
| } | |
| }, | |
| "labels": { | |
| "type": "object", | |
| "description": "Labels to apply to the application", | |
| "additionalProperties": { "type": "string" } | |
| }, | |
| "annotations": { | |
| "type": "object", | |
| "description": "Annotations to apply to the application", | |
| "additionalProperties": { "type": "string" } | |
| } | |
| } | |
| }, | |
| "spec": { | |
| "type": "object", | |
| "required": ["destination"], | |
| "properties": { | |
| "project": { | |
| "type": "string", | |
| "description": "The project the application belongs to", | |
| "default": "default" | |
| }, | |
| "source": { | |
| "$ref": "#/$defs/ApplicationSource", | |
| "description": "Source of the application manifests (single source)" | |
| }, | |
| "sources": { | |
| "type": "array", | |
| "description": "Multiple sources for the application (multi-source apps)", | |
| "items": { "$ref": "#/$defs/ApplicationSource" } | |
| }, | |
| "destination": { | |
| "type": "object", | |
| "description": "Destination cluster and namespace to deploy the application", | |
| "properties": { | |
| "server": { "type": "string", "description": "Cluster API URL" }, | |
| "name": { | |
| "type": "string", | |
| "description": "Cluster name (alternative to server)" | |
| }, | |
| "namespace": { | |
| "type": "string", | |
| "description": "Target namespace for deployment" | |
| } | |
| } | |
| }, | |
| "info": { | |
| "type": "array", | |
| "description": "Extra information to show in the Argo CD Application details tab", | |
| "items": { | |
| "type": "object", | |
| "required": ["name", "value"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "value": { "type": "string" } | |
| } | |
| } | |
| }, | |
| "syncPolicy": { | |
| "type": "object", | |
| "description": "Sync policy configuration", | |
| "properties": { | |
| "automated": { | |
| "type": "object", | |
| "description": "Automated sync configuration. Presence of this object enables automated syncing.", | |
| "properties": { | |
| "enabled": { | |
| "type": "boolean", | |
| "description": "Explicitly enable or disable automated syncing (overrides presence of automated block)" | |
| }, | |
| "prune": { | |
| "type": "boolean", | |
| "description": "Specifies if resources should be pruned during auto-syncing", | |
| "default": false | |
| }, | |
| "selfHeal": { | |
| "type": "boolean", | |
| "description": "Specifies if partial app sync should be executed when resources are changed only in target cluster", | |
| "default": false | |
| }, | |
| "allowEmpty": { | |
| "type": "boolean", | |
| "description": "Allows deleting all application resources during automatic syncing", | |
| "default": false | |
| } | |
| } | |
| }, | |
| "syncOptions": { | |
| "type": "array", | |
| "description": "Sync options which modify sync behavior", | |
| "items": { | |
| "type": "string", | |
| "examples": [ | |
| "Validate=false", | |
| "CreateNamespace=true", | |
| "PrunePropagationPolicy=foreground", | |
| "PruneLast=true", | |
| "RespectIgnoreDifferences=true", | |
| "ApplyOutOfSyncOnly=true", | |
| "SkipDryRunOnMissingResource=true", | |
| "Replace=true", | |
| "ServerSideApply=true", | |
| "FailOnSharedResource=true", | |
| "Force=true", | |
| "Delete=false", | |
| "Prune=confirm", | |
| "Delete=confirm", | |
| "ClientSideApplyMigration=false" | |
| ] | |
| } | |
| }, | |
| "managedNamespaceMetadata": { | |
| "type": "object", | |
| "description": "Sets the metadata for the application namespace (only valid if CreateNamespace=true)", | |
| "properties": { | |
| "labels": { | |
| "type": "object", | |
| "description": "Labels to set on the application namespace", | |
| "additionalProperties": { "type": "string" } | |
| }, | |
| "annotations": { | |
| "type": "object", | |
| "description": "Annotations to set on the application namespace", | |
| "additionalProperties": { "type": "string" } | |
| } | |
| } | |
| }, | |
| "retry": { | |
| "type": "object", | |
| "description": "Retry configuration for failed syncs", | |
| "properties": { | |
| "limit": { | |
| "type": "integer", | |
| "description": "Number of failed sync attempt retries; unlimited if less than 0" | |
| }, | |
| "backoff": { | |
| "type": "object", | |
| "properties": { | |
| "duration": { | |
| "type": "string", | |
| "description": "The amount to back off (e.g., '5s', '2m', '1h')", | |
| "default": "5s" | |
| }, | |
| "factor": { | |
| "type": "integer", | |
| "description": "A factor to multiply the base duration after each failed retry" | |
| }, | |
| "maxDuration": { | |
| "type": "string", | |
| "description": "The maximum amount of time allowed for the backoff strategy", | |
| "default": "3m" | |
| } | |
| } | |
| }, | |
| "refresh": { | |
| "type": "boolean", | |
| "description": "If true, use the latest revision on retry instead of the initial one", | |
| "default": false | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "ignoreDifferences": { | |
| "type": "array", | |
| "description": "Configurations to ignore differences between live and desired states", | |
| "items": { | |
| "type": "object", | |
| "required": ["kind"], | |
| "properties": { | |
| "group": { | |
| "type": "string", | |
| "description": "Kubernetes API group" | |
| }, | |
| "kind": { | |
| "type": "string", | |
| "description": "Kubernetes resource kind" | |
| }, | |
| "name": { | |
| "type": "string", | |
| "description": "Resource name (optional, must match exactly if specified)" | |
| }, | |
| "namespace": { | |
| "type": "string", | |
| "description": "Resource namespace (optional, must match exactly if specified)" | |
| }, | |
| "jsonPointers": { | |
| "type": "array", | |
| "description": "JSON pointers to ignore", | |
| "items": { "type": "string" } | |
| }, | |
| "jqPathExpressions": { | |
| "type": "array", | |
| "description": "JQ path expressions to ignore", | |
| "items": { "type": "string" } | |
| }, | |
| "managedFieldsManagers": { | |
| "type": "array", | |
| "description": "Managed fields managers to ignore", | |
| "items": { "type": "string" } | |
| } | |
| } | |
| } | |
| }, | |
| "revisionHistoryLimit": { | |
| "type": "integer", | |
| "description": "Limits the number of items kept in the application's revision history", | |
| "default": 10 | |
| }, | |
| "sourceHydrator": { | |
| "$ref": "#/$defs/SourceHydrator", | |
| "description": "Provides a way to push hydrated manifests back to git before syncing them to the cluster" | |
| } | |
| } | |
| } | |
| }, | |
| "$defs": { | |
| "ApplicationSource": { | |
| "type": "object", | |
| "required": ["repoURL"], | |
| "properties": { | |
| "repoURL": { | |
| "type": "string", | |
| "description": "Repository URL (can point to either a Helm chart repo or a git repo)" | |
| }, | |
| "targetRevision": { | |
| "type": "string", | |
| "description": "Target revision (branch, tag, commit SHA). For Helm, this refers to the chart version" | |
| }, | |
| "path": { | |
| "type": "string", | |
| "description": "Path within the repository (no meaning for Helm charts pulled directly from a Helm repo)" | |
| }, | |
| "chart": { | |
| "type": "string", | |
| "description": "Helm chart name (set this when pulling directly from a Helm repo)" | |
| }, | |
| "ref": { | |
| "type": "string", | |
| "description": "Reference name for this source (used in multi-source apps)" | |
| }, | |
| "name": { | |
| "type": "string", | |
| "description": "Optional source name (can be used instead of position in multi-source apps)" | |
| }, | |
| "helm": { "$ref": "#/$defs/HelmConfig" }, | |
| "kustomize": { "$ref": "#/$defs/KustomizeConfig" }, | |
| "directory": { "$ref": "#/$defs/DirectoryConfig" }, | |
| "plugin": { "$ref": "#/$defs/PluginConfig" } | |
| } | |
| }, | |
| "HelmConfig": { | |
| "type": "object", | |
| "description": "Helm-specific configuration", | |
| "properties": { | |
| "passCredentials": { | |
| "type": "boolean", | |
| "description": "If true, adds --pass-credentials to Helm commands", | |
| "default": false | |
| }, | |
| "parameters": { | |
| "type": "array", | |
| "description": "Extra parameters to set (same as values.yaml, but these take precedence)", | |
| "items": { | |
| "type": "object", | |
| "required": ["name"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "value": { "type": "string" }, | |
| "forceString": { | |
| "type": "boolean", | |
| "description": "Ensures that value is treated as a string" | |
| } | |
| } | |
| } | |
| }, | |
| "fileParameters": { | |
| "type": "array", | |
| "description": "Use the contents of files as parameters (uses Helm's --set-file)", | |
| "items": { | |
| "type": "object", | |
| "required": ["name", "path"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "path": { "type": "string" } | |
| } | |
| } | |
| }, | |
| "releaseName": { | |
| "type": "string", | |
| "description": "Helm release name (defaults to application name)" | |
| }, | |
| "valueFiles": { | |
| "type": "array", | |
| "description": "Helm values files for overriding values", | |
| "items": { "type": "string" } | |
| }, | |
| "ignoreMissingValueFiles": { | |
| "type": "boolean", | |
| "description": "Ignore locally missing valueFiles when installing Helm chart", | |
| "default": false | |
| }, | |
| "values": { | |
| "type": "string", | |
| "description": "Values file as block text (prefer valuesObject if possible)" | |
| }, | |
| "valuesObject": { | |
| "type": "object", | |
| "description": "Values as object (takes precedence over values)", | |
| "additionalProperties": true | |
| }, | |
| "skipCrds": { | |
| "type": "boolean", | |
| "description": "Skip custom resource definition installation (--skip-crds)", | |
| "default": false | |
| }, | |
| "skipTests": { | |
| "type": "boolean", | |
| "description": "Skip test manifest installation step (--skip-tests)", | |
| "default": false | |
| }, | |
| "skipSchemaValidation": { | |
| "type": "boolean", | |
| "description": "Skip JSON schema validation (--skip-schema-validation)", | |
| "default": false | |
| }, | |
| "version": { | |
| "type": "string", | |
| "description": "Helm version to use for templating (e.g. \"3\")" | |
| }, | |
| "kubeVersion": { | |
| "type": "string", | |
| "description": "Kubernetes API version to pass to Helm (semver format, no 'v' prefix)" | |
| }, | |
| "apiVersions": { | |
| "type": "array", | |
| "description": "Kubernetes resource API versions to pass to Helm (format: [group/]version/kind)", | |
| "items": { "type": "string" } | |
| }, | |
| "namespace": { | |
| "type": "string", | |
| "description": "Optional namespace to template with" | |
| } | |
| } | |
| }, | |
| "KustomizeConfig": { | |
| "type": "object", | |
| "description": "Kustomize-specific configuration", | |
| "properties": { | |
| "version": { | |
| "type": "string", | |
| "description": "Optional kustomize version" | |
| }, | |
| "namePrefix": { | |
| "type": "string", | |
| "description": "Prefix to add to all resource names" | |
| }, | |
| "nameSuffix": { | |
| "type": "string", | |
| "description": "Suffix to add to all resource names" | |
| }, | |
| "commonLabels": { | |
| "type": "object", | |
| "description": "Common labels to add to all resources", | |
| "additionalProperties": { "type": "string" } | |
| }, | |
| "commonAnnotations": { | |
| "type": "object", | |
| "description": "Common annotations to add to all resources", | |
| "additionalProperties": { "type": "string" } | |
| }, | |
| "commonAnnotationsEnvsubst": { | |
| "type": "boolean", | |
| "description": "Enable environment variable substitution in commonAnnotations", | |
| "default": false | |
| }, | |
| "labelWithoutSelector": { | |
| "type": "boolean", | |
| "description": "If true, common labels should not be applied to resource selectors", | |
| "default": false | |
| }, | |
| "labelIncludeTemplates": { | |
| "type": "boolean", | |
| "description": "If true, common labels should be applied to resource templates", | |
| "default": false | |
| }, | |
| "forceCommonLabels": { "type": "boolean", "default": false }, | |
| "forceCommonAnnotations": { "type": "boolean", "default": false }, | |
| "images": { | |
| "type": "array", | |
| "description": "Image transformers", | |
| "items": { "type": "string" } | |
| }, | |
| "namespace": { | |
| "type": "string", | |
| "description": "Namespace to set for all resources" | |
| }, | |
| "replicas": { | |
| "type": "array", | |
| "description": "Replica count overrides", | |
| "items": { | |
| "type": "object", | |
| "required": ["name", "count"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "count": { | |
| "oneOf": [ | |
| { "type": "integer" }, | |
| { "type": "string" } | |
| ], | |
| "description": "Number of replicas (integer or string)" | |
| } | |
| } | |
| } | |
| }, | |
| "components": { | |
| "type": "array", | |
| "description": "Kustomize components to include", | |
| "items": { "type": "string" } | |
| }, | |
| "ignoreMissingComponents": { | |
| "type": "boolean", | |
| "description": "Ignore locally missing component directories", | |
| "default": false | |
| }, | |
| "patches": { | |
| "type": "array", | |
| "description": "Strategic merge patches and JSON patches", | |
| "items": { | |
| "type": "object", | |
| "properties": { | |
| "target": { | |
| "type": "object", | |
| "properties": { | |
| "kind": { "type": "string" }, | |
| "name": { "type": "string" }, | |
| "namespace": { "type": "string" }, | |
| "group": { "type": "string" }, | |
| "version": { "type": "string" }, | |
| "annotationSelector": { | |
| "type": "string", | |
| "description": "Annotation selector to filter target resources" | |
| }, | |
| "labelSelector": { | |
| "type": "string", | |
| "description": "Label selector to filter target resources" | |
| } | |
| } | |
| }, | |
| "patch": { | |
| "type": "string", | |
| "description": "Patch content (YAML or JSON)" | |
| }, | |
| "path": { "type": "string", "description": "Path to patch file" }, | |
| "options": { | |
| "type": "object", | |
| "description": "Patch options (e.g. allowNameChange, allowKindChange)", | |
| "additionalProperties": { "type": "boolean" } | |
| } | |
| } | |
| } | |
| }, | |
| "kubeVersion": { | |
| "type": "string", | |
| "description": "Kubernetes API version to use (semver format, no 'v' prefix)" | |
| }, | |
| "apiVersions": { | |
| "type": "array", | |
| "description": "Kubernetes resource API versions (format: [group/]version/kind)", | |
| "items": { "type": "string" } | |
| } | |
| } | |
| }, | |
| "DirectoryConfig": { | |
| "type": "object", | |
| "description": "Directory-specific configuration", | |
| "properties": { | |
| "recurse": { | |
| "type": "boolean", | |
| "description": "Recurse into subdirectories", | |
| "default": false | |
| }, | |
| "jsonnet": { | |
| "type": "object", | |
| "description": "Jsonnet configuration", | |
| "properties": { | |
| "extVars": { | |
| "type": "array", | |
| "description": "List of Jsonnet External Variables", | |
| "items": { | |
| "type": "object", | |
| "required": ["name", "value"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "value": { "type": "string" }, | |
| "code": { | |
| "type": "boolean", | |
| "description": "If true, value is Jsonnet code; otherwise it's a string", | |
| "default": false | |
| } | |
| } | |
| } | |
| }, | |
| "tlas": { | |
| "type": "array", | |
| "description": "List of Jsonnet Top-level Arguments", | |
| "items": { | |
| "type": "object", | |
| "required": ["name", "value"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "value": { "type": "string" }, | |
| "code": { "type": "boolean", "default": false } | |
| } | |
| } | |
| }, | |
| "libs": { | |
| "type": "array", | |
| "description": "Additional Jsonnet library search directories", | |
| "items": { "type": "string" } | |
| } | |
| } | |
| }, | |
| "exclude": { | |
| "type": "string", | |
| "description": "Glob pattern to exclude files from manifest generation" | |
| }, | |
| "include": { | |
| "type": "string", | |
| "description": "Glob pattern to include only specific files" | |
| } | |
| } | |
| }, | |
| "PluginConfig": { | |
| "type": "object", | |
| "description": "Plugin-specific configuration", | |
| "properties": { | |
| "name": { "type": "string", "description": "Plugin name" }, | |
| "env": { | |
| "type": "array", | |
| "description": "Environment variables passed to the plugin", | |
| "items": { | |
| "type": "object", | |
| "required": ["name", "value"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "value": { "type": "string" } | |
| } | |
| } | |
| }, | |
| "parameters": { | |
| "type": "array", | |
| "description": "Plugin parameters", | |
| "items": { | |
| "type": "object", | |
| "required": ["name"], | |
| "properties": { | |
| "name": { "type": "string" }, | |
| "string": { "type": "string" }, | |
| "array": { "type": "array", "items": { "type": "string" } }, | |
| "map": { | |
| "type": "object", | |
| "additionalProperties": { "type": "string" } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }, | |
| "SourceHydrator": { | |
| "type": "object", | |
| "description": "Provides a way to push hydrated manifests back to git before syncing them to the cluster", | |
| "required": ["drySource", "syncSource"], | |
| "properties": { | |
| "drySource": { | |
| "type": "object", | |
| "description": "Specifies where the dry manifest source lives", | |
| "required": ["repoURL", "targetRevision", "path"], | |
| "properties": { | |
| "repoURL": { | |
| "type": "string", | |
| "description": "URL to the git repository containing the application manifests" | |
| }, | |
| "targetRevision": { | |
| "type": "string", | |
| "description": "Revision of the source to hydrate" | |
| }, | |
| "path": { | |
| "type": "string", | |
| "description": "Directory path within the git repository where manifests are located" | |
| }, | |
| "helm": { "$ref": "#/$defs/HelmConfig" }, | |
| "kustomize": { "$ref": "#/$defs/KustomizeConfig" }, | |
| "directory": { "$ref": "#/$defs/DirectoryConfig" }, | |
| "plugin": { "$ref": "#/$defs/PluginConfig" } | |
| } | |
| }, | |
| "syncSource": { | |
| "type": "object", | |
| "description": "Specifies where to sync hydrated manifests from", | |
| "required": ["targetBranch", "path"], | |
| "properties": { | |
| "targetBranch": { | |
| "type": "string", | |
| "description": "Branch from which hydrated manifests will be synced" | |
| }, | |
| "path": { | |
| "type": "string", | |
| "description": "Directory path within the git repository for hydrated manifests", | |
| "minLength": 1 | |
| } | |
| } | |
| }, | |
| "hydrateTo": { | |
| "type": "object", | |
| "description": "Optional staging location to push hydrated manifests to (e.g. for PR-based workflows)", | |
| "required": ["targetBranch"], | |
| "properties": { | |
| "targetBranch": { | |
| "type": "string", | |
| "description": "Branch to which hydrated manifests should be committed" | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment