diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 44390fd9..e794655a 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: v2.1.7 description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 3.27.1 +version: 3.28.0 home: https://github.com/argoproj/argo-helm icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png keywords: @@ -21,4 +21,4 @@ dependencies: condition: redis-ha.enabled annotations: artifacthub.io/changes: | - - "[Added]: Mention declarative set up for Argo CD in README.md" + - "[Added]: add extensions support" diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md index d9198396..0aae3295 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -394,6 +394,11 @@ NAME: my-release | server.containerSecurityContext | object | `{}` | Servers container-level security context | | server.env | list | `[]` | Environment variables to pass to Argo CD server | | server.envFrom | list | `[]` (See [values.yaml]) | envFrom to pass to Argo CD server | +| server.extensions.contents | list | `[]` | Extensions to be loaded into the server | +| server.extensions.enabled | bool | `false` | Enable support for extensions | +| server.extensions.image.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy for extensions | +| server.extensions.image.repository | string | `"ghcr.io/argoproj-labs/argocd-extensions"` | Repository to use for extensions image | +| server.extensions.image.tag | string | `"v0.1.0"` | Tag to use for extensions image | | server.extraArgs | list | `[]` | Additional command line arguments to pass to Argo CD server | | server.extraContainers | list | `[]` | Additional containers to be added to the server pod | | server.image.imagePullPolicy | string | `""` (defaults to global.image.imagePullPolicy) | Image pull policy for the Argo CD server | diff --git a/charts/argo-cd/crds/crd-extension.yaml b/charts/argo-cd/crds/crd-extension.yaml new file mode 100644 index 00000000..ddb11e70 --- /dev/null +++ b/charts/argo-cd/crds/crd-extension.yaml @@ -0,0 +1,96 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + labels: + app.kubernetes.io/name: argocdextensions.argoproj.io + app.kubernetes.io/part-of: argocd + annotations: + controller-gen.kubebuilder.io/version: v0.4.1 + name: argocdextensions.argoproj.io +spec: + group: argoproj.io + names: + kind: ArgoCDExtension + listKind: ArgoCDExtensionList + plural: argocdextensions + singular: argocdextension + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: ArgoCDExtension is the Schema for the argocdextensions API + 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: ArgoCDExtensionSpec defines the desired state of ArgoCDExtension + properties: + sources: + description: Sources specifies where the extension should come from + items: + description: ExtensionSource specifies where the extension should + be sourced from + properties: + git: + description: Git is specified if the extension should be sourced + from a git repository + properties: + revision: + description: Revision specifies the revision of the Repository + to fetch + type: string + url: + description: URL specifies the Git repository URL to fetch + type: string + type: object + web: + description: Web is specified if the extension should be sourced + from a web file + properties: + url: + description: URK specifies the remote file URL + type: string + type: object + type: object + type: array + required: + - sources + type: object + status: + description: ArgoCDExtensionStatus defines the observed state of ArgoCDExtension + properties: + conditions: + items: + properties: + message: + description: Message contains human-readable message indicating + details about condition + type: string + status: + description: Boolean status describing if the condition is currently + true + type: string + type: + description: Type is an ArgoCDExtension condition type + type: string + required: + - message + - status + - type + type: object + type: array + type: object + type: object + served: true + storage: true diff --git a/charts/argo-cd/templates/argocd-server/deployment.yaml b/charts/argo-cd/templates/argocd-server/deployment.yaml index babfbc6b..426093fa 100755 --- a/charts/argo-cd/templates/argocd-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-server/deployment.yaml @@ -75,6 +75,10 @@ spec: {{- if .Values.server.volumeMounts }} {{- toYaml .Values.server.volumeMounts | nindent 8}} {{- end }} + {{- if .Values.server.extensions.enabled }} + - name: extensions + mountPath: /tmp/extensions/ + {{- end }} {{- if .Values.configs.knownHosts }} - mountPath: /app/config/ssh name: ssh-known-hosts @@ -132,6 +136,14 @@ spec: {{- with .Values.server.extraContainers }} {{- toYaml . | nindent 6 }} {{- end }} + {{- if .Values.server.extensions.enabled }} + - name: argocd-extensions + image: {{ .Values.server.extensions.image.repository }}:{{ .Values.server.extensions.image.tag }} + imagePullPolicy: {{ .Values.server.extensions.image.imagePullPolicy }} + volumeMounts: + - name: extensions + mountPath: /tmp/extensions/ + {{- end }} {{- if .Values.server.nodeSelector }} nodeSelector: {{- toYaml .Values.server.nodeSelector | nindent 8 }} @@ -164,6 +176,10 @@ spec: {{- if .Values.server.volumes }} {{- toYaml .Values.server.volumes | nindent 6}} {{- end }} + {{- if .Values.server.extensions.enabled }} + - name: extensions + emptyDir: {} + {{- end }} - emptyDir: {} name: static-files - emptyDir: {} diff --git a/charts/argo-cd/templates/argocd-server/extensions-rolebinding.yaml b/charts/argo-cd/templates/argocd-server/extensions-rolebinding.yaml new file mode 100644 index 00000000..3e8ec5d6 --- /dev/null +++ b/charts/argo-cd/templates/argocd-server/extensions-rolebinding.yaml @@ -0,0 +1,15 @@ +{{- if .Values.server.extensions.enabled }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} + name: argocd-server-extensions +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: argocd-server-extensions +subjects: +- kind: ServiceAccount + name: argocd-server +{{- end }} diff --git a/charts/argo-cd/templates/argocd-server/extensions.yaml b/charts/argo-cd/templates/argocd-server/extensions.yaml new file mode 100644 index 00000000..5ac595db --- /dev/null +++ b/charts/argo-cd/templates/argocd-server/extensions.yaml @@ -0,0 +1,17 @@ +{{- if .Values.server.extensions.enabled }} +{{- range $extension := .Values.server.extensions.contents }} +--- +apiVersion: argoproj.io/v1alpha1 +kind: ArgoCDExtension +metadata: + name: {{ $extension.name }} + finalizers: + - extensions-finalizer.argocd.argoproj.io + labels: + {{- include "argo-cd.labels" (dict "context" $ "component" $.Values.server.name "name" (printf "%s-extensions" $.Values.server.name)) | nindent 4 }} +spec: + sources: + - web: + url: {{ $extension.url }} +{{- end }} +{{- end }} diff --git a/charts/argo-cd/templates/argocd-server/extentions-role.yaml b/charts/argo-cd/templates/argocd-server/extentions-role.yaml new file mode 100644 index 00000000..53e592ae --- /dev/null +++ b/charts/argo-cd/templates/argocd-server/extentions-role.yaml @@ -0,0 +1,21 @@ +{{- if .Values.server.extensions.enabled }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + {{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }} + name: argocd-server-extensions +rules: +- apiGroups: + - argoproj.io + resources: + - argocdextensions + verbs: + - create + - get + - list + - watch + - update + - delete + - patch +{{- end }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index c3f6cd75..2cf1c61e 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -1276,6 +1276,24 @@ server: # name: custom-tools # subPath: helm + extensions: + # -- Enable support for extensions + ## This function in tech preview stage, do expect unstability or breaking changes in newer versions. Bump image.tag if necessary. + enabled: false + + image: + # -- Repository to use for extensions image + repository: "ghcr.io/argoproj-labs/argocd-extensions" + # -- Tag to use for extensions image + tag: "v0.1.0" + # -- Image pull policy for extensions + imagePullPolicy: IfNotPresent + + # -- Extensions to be loaded into the server + contents: [] + # - name: argo-rollouts + # url: https://github.com/argoproj-labs/rollout-extension/releases/download/v0.1.0/extension.tar + ## Repo Server repoServer: # -- Repo server name