Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions charts/udash-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ helm uninstall udash-agent
| images.agentrelay.tag | string | `"v0.14.0@sha256:a52edcb9535d8c392a2e592bf7c3b4fc0c14ecd4b1360aa96639145038b5da75"` | Overrides the image tag whose default is the chart appVersion. |
| nameOverride | string | `""` | Override for the chart name used in resource names. |
| nodeSelector | object | `{}` | Node selector for pod scheduling. |
| persistence.accessModes | list | `["ReadWriteOnce"]` | Access modes for the PersistentVolumeClaim. |
| persistence.annotations | object | `{}` | Annotations to add to the PersistentVolumeClaim. |
| persistence.enabled | bool | `false` | Enable a PersistentVolumeClaim to persist the Updatecli tmp folder (`/tmp/updatecli`) across executions. One PVC is created per agent CronJob and per Argo workflow entry. |
| persistence.size | string | `"1Gi"` | Size of the PersistentVolumeClaim. |
| persistence.storageClassName | string | `""` | Storage class name for the PersistentVolumeClaim. Leave empty to use the cluster default. |
| podAnnotations | object | `{}` | Annotations to add to all pods. |
| podSecurityContext | object | `{}` | Pod-level security context. |
| resources | object | `{}` | Resource requests and limits for all containers. Ref: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ |
Expand Down
21 changes: 21 additions & 0 deletions charts/udash-agent/templates/argoworkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,28 @@ spec:
- name: updatecli-compose-file
description: the updatecli compose file
default: updatecli-compose.yaml
{{- if $.Values.persistence.enabled }}
- name: tmp-pvc-name
description: PersistentVolumeClaim name for the updatecli tmp folder
{{- end }}
templates:
- name: main
volumes:
- name: workspace
emptyDir: {}
{{- if $.Values.persistence.enabled }}
- name: updatecli-tmp
persistentVolumeClaim:
claimName: "{{ "{{" }} inputs.parameters.tmp-pvc-name {{ "}}" }}"
{{- end }}
inputs:
parameters:
- name: repo-url
- name: repo-branch
- name: updatecli-compose-file
{{- if $.Values.persistence.enabled }}
- name: tmp-pvc-name
{{- end }}
containerSet:
volumeMounts:
- mountPath: /workspace
Expand Down Expand Up @@ -55,6 +67,11 @@ spec:
# {{- end }}
resources:
{{- toYaml $.Values.resources | nindent 14 }}
{{- if $.Values.persistence.enabled }}
volumeMounts:
- mountPath: /tmp/updatecli
name: updatecli-tmp
{{- end }}
args:
- |
cd /workspace
Expand Down Expand Up @@ -123,4 +140,8 @@ spec:
value: "{{ $workflow.branch }}"
- name: updatecli-compose-file
value: "{{ $workflow.composefile }}"
{{- if $.Values.persistence.enabled }}
- name: tmp-pvc-name
value: "{{ include "udash.fullname" $ }}-workflow-{{ $id }}"
{{- end }}
#{{ end }}
9 changes: 9 additions & 0 deletions charts/udash-agent/templates/cronjob-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,20 @@ spec:
- name: "config"
mountPath: "/etc/updatecli/"
readonly: true
{{- if $.Values.persistence.enabled }}
- name: updatecli-tmp
mountPath: /tmp/updatecli
{{- end }}

volumes:
- name: config
configMap:
name: '{{ include "udash.configMapName" $ }}-agent-{{ $id }}'
{{- if $.Values.persistence.enabled }}
- name: updatecli-tmp
persistentVolumeClaim:
claimName: '{{ include "udash.fullname" $ }}-agent-{{ $id }}'
{{- end }}
{{- with $.Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
24 changes: 24 additions & 0 deletions charts/udash-agent/templates/pvc-agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if $.Values.persistence.enabled }}
{{ range $id, $agent := .Values.agents }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "udash.fullname" $ }}-agent-{{ $id }}
labels:
{{- include "udash.labels" $ | nindent 4 }}
{{- with $.Values.persistence.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
accessModes:
{{- toYaml $.Values.persistence.accessModes | nindent 4 }}
resources:
requests:
storage: {{ $.Values.persistence.size }}
{{- if $.Values.persistence.storageClassName }}
storageClassName: {{ $.Values.persistence.storageClassName }}
{{- end }}
{{- end }}
{{- end }}
24 changes: 24 additions & 0 deletions charts/udash-agent/templates/pvc-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- if and $.Values.persistence.enabled $.Values.workflows }}
{{ range $id, $workflow := .Values.workflows }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "udash.fullname" $ }}-workflow-{{ $id }}
labels:
{{- include "udash.labels" $ | nindent 4 }}
{{- with $.Values.persistence.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
accessModes:
{{- toYaml $.Values.persistence.accessModes | nindent 4 }}
resources:
requests:
storage: {{ $.Values.persistence.size }}
{{- if $.Values.persistence.storageClassName }}
storageClassName: {{ $.Values.persistence.storageClassName }}
{{- end }}
{{- end }}
{{- end }}
13 changes: 13 additions & 0 deletions charts/udash-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,19 @@ autoscaling:
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

persistence:
# -- Enable a PersistentVolumeClaim to persist the Updatecli tmp folder (`/tmp/updatecli`) across executions. One PVC is created per agent CronJob and per Argo workflow entry.
enabled: false
# -- Storage class name for the PersistentVolumeClaim. Leave empty to use the cluster default.
storageClassName: ""
# -- Access modes for the PersistentVolumeClaim.
accessModes:
- ReadWriteOnce
# -- Size of the PersistentVolumeClaim.
size: 1Gi
# -- Annotations to add to the PersistentVolumeClaim.
annotations: {}

# -- Node selector for pod scheduling.
nodeSelector: {}
# -- Tolerations for pod scheduling.
Expand Down