diff --git a/charts/gitops-runtime/Chart.yaml b/charts/gitops-runtime/Chart.yaml index f6a05822..995e1774 100644 --- a/charts/gitops-runtime/Chart.yaml +++ b/charts/gitops-runtime/Chart.yaml @@ -42,11 +42,6 @@ dependencies: version: 0.7.1 alias: gitops-operator condition: gitops-operator.enabled -- name: garage - repository: https://codefresh-io.github.io/garage - alias: garage-workflows-artifact-storage - version: 0.5.0-cf.3 - condition: garage-workflows-artifact-storage.enabled - name: cf-argocd-extras repository: oci://quay.io/codefresh/charts version: 0.3.22 diff --git a/charts/gitops-runtime/README.md b/charts/gitops-runtime/README.md index d15a7228..a3f62a71 100644 --- a/charts/gitops-runtime/README.md +++ b/charts/gitops-runtime/README.md @@ -16,6 +16,18 @@ See [Use OCI-based registries](https://helm.sh/docs/topics/registries/) ## Codefresh official documentation: Prior to running the installation please see the official documentation at: https://codefresh.io/docs/docs/installation/gitops/hybrid-gitops-helm-installation/ +## Argo-workflows artifact and log storage +> [!NOTE] +> This version of the chart includes default configuration for storing workflow artifacts and logs in Codefresh provided s3 compatible storage. + +If you have your own storage configuration using the default configmap `artifact-repositories` upgrading the chart will override your artifact storage configuration. +To prevent this please set `argo-workflows.controller.workflowDefaults.spec.artifactRepository.configMap` to `artifact-repositories` and `argo-workflows.controller.workflowDefaults.spec.artifactRepository.key` +to the respective key in your configmap identifying the repository. +> [!WARNING] +> It's highly recommended to use your own artifact storage for data privacy reasons. +> Codefresh provided storage has a retention policy of 14 days and limitations on uploaded file sizes. +> Please refer to the official documentation for more details. + ## Installation with External ArgoCD If you want to use an existing ArgoCD installation, you can disable the built-in ArgoCD and configure the GitOps Runtime to use the external ArgoCD. @@ -259,6 +271,9 @@ sealed-secrets: | argo-rollouts.enabled | bool | `true` | | | argo-rollouts.fullnameOverride | string | `"argo-rollouts"` | | | argo-rollouts.installCRDs | bool | `true` | | +| argo-workflows.codefreshWorkflowLogs | object | `{"endpoint":"gitops-workflow-logs.codefresh.io","insecure":false}` | Argo workflows logs storage on Codefresh platform settings. Don't change unless instructed by Codefresh support. | +| argo-workflows.controller.workflowDefaults.spec.archiveLogs | bool | `true` | | +| argo-workflows.controller.workflowDefaults.spec.artifactRepositoryRef | object | `{"configMap":"codefresh-workflows-log-store","key":"codefresh-workflows-log-store"}` | By default artifact repository is set to a Codefresh provided repository. For data privacy it is reccommended to set your own artifact repository. For instructions see: https://argo-workflows.readthedocs.io/en/latest/configure-artifact-repository/#configuring-your-artifact-repository | | argo-workflows.crds.install | bool | `true` | Install and upgrade CRDs | | argo-workflows.enabled | bool | `true` | | | argo-workflows.executor.resources.requests.ephemeral-storage | string | `"10Mi"` | | @@ -304,14 +319,6 @@ sealed-secrets: | event-reporters.workflow.sensor.retryStrategy.steps | int | `3` | Number of retries | | event-reporters.workflow.sensor.tolerations | list | `[]` | | | event-reporters.workflow.serviceAccount.create | bool | `true` | | -| garage-workflows-artifact-storage | object | `{"deployment":{"kind":"StatefulSet","replicaCount":3},"enabled":false,"fullnameOverride":"garage","garage":{"replicationMode":3},"persistence":{"data":{"size":"100Mi","storageClass":""},"enabled":true,"meta":{"size":"100Mi","storageClass":""}},"resources":{},"tests":{"enabled":false}}` | Builtin Workflows artifacts storage solution. Local S3 backed by local persistence with (PV and PVC) | -| garage-workflows-artifact-storage.deployment.kind | string | `"StatefulSet"` | Only statefulset is supported for Codefresh gitops runtime. Do not change this | -| garage-workflows-artifact-storage.persistence.data | object | `{"size":"100Mi","storageClass":""}` | Volume that stores artifacts and logs for workflows | -| garage-workflows-artifact-storage.persistence.data.storageClass | string | `""` | When empty value empty the default storage class for the cluster will be used | -| garage-workflows-artifact-storage.persistence.meta | object | `{"size":"100Mi","storageClass":""}` | Volume that stores cluster metadata | -| garage-workflows-artifact-storage.persistence.meta.storageClass | string | `""` | When empty value empty the default storage class for the cluster will be used | -| garage-workflows-artifact-storage.resources | object | `{}` | Resources for garage pods. For smaller deployments at least 100m CPU and 1024Mi memory is reccommended. For larger deployments double this size. | -| garage-workflows-artifact-storage.tests | object | `{"enabled":false}` | Helm tests | | gitops-operator.affinity | object | `{}` | | | gitops-operator.crds | object | `{"additionalLabels":{},"annotations":{},"install":true,"keep":false}` | Codefresh gitops operator crds | | gitops-operator.crds.additionalLabels | object | `{}` | Additional labels for gitops operator CRDs | diff --git a/charts/gitops-runtime/README.md.gotmpl b/charts/gitops-runtime/README.md.gotmpl index 3dc84754..734d6a01 100644 --- a/charts/gitops-runtime/README.md.gotmpl +++ b/charts/gitops-runtime/README.md.gotmpl @@ -16,6 +16,19 @@ See [Use OCI-based registries](https://helm.sh/docs/topics/registries/) ## Codefresh official documentation: Prior to running the installation please see the official documentation at: https://codefresh.io/docs/docs/installation/gitops/hybrid-gitops-helm-installation/ +## Argo-workflows artifact and log storage +> [!NOTE] +> This version of the chart includes default configuration for storing workflow artifacts and logs in Codefresh provided s3 compatible storage. + +If you have your own storage configuration using the default configmap `artifact-repositories` upgrading the chart will override your artifact storage configuration. +To prevent this please set `argo-workflows.controller.workflowDefaults.spec.artifactRepository.configMap` to `artifact-repositories` and `argo-workflows.controller.workflowDefaults.spec.artifactRepository.key` +to the respective key in your configmap identifying the repository. +> [!WARNING] +> It's highly recommended to use your own artifact storage for data privacy reasons. +> Codefresh provided storage has a retention policy of 14 days and limitations on uploaded file sizes. +> Please refer to the official documentation for more details. + + ## Installation with External ArgoCD If you want to use an existing ArgoCD installation, you can disable the built-in ArgoCD and configure the GitOps Runtime to use the external ArgoCD. diff --git a/charts/gitops-runtime/templates/codefresh-workflow-log-store.yaml b/charts/gitops-runtime/templates/codefresh-workflow-log-store.yaml new file mode 100644 index 00000000..c346aef8 --- /dev/null +++ b/charts/gitops-runtime/templates/codefresh-workflow-log-store.yaml @@ -0,0 +1,25 @@ +{{- if hasKey (index .Values "argo-workflows" "controller" "workflowDefaults" "spec" "artifactRepositoryRef") "configMap" }} + {{- if eq (index .Values "argo-workflows" "controller" "workflowDefaults" "spec" "artifactRepositoryRef" "configMap") "codefresh-workflows-log-store" }} + {{- $_ := required "global.codefresh.accountId is required" .Values.global.codefresh.accountId }} +apiVersion: v1 +data: + codefresh-workflows-log-store: | + archiveLogs: true + s3: + bucket: {{ .Values.global.codefresh.accountId }} + endpoint: {{ index .Values "argo-workflows" "codefreshWorkflowLogs" "endpoint" }} + insecure: {{ index .Values "argo-workflows" "codefreshWorkflowLogs" "insecure" }} + keyFormat: {{ .Values.global.runtime.name }}/{{ "{{" }}workflow.name{{ "}}" }}/{{ "{{" }}pod.name{{ "}}" }} + accessKeySecret: + name: codefresh-token + key: token + secretKeySecret: + name: codefresh-token + key: token +kind: ConfigMap +metadata: + annotations: + workflows.argoproj.io/default-artifact-repository: codefresh-workflows-log-store + name: codefresh-workflows-log-store + {{- end }} +{{- end }} diff --git a/charts/gitops-runtime/templates/tunnel-client.yaml b/charts/gitops-runtime/templates/tunnel-client.yaml index 2b4368e8..8d5b0c70 100644 --- a/charts/gitops-runtime/templates/tunnel-client.yaml +++ b/charts/gitops-runtime/templates/tunnel-client.yaml @@ -10,4 +10,4 @@ reduce complexity of installation and number or mandatory values to provide for {{ $runtimeName := required "runtime.name is required" .Values.global.runtime.name }} {{ $_ := set $tunnelClientContext.Values.tunnel "subdomainPrefix" (printf "%s-%s" $accoundId $runtimeName)}} {{- include "codefresh-tunnel-client.resources" $tunnelClientContext }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/gitops-runtime/tests/codefresh-workflow-logs-store.yaml b/charts/gitops-runtime/tests/codefresh-workflow-logs-store.yaml new file mode 100644 index 00000000..f492b942 --- /dev/null +++ b/charts/gitops-runtime/tests/codefresh-workflow-logs-store.yaml @@ -0,0 +1,35 @@ +suite: codefresh-workflow-logs-store tests +templates: + - codefresh-workflow-log-store.yaml +tests: + +- it: Should only create the configmap when the workflowDefaults.artifactRepositoryRef.configMap is set to codefresh-workflows-log-store + template: 'codefresh-workflow-log-store.yaml' + values: + - ./values/mandatory-values.yaml + set: + argo-workflows.controller.workflowDefaults.spec.artifactRepositoryRef.configMap: "some-other-configmap" + asserts: + - hasDocuments: + count: 0 + +- it: Should only create the configmap when the workflowDefaults.artifactRepositoryRef.configMap is set to codefresh-workflows-log-store + template: 'codefresh-workflow-log-store.yaml' + values: + - ./values/mandatory-values.yaml + set: + argo-workflows.controller.workflowDefaults.spec.artifactRepositoryRef.configMap: "codefresh-workflows-log-store" + asserts: + - hasDocuments: + count: 1 + +- it: Should fail if the accountId is not set + template: 'codefresh-workflow-log-store.yaml' + values: + - ./values/mandatory-values.yaml + set: + argo-workflows.controller.workflowDefaults.spec.artifactRepositoryRef.configMap: "codefresh-workflows-log-store" + global.codefresh.accountId: "" + asserts: + - failedTemplate: + errorMessage: 'global.codefresh.accountId is required' diff --git a/charts/gitops-runtime/values.yaml b/charts/gitops-runtime/values.yaml index 60b98bc4..cd9e4dd3 100644 --- a/charts/gitops-runtime/values.yaml +++ b/charts/gitops-runtime/values.yaml @@ -313,6 +313,18 @@ argo-workflows: resources: requests: ephemeral-storage: 10Mi + controller: + workflowDefaults: + spec: + archiveLogs: true + # -- By default artifact repository is set to a Codefresh provided repository. For data privacy it is reccommended to set your own artifact repository. For instructions see: https://argo-workflows.readthedocs.io/en/latest/configure-artifact-repository/#configuring-your-artifact-repository + artifactRepositoryRef: + configMap: codefresh-workflows-log-store + key: codefresh-workflows-log-store + # -- Argo workflows logs storage on Codefresh platform settings. Don't change unless instructed by Codefresh support. + codefreshWorkflowLogs: + endpoint: gitops-workflow-logs.codefresh.io + insecure: false #----------------------------------------------------------------------------------------------------------------------- # Argo rollouts @@ -704,38 +716,6 @@ gitops-operator: cpu: 100m memory: 128Mi #----------------------------------------------------------------------------------------------------------------------- -# Garage -#----------------------------------------------------------------------------------------------------------------------- -# -- Builtin Workflows artifacts storage solution. Local S3 backed by local persistence with (PV and PVC) -garage-workflows-artifact-storage: - fullnameOverride: garage - enabled: false - deployment: - # -- Only statefulset is supported for Codefresh gitops runtime. Do not change this - kind: StatefulSet - replicaCount: 3 - garage: - #-- Default to 3 replicas, see the replication_mode section at https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/#replication-mode - replicationMode: 3 - persistence: - enabled: true - # -- Volume that stores cluster metadata - meta: - # -- When empty value empty the default storage class for the cluster will be used - storageClass: "" - size: 100Mi - # -- Volume that stores artifacts and logs for workflows - data: - # -- When empty value empty the default storage class for the cluster will be used - storageClass: "" - size: 100Mi - # -- Resources for garage pods. For smaller deployments at least 100m CPU and 1024Mi memory is reccommended. For larger deployments double this size. - resources: {} - # -- Helm tests - tests: - enabled: false - -#----------------------------------------------------------------------------------------------------------------------- # cf-argocd-extras #----------------------------------------------------------------------------------------------------------------------- # -- Codefresh extra services for ArgoCD