Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: pgdog-control
description: PgDog Control
type: application
version: 0.4.1
version: 0.4.2
appVersion: "main-ent"
3 changes: 3 additions & 0 deletions templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ spec:
# pods.
checksum/aws-creds: {{ include (print $.Template.BasePath "/aws-secret.yaml") . | sha256sum }}
{{- end }}
{{- with .Values.control.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "pgdog-control.selectorLabels" . | nindent 8 }}
spec:
Expand Down
15 changes: 15 additions & 0 deletions test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,20 @@ for conflict in "control.rbac.create=true" "control.aws.roleArn=arn:aws:iam::123
fi
done

echo ""
echo "==> Verifying control pod annotations..."
annotations=$(helm template test-release "$CHART_DIR" -f "$TEST_DIR/values-pod-annotations.yaml" \
| yq -o=json -I=0 'select(.kind == "Deployment" and .metadata.name == "test-release-control") | .spec.template.metadata.annotations | with_entries(select(.key | test("^checksum/") | not))')
if [ "$annotations" != '{"meta.helm.sh/release-name":"test-release","meta.helm.sh/release-namespace":"default","karpenter.sh/do-not-disrupt":"24h"}' ]; then
echo "control.podAnnotations not rendered on the control pods: $annotations" >&2
exit 1
fi
raft_annotation=$(helm template test-release "$CHART_DIR" -f "$TEST_DIR/values-raft.yaml" -f "$TEST_DIR/values-pod-annotations.yaml" \
| yq -r 'select(.kind == "StatefulSet") | .spec.template.metadata.annotations."karpenter.sh/do-not-disrupt"')
if [ "$raft_annotation" != "24h" ]; then
echo "control.podAnnotations not rendered on the raft StatefulSet pods: $raft_annotation" >&2
exit 1
fi

echo ""
echo "==> All chart tests passed!"
4 changes: 4 additions & 0 deletions test/values-pod-annotations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Extra annotations on the control pods.
control:
podAnnotations:
karpenter.sh/do-not-disrupt: "24h"
2 changes: 2 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ control:
limits:
memory: "4Gi"
cpu: "1000m"
# Extra annotations on the control pods, e.g. karpenter.sh/do-not-disrupt.
podAnnotations: {}
# Pod-level securityContext for the control deployment.
# Defaults are PSS Restricted compliant.
podSecurityContext:
Expand Down
Loading