Skip to content

Commit

Permalink
helm: clean up logic for autodelete pvcs (grafana#6042)
Browse files Browse the repository at this point in the history
* helm: clean up logic for autodelete pvcs

* remove flag

* changelog
  • Loading branch information
captncraig authored and BarunKGP committed Feb 20, 2024
1 parent e89b864 commit 2266859
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions operations/helm/charts/grafana-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ Unreleased

- Update `rbac` to include necessary rules for the `otelcol.processor.k8sattributes` component. (@rlankfo)

### Bugfixes

- Statefulset should use value `.controller.enableStatefulSetAutoDeletePVC` instead of just `.enableStatefulSetAutoDeletePVC`. (@captncraig)

0.29.0 (2023-11-30)
-------------------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ controller:
type: statefulset
autoscaling:
enabled: true
enableStatefulSetAutoDeletePVC: true
agent:
resources:
requests:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{{- if eq .Values.controller.type "statefulset" }}
{{- if .Values.enableStatefulSetAutoDeletePVC }}
{{- fail "Value 'enableStatefulSetAutoDeletePVC' should be nested inside 'controller' options." }}
{{- end }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
Expand Down Expand Up @@ -35,8 +38,8 @@ spec:
- {{ toYaml . | nindent 6 }}
{{- end }}
{{- end }}
{{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.enableStatefulSetAutoDeletePVC) }}
{{/*
{{- if and (semverCompare ">= 1.23-0" .Capabilities.KubeVersion.Version) (.Values.controller.enableStatefulSetAutoDeletePVC) }}
{{- /*
Data on the read nodes is easy to replace, so we want to always delete PVCs to make
operation easier, and will rely on re-fetching data when needed.
*/}}
Expand Down
2 changes: 1 addition & 1 deletion operations/helm/scripts/rebuild-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ for chart_file in $(find * -name Chart.yaml -print | sort); do
FILENAME=$(basename ${FILE_PATH})
TESTNAME=${FILENAME%-values.yaml}
# Render chart
helm template --namespace default --debug ${CHART_NAME} ${CHART_DIR} -f ${FILE_PATH} --output-dir ${TEST_DIR}/${TESTNAME} --set '$chart_tests=true'
helm template --namespace default --kube-version 1.26 --debug ${CHART_NAME} ${CHART_DIR} -f ${FILE_PATH} --output-dir ${TEST_DIR}/${TESTNAME} --set '$chart_tests=true'
done
fi
done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,6 @@ spec:
- name: config
configMap:
name: grafana-agent
persistentVolumeClaimRetentionPolicy:
whenDeleted: Delete
whenScaled: Delete

0 comments on commit 2266859

Please sign in to comment.