Skip to content

Commit 425a2d9

Browse files
feat: Use Codefresh provided storage for workflow logs (#428)
1 parent 0a35053 commit 425a2d9

File tree

7 files changed

+150
-51
lines changed

7 files changed

+150
-51
lines changed

charts/gitops-runtime/Chart.yaml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ dependencies:
4242
version: 0.7.9
4343
alias: gitops-operator
4444
condition: gitops-operator.enabled
45-
- name: garage
46-
repository: https://codefresh-io.github.io/garage
47-
alias: garage-workflows-artifact-storage
48-
version: 0.5.0-cf.3
49-
condition: garage-workflows-artifact-storage.enabled
5045
- name: cf-argocd-extras
5146
repository: oci://quay.io/codefresh/charts
5247
version: 0.5.1

charts/gitops-runtime/README.md

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,25 @@ See [Use OCI-based registries](https://helm.sh/docs/topics/registries/)
1616
## Codefresh official documentation:
1717
Prior to running the installation please see the official documentation at: https://codefresh.io/docs/docs/installation/gitops/hybrid-gitops-helm-installation/
1818

19+
## Argo-workflows artifact and log storage
20+
Codefresh provides a SaaS object storage based solution for Argo workflows logs storage. The chart deploys a configmap named `codefresh-workflows-log-store` with the repository configuration.
21+
If you want to utilize the Codefresh SaaS solution for log storage for all workflows in the runtime please set the following values:
22+
23+
```yaml
24+
argo-workflows:
25+
controller:
26+
workflowDefaults:
27+
spec:
28+
artifactRepository:
29+
configMap: codefresh-workflows-log-store
30+
key: codefresh-workflows-log-store
31+
```
32+
33+
> [!WARNING]
34+
> It's highly recommended to use your own artifact storage for data privacy reasons.
35+
> Codefresh provided storage has a retention policy of 14 days and limitations on uploaded file sizes.
36+
> Please refer to the official documentation for more details.
37+
1938
## Installation with External ArgoCD
2039
2140
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,15 +278,18 @@ sealed-secrets:
259278
| argo-rollouts.enabled | bool | `true` | |
260279
| argo-rollouts.fullnameOverride | string | `"argo-rollouts"` | |
261280
| argo-rollouts.installCRDs | bool | `true` | |
281+
| argo-workflows.controller.workflowDefaults.spec.archiveLogs | bool | `true` | |
262282
| argo-workflows.crds.install | bool | `true` | Install and upgrade CRDs |
263283
| argo-workflows.enabled | bool | `true` | |
264284
| argo-workflows.executor.resources.requests.ephemeral-storage | string | `"10Mi"` | |
265285
| argo-workflows.fullnameOverride | string | `"argo"` | |
266286
| argo-workflows.mainContainer.resources.requests.ephemeral-storage | string | `"10Mi"` | |
267287
| argo-workflows.server.authModes | list | `["client"]` | auth-mode needs to be set to client to be able to see workflow logs from Codefresh UI |
268288
| argo-workflows.server.baseHref | string | `"/workflows/"` | Do not change. Workflows UI is only accessed through internal router, changing this values will break routing to workflows native UI from Codefresh. |
269-
| cf-argocd-extras | object | `{"libraryMode":true}` | Codefresh extra services for ArgoCD |
289+
| cf-argocd-extras | object | `{"eventReporter":{"affinity":{},"enabled":true,"nodeSelector":{},"tolerations":[]},"libraryMode":true,"sourcesServer":{"affinity":{},"enabled":true,"nodeSelector":{},"tolerations":[]}}` | Codefresh extra services for ArgoCD |
270290
| cf-argocd-extras.libraryMode | bool | `true` | Library mode for the chart. Allows to inject values from gitops runtime chart |
291+
| cf-argocd-extras.sourcesServer | object | `{"affinity":{},"enabled":true,"nodeSelector":{},"tolerations":[]}` | Sources server configuration |
292+
| codefreshWorkflowLogStoreCM | object | `{"enabled":true,"endpoint":"gitops-workflow-logs.codefresh.io","insecure":false}` | Argo workflows logs storage on Codefresh platform settings. Don't change unless instructed by Codefresh support. |
271293
| event-reporters.rollout.eventSource.affinity | object | `{}` | |
272294
| event-reporters.rollout.eventSource.nodeSelector | object | `{}` | |
273295
| event-reporters.rollout.eventSource.replicas | int | `1` | |
@@ -304,14 +326,6 @@ sealed-secrets:
304326
| event-reporters.workflow.sensor.retryStrategy.steps | int | `3` | Number of retries |
305327
| event-reporters.workflow.sensor.tolerations | list | `[]` | |
306328
| event-reporters.workflow.serviceAccount.create | bool | `true` | |
307-
| 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) |
308-
| garage-workflows-artifact-storage.deployment.kind | string | `"StatefulSet"` | Only statefulset is supported for Codefresh gitops runtime. Do not change this |
309-
| garage-workflows-artifact-storage.persistence.data | object | `{"size":"100Mi","storageClass":""}` | Volume that stores artifacts and logs for workflows |
310-
| garage-workflows-artifact-storage.persistence.data.storageClass | string | `""` | When empty value empty the default storage class for the cluster will be used |
311-
| garage-workflows-artifact-storage.persistence.meta | object | `{"size":"100Mi","storageClass":""}` | Volume that stores cluster metadata |
312-
| garage-workflows-artifact-storage.persistence.meta.storageClass | string | `""` | When empty value empty the default storage class for the cluster will be used |
313-
| 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. |
314-
| garage-workflows-artifact-storage.tests | object | `{"enabled":false}` | Helm tests |
315329
| gitops-operator.affinity | object | `{}` | |
316330
| gitops-operator.crds | object | `{"additionalLabels":{},"annotations":{},"install":true,"keep":false}` | Codefresh gitops operator crds |
317331
| gitops-operator.crds.additionalLabels | object | `{}` | Additional labels for gitops operator CRDs |
@@ -369,7 +383,8 @@ sealed-secrets:
369383
| global.external-argo-rollouts | object | `{"rollout-reporter":{"enabled":false}}` | Configuration for external Argo Rollouts |
370384
| global.external-argo-rollouts.rollout-reporter | object | `{"enabled":false}` | Rollout reporter settings |
371385
| global.external-argo-rollouts.rollout-reporter.enabled | bool | `false` | Enable or disable rollout reporter Configuration is defined at .Values.event-reporters.rollout |
372-
| global.runtime | object | `{"cluster":"https://kubernetes.default.svc","codefreshHosted":false,"eventBus":{"annotations":{},"name":"codefresh-eventbus","nats":{"native":{"auth":"token","containerTemplate":{"resources":{"limits":{"cpu":"500m","ephemeral-storage":"2Gi","memory":"4Gi"},"requests":{"cpu":"200m","ephemeral-storage":"2Gi","memory":"1Gi"}}},"maxPayload":"4MB","replicas":3}},"pdb":{"enabled":true,"minAvailable":2}},"gitCredentials":{"password":{"secretKeyRef":{},"value":null},"username":"username"},"ingress":{"annotations":{},"className":"nginx","enabled":false,"hosts":[],"protocol":"https","skipValidation":false,"tls":[]},"ingressUrl":"","isConfigurationRuntime":false,"name":null}` | Runtime level settings |
386+
| global.nodeSelector | object | `{}` | Global nodeSelector for all components |
387+
| global.runtime | object | `{"cluster":"https://kubernetes.default.svc","codefreshHosted":false,"eventBus":{"annotations":{},"name":"codefresh-eventbus","nats":{"native":{"affinity":{},"auth":"token","containerTemplate":{"resources":{"limits":{"cpu":"500m","ephemeral-storage":"2Gi","memory":"4Gi"},"requests":{"cpu":"200m","ephemeral-storage":"2Gi","memory":"1Gi"}}},"maxPayload":"4MB","nodeSelector":{},"replicas":3,"tolerations":[]}},"pdb":{"enabled":true,"minAvailable":2}},"gitCredentials":{"password":{"secretKeyRef":{},"value":null},"username":"username"},"ingress":{"annotations":{},"className":"nginx","enabled":false,"hosts":[],"labels":{},"protocol":"https","skipValidation":false,"tls":[]},"ingressUrl":"","isConfigurationRuntime":false,"name":null}` | Runtime level settings |
373388
| global.runtime.cluster | string | `"https://kubernetes.default.svc"` | Runtime cluster. Should not be changed. |
374389
| global.runtime.codefreshHosted | bool | `false` | Defines whether this is a Codefresh hosted runtime. Should not be changed. |
375390
| global.runtime.eventBus.annotations | object | `{}` | Annotations on EventBus resource |
@@ -381,15 +396,16 @@ sealed-secrets:
381396
| global.runtime.gitCredentials.password.secretKeyRef | object | `{}` | secretKeyReference for Git credentials password. Provide name and key fields. |
382397
| global.runtime.gitCredentials.password.value | string | `nil` | Plain text password |
383398
| global.runtime.gitCredentials.username | string | `"username"` | Username. Optional when using token in password. |
384-
| global.runtime.ingress | object | `{"annotations":{},"className":"nginx","enabled":false,"hosts":[],"protocol":"https","skipValidation":false,"tls":[]}` | Ingress settings |
399+
| global.runtime.ingress | object | `{"annotations":{},"className":"nginx","enabled":false,"hosts":[],"labels":{},"protocol":"https","skipValidation":false,"tls":[]}` | Ingress settings |
385400
| global.runtime.ingress.enabled | bool | `false` | Defines if ingress-based access mode is enabled for runtime. To use tunnel-based (ingressless) access mode, set to false. |
386401
| global.runtime.ingress.hosts | list | `[]` | Hosts for runtime ingress. Note that Codefresh platform will always use the first host in the list to access the runtime. |
387402
| global.runtime.ingress.protocol | string | `"https"` | The protocol that Codefresh platform will use to access the runtime ingress. Can be http or https. |
388403
| global.runtime.ingress.skipValidation | bool | `false` | if set to true, the pre-install hook will validate the existance of appropriate values, but *will not* attempt to make a web request to the ingress host |
389404
| global.runtime.ingressUrl | string | `""` | Explicit url for runtime ingress. Provide this value only if you don't want the chart to create and ingress (global.runtime.ingress.enabled=false) and tunnel-client is not used (tunnel-client.enabled=false) |
390405
| global.runtime.isConfigurationRuntime | bool | `false` | is the runtime set as a "configuration runtime". |
391406
| global.runtime.name | string | `nil` | Runtime name. Must be unique per platform account. |
392-
| installer | object | `{"argoCdVersionCheck":{"argoServerLabels":{"app.kubernetes.io/component":"server","app.kubernetes.io/part-of":"argocd"}},"image":{"pullPolicy":"IfNotPresent","repository":"quay.io/codefresh/gitops-runtime-installer","tag":""},"skipValidation":false}` | Runtime installer used for running hooks and checks on the release |
407+
| global.tolerations | list | `[]` | Global tolerations for all components |
408+
| installer | object | `{"affinity":{},"argoCdVersionCheck":{"argoServerLabels":{"app.kubernetes.io/component":"server","app.kubernetes.io/part-of":"argocd"}},"image":{"pullPolicy":"IfNotPresent","repository":"quay.io/codefresh/gitops-runtime-installer","tag":""},"nodeSelector":{},"skipValidation":false,"tolerations":[]}` | Runtime installer used for running hooks and checks on the release |
393409
| installer.skipValidation | bool | `false` | if set to true, pre-install hook will *not* run |
394410
| internal-router.affinity | object | `{}` | |
395411
| internal-router.clusterDomain | string | `"cluster.local"` | |
@@ -424,6 +440,6 @@ sealed-secrets:
424440
| internal-router.serviceAccount.name | string | `""` | |
425441
| internal-router.tolerations | list | `[]` | |
426442
| sealed-secrets | object | `{"fullnameOverride":"sealed-secrets-controller","image":{"registry":"quay.io","repository":"codefresh/sealed-secrets-controller","tag":"0.29.0"},"keyrenewperiod":"720h","resources":{"limits":{"cpu":"500m","memory":"1Gi"},"requests":{"cpu":"200m","memory":"512Mi"}}}` | --------------------------------------------------------------------------------------------------------------------- |
427-
| tunnel-client | object | `{"enabled":true,"libraryMode":true,"tunnelServer":{"host":"register-tunnels.cf-cd.com","subdomainHost":"tunnels.cf-cd.com"}}` | Tunnel based runtime. Not supported for on-prem platform. In on-prem use ingress based runtimes. |
443+
| tunnel-client | object | `{"affinity":{},"enabled":true,"libraryMode":true,"nodeSelector":{},"tolerations":[],"tunnelServer":{"host":"register-tunnels.cf-cd.com","subdomainHost":"tunnels.cf-cd.com"}}` | Tunnel based runtime. Not supported for on-prem platform. In on-prem use ingress based runtimes. |
428444
| tunnel-client.enabled | bool | `true` | Will only be used if global.runtime.ingress.enabled = false |
429445
| tunnel-client.libraryMode | bool | `true` | Do not change this value! Breaks chart logic |

charts/gitops-runtime/README.md.gotmpl

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,27 @@ See [Use OCI-based registries](https://helm.sh/docs/topics/registries/)
1616
## Codefresh official documentation:
1717
Prior to running the installation please see the official documentation at: https://codefresh.io/docs/docs/installation/gitops/hybrid-gitops-helm-installation/
1818

19+
## Argo-workflows artifact and log storage
20+
Codefresh provides a SaaS object storage based solution for Argo workflows logs storage. The chart deploys a configmap named `codefresh-workflows-log-store` with the repository configuration.
21+
If you want to utilize the Codefresh SaaS solution for log storage for all workflows in the runtime please set the following values:
22+
23+
```yaml
24+
argo-workflows:
25+
controller:
26+
workflowDefaults:
27+
spec:
28+
artifactRepository:
29+
configMap: codefresh-workflows-log-store
30+
key: codefresh-workflows-log-store
31+
```
32+
33+
34+
> [!WARNING]
35+
> It's highly recommended to use your own artifact storage for data privacy reasons.
36+
> Codefresh provided storage has a retention policy of 14 days and limitations on uploaded file sizes.
37+
> Please refer to the official documentation for more details.
38+
39+
1940
## Installation with External ArgoCD
2041

2142
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.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{{- if .Values.codefreshWorkflowLogStoreCM.enabled }}
2+
{{- $_ := required "global.codefresh.accountId is required if codefreshWorkflowLogStoreCM is enabled" .Values.global.codefresh.accountId }}
3+
apiVersion: v1
4+
data:
5+
codefresh-workflows-log-store: |
6+
archiveLogs: true
7+
s3:
8+
bucket: {{ .Values.global.codefresh.accountId }}
9+
endpoint: {{ .Values.codefreshWorkflowLogStoreCM.endpoint }}
10+
insecure: {{ .Values.codefreshWorkflowLogStoreCM.insecure }}
11+
keyFormat: {{ .Values.global.runtime.name }}/{{ "{{" }}workflow.name{{ "}}" }}/{{ "{{" }}pod.name{{ "}}" }}
12+
accessKeySecret:
13+
name: codefresh-token
14+
key: token
15+
secretKeySecret:
16+
name: codefresh-token
17+
key: token
18+
kind: ConfigMap
19+
metadata:
20+
annotations:
21+
workflows.argoproj.io/default-artifact-repository: codefresh-workflows-log-store
22+
name: codefresh-workflows-log-store
23+
{{- end }}

charts/gitops-runtime/templates/tunnel-client.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ reduce complexity of installation and number or mandatory values to provide for
1010
{{ $runtimeName := required "runtime.name is required" .Values.global.runtime.name }}
1111
{{ $_ := set $tunnelClientContext.Values.tunnel "subdomainPrefix" (printf "%s-%s" $accoundId $runtimeName)}}
1212
{{- include "codefresh-tunnel-client.resources" $tunnelClientContext }}
13-
{{- end }}
13+
{{- end }}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
suite: codefresh-workflow-logs-store tests
2+
templates:
3+
- codefresh-workflow-log-store.yaml
4+
tests:
5+
6+
- it: Should only create the configmap when enabled
7+
template: 'codefresh-workflow-log-store.yaml'
8+
values:
9+
- ./values/mandatory-values.yaml
10+
set:
11+
codefreshWorkflowLogStoreCM.enabled: false
12+
asserts:
13+
- hasDocuments:
14+
count: 0
15+
16+
- it: Should only create the configmap when enabled
17+
template: 'codefresh-workflow-log-store.yaml'
18+
values:
19+
- ./values/mandatory-values.yaml
20+
set:
21+
codefreshWorkflowLogStoreCM.enabled: true
22+
asserts:
23+
- hasDocuments:
24+
count: 1
25+
26+
- it: Should fail if the accountId is not set
27+
template: 'codefresh-workflow-log-store.yaml'
28+
values:
29+
- ./values/mandatory-values.yaml
30+
set:
31+
codefreshWorkflowLogStoreCM.enabled: true
32+
global.codefresh.accountId: ""
33+
asserts:
34+
- failedTemplate:
35+
errorMessage: 'global.codefresh.accountId is required if codefreshWorkflowLogStoreCM is enabled'
36+
37+
- it: ConfigMap data populated with the correct values
38+
template: 'codefresh-workflow-log-store.yaml'
39+
values:
40+
- ./values/mandatory-values.yaml
41+
set:
42+
global:
43+
runtime:
44+
name: test-runtime
45+
codefreshWorkflowLogStoreCM.enabled: true
46+
global.codefresh.accountId: "test-account"
47+
codefreshWorkflowLogStoreCM:
48+
enabled: true
49+
endpoint: test.codefresh.io
50+
insecure: true
51+
asserts:
52+
- equal:
53+
path: data
54+
value:
55+
codefresh-workflows-log-store: |
56+
archiveLogs: true
57+
s3:
58+
bucket: test-account
59+
endpoint: test.codefresh.io
60+
insecure: true
61+
keyFormat: test-runtime/{{workflow.name}}/{{pod.name}}
62+
accessKeySecret:
63+
name: codefresh-token
64+
key: token
65+
secretKeySecret:
66+
name: codefresh-token
67+
key: token

charts/gitops-runtime/values.yaml

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,16 @@ argo-workflows:
313313
resources:
314314
requests:
315315
ephemeral-storage: 10Mi
316+
controller:
317+
workflowDefaults:
318+
spec:
319+
archiveLogs: true
316320

321+
# -- Argo workflows logs storage on Codefresh platform settings. Don't change unless instructed by Codefresh support.
322+
codefreshWorkflowLogStoreCM:
323+
enabled: true
324+
endpoint: gitops-workflow-logs.codefresh.io
325+
insecure: false
317326
#-----------------------------------------------------------------------------------------------------------------------
318327
# Argo rollouts
319328
#-----------------------------------------------------------------------------------------------------------------------
@@ -719,38 +728,6 @@ gitops-operator:
719728
cpu: 100m
720729
memory: 128Mi
721730

722-
#-----------------------------------------------------------------------------------------------------------------------
723-
# Garage
724-
#-----------------------------------------------------------------------------------------------------------------------
725-
# -- Builtin Workflows artifacts storage solution. Local S3 backed by local persistence with (PV and PVC)
726-
garage-workflows-artifact-storage:
727-
fullnameOverride: garage
728-
enabled: false
729-
deployment:
730-
# -- Only statefulset is supported for Codefresh gitops runtime. Do not change this
731-
kind: StatefulSet
732-
replicaCount: 3
733-
garage:
734-
#-- Default to 3 replicas, see the replication_mode section at https://garagehq.deuxfleurs.fr/documentation/reference-manual/configuration/#replication-mode
735-
replicationMode: 3
736-
persistence:
737-
enabled: true
738-
# -- Volume that stores cluster metadata
739-
meta:
740-
# -- When empty value empty the default storage class for the cluster will be used
741-
storageClass: ""
742-
size: 100Mi
743-
# -- Volume that stores artifacts and logs for workflows
744-
data:
745-
# -- When empty value empty the default storage class for the cluster will be used
746-
storageClass: ""
747-
size: 100Mi
748-
# -- Resources for garage pods. For smaller deployments at least 100m CPU and 1024Mi memory is reccommended. For larger deployments double this size.
749-
resources: {}
750-
# -- Helm tests
751-
tests:
752-
enabled: false
753-
754731
#-----------------------------------------------------------------------------------------------------------------------
755732
# cf-argocd-extras
756733
#-----------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)