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
23 changes: 16 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ jobs:
name: docker (build and push)
runs-on: ubuntu-latest
needs: [go]
# if: github.event_name != 'pull_request'

permissions:
contents: read
Expand Down Expand Up @@ -82,10 +81,10 @@ jobs:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=sha,format=short,prefix=0.1.0-
type=sha,format=short,prefix=0.1.0-c
type=ref,event=tag

- name: Build and push
- name: Build and push docker image
uses: docker/build-push-action@v6
with:
context: .
Expand Down Expand Up @@ -159,13 +158,23 @@ jobs:
mkdir -p dist
helm package helm \
--destination dist \
--version "${{ steps.ver.outputs.version }}" \
--app-version "${{ steps.ver.outputs.version }}"
--version "${{ needs.docker.outputs.docker_image_tag }}" \
--app-version "${{ needs.docker.outputs.docker_image_tag }}"

- name: Push chart to GHCR (OCI)
shell: bash
run: |
set -euo pipefail
OWNER_LC="$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
CHART_TGZ="$(ls -1 dist/cacheppuccino-*.tgz | head -n 1)"
helm push "${CHART_TGZ}" "oci://ghcr.io/${OWNER_LC}"
OCI_REPO="oci://ghcr.io/${OWNER_LC}"
PACKAGE_FILE="$(ls -1 dist/cacheppuccino-*.tgz | head -n 1)"
IMAGE="${{ needs.docker.outputs.docker_image_tag }}"

# Add GitHub Actions summary
echo "# Helm Chart" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```yaml' >> $GITHUB_STEP_SUMMARY
helm push "$PACKAGE_FILE" "$OCI_REPO" 2>> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "> [!Important]" >> $GITHUB_STEP_SUMMARY
echo "> NOTE: Tagged Docker image & Helm chart version: **$IMAGE**" >> $GITHUB_STEP_SUMMARY
12 changes: 12 additions & 0 deletions helm/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Strategy + Azure storage

### Why these errors happen (short)
- `FailedAttachVolume` / `FailedVolumeAttach`: usually occurs when the PVC is backed by ReadWriteOnce (RWO) storage and Kubernetes attempts to start a new Pod before the old Pod has fully released/detached the volume.Because the same volume can’t be attached to two Pods/nodes at once, the attach step fails and the rollout can get stuck.
- `database is locked` (SQLite): after switching the PVC `storageClass` to `azurefile-csi`, the app started hitting SQLite lock errors.

We observed these issues during rollouts on Azure when multiple Pods briefly overlapped.

### Current approach (what we use)
We use `strategy.type: Recreate` so upgrades run only one Pod at a time:
- switched back to the default storage class
- `Recreate` avoids parallel Pod overlap, which prevents volume attach conflicts and reduces the chance of SQLite locking problems
2 changes: 2 additions & 0 deletions helm/snapshots/alpha-1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ metadata:
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: cacheppuccino-helm
Expand Down
5 changes: 3 additions & 2 deletions helm/snapshots/staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ metadata:
app.kubernetes.io/version: "0.1.0"
app.kubernetes.io/managed-by: Helm
spec:
storageClassName: "azurefile-csi"
accessModes:
- ReadWriteMany
- ReadWriteOnce
resources:
requests:
storage: "512Mi"
Expand Down Expand Up @@ -90,6 +89,8 @@ metadata:
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: cacheppuccino-helm
Expand Down
2 changes: 2 additions & 0 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ metadata:
{{- include "cacheppuccino.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: Recreate
selector:
matchLabels:
{{- include "cacheppuccino.selectorLabels" . | nindent 6 }}
Expand Down
2 changes: 1 addition & 1 deletion helm/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
storageClassName: {{ .Values.sqlite.pvc.storageClassName | quote }}
{{- end }}
accessModes:
{{- toYaml .Values.sqlite.pvc.accessModes | nindent 4 }}
- ReadWriteOnce
resources:
requests:
storage: {{ .Values.sqlite.pvc.size | quote }}
Expand Down
3 changes: 0 additions & 3 deletions helm/values/go-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ ingress:
sqlite:
pvc:
size: 512Mi
storageClassName: azurefile-csi
accessModes:
- ReadWriteMany

serviceAccount:
create: true
Expand Down
Loading