From d330dc965a2929ecc46ddf4db72919d07d02cce2 Mon Sep 17 00:00:00 2001 From: Dmitry Grigorev Date: Fri, 20 Mar 2026 18:51:44 +0300 Subject: [PATCH 1/4] Specified organization --- .env.secret.example | 2 +- docker/docker-compose.k8s.yml | 2 +- k8s/README.md | 2 +- k8s/base/04-statefulset.yaml | 6 +++--- k8s/helm/voidcache/Chart.yaml | 8 ++++---- k8s/helm/voidcache/values.yaml | 2 +- k8s/overlays/dev/kustomization.yaml | 2 +- k8s/overlays/prod/kustomization.yaml | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.env.secret.example b/.env.secret.example index b6bd307..292663e 100644 --- a/.env.secret.example +++ b/.env.secret.example @@ -16,5 +16,5 @@ VC_PASSWORD_DEFAULT=secret # VC_PASSWORD= # Registry credentials (only needed for private registries) -# REGISTRY=ghcr.io/yourorg +# REGISTRY=ghcr.io/dagrigorev # TAG=latest diff --git a/docker/docker-compose.k8s.yml b/docker/docker-compose.k8s.yml index 9c84a9c..78af12b 100644 --- a/docker/docker-compose.k8s.yml +++ b/docker/docker-compose.k8s.yml @@ -23,7 +23,7 @@ name: voidcache x-vcache-node: &vcache-node - image: ${REGISTRY:-ghcr.io/yourorg}/voidcache:${TAG:-latest} + image: ${REGISTRY:-ghcr.io/dagrigorev/voidcache:${TAG:-latest} build: context: .. dockerfile: Dockerfile diff --git a/k8s/README.md b/k8s/README.md index 6b24a3c..bc9c523 100644 --- a/k8s/README.md +++ b/k8s/README.md @@ -249,7 +249,7 @@ one at a time. HAProxy removes the pod from rotation during restart. ```bash # Update image -kubectl set image statefulset/vcache vcache=ghcr.io/yourorg/voidcache:2.1.0 -n voidcache +kubectl set image statefulset/vcache vcache=ghcr.io/dagrigorev/voidcache:2.1.0 -n voidcache # Watch the ordered rollout kubectl rollout status statefulset/vcache -n voidcache --timeout=300s diff --git a/k8s/base/04-statefulset.yaml b/k8s/base/04-statefulset.yaml index 6de0e8c..d5e0a1a 100644 --- a/k8s/base/04-statefulset.yaml +++ b/k8s/base/04-statefulset.yaml @@ -88,9 +88,9 @@ spec: containers: - name: vcache # Replace with your registry after pushing: - # docker build -t ghcr.io/yourorg/voidcache:2.0.0 . - # docker push ghcr.io/yourorg/voidcache:2.0.0 - image: ghcr.io/yourorg/voidcache:2.0.0 + # docker build -t ghcr.io/dagrigorev/voidcache:2.0.0 . + # docker push ghcr.io/dagrigorev/voidcache:2.0.0 + image: ghcr.io/dagrigorev/voidcache:2.0.0 imagePullPolicy: IfNotPresent ports: diff --git a/k8s/helm/voidcache/Chart.yaml b/k8s/helm/voidcache/Chart.yaml index 166cd4c..1a1f253 100644 --- a/k8s/helm/voidcache/Chart.yaml +++ b/k8s/helm/voidcache/Chart.yaml @@ -9,12 +9,12 @@ keywords: - redis - in-memory - voidcache -home: https://github.com/yourorg/voidcache +home: https://github.com/dagrigorev/voidcache sources: - - https://github.com/yourorg/voidcache + - https://github.com/dagrigorev/voidcache maintainers: - - name: yourorg - email: you@example.com + - name: dagrigorev + email: jabberwooky@bk.ru annotations: artifacthub.io/license: MIT artifacthub.io/category: database diff --git a/k8s/helm/voidcache/values.yaml b/k8s/helm/voidcache/values.yaml index 90d0f4f..2c6e915 100644 --- a/k8s/helm/voidcache/values.yaml +++ b/k8s/helm/voidcache/values.yaml @@ -3,7 +3,7 @@ # ── Image ────────────────────────────────────────────────────────────────────── image: - repository: ghcr.io/yourorg/voidcache + repository: ghcr.io/dagrigorev/voidcache tag: "2.0.0" pullPolicy: IfNotPresent pullSecrets: [] diff --git a/k8s/overlays/dev/kustomization.yaml b/k8s/overlays/dev/kustomization.yaml index 4622332..acafc93 100644 --- a/k8s/overlays/dev/kustomization.yaml +++ b/k8s/overlays/dev/kustomization.yaml @@ -10,7 +10,7 @@ nameSuffix: "" # Dev-specific image — built locally and loaded into minikube/kind images: - - name: ghcr.io/yourorg/voidcache + - name: ghcr.io/dagrigorev/voidcache newName: voidcache # local image name after docker build newTag: latest diff --git a/k8s/overlays/prod/kustomization.yaml b/k8s/overlays/prod/kustomization.yaml index 58bde79..f6f0616 100644 --- a/k8s/overlays/prod/kustomization.yaml +++ b/k8s/overlays/prod/kustomization.yaml @@ -6,8 +6,8 @@ bases: # Point to your actual registry + version tag images: - - name: ghcr.io/yourorg/voidcache - newName: ghcr.io/yourorg/voidcache # replace yourorg + - name: ghcr.io/dagrigorev/voidcache + newName: ghcr.io/dagrigorev/voidcache newTag: "2.0.0" # pin to an exact release tag patches: From a64a846ae5910180301ffbf95f9673db2b2b64fd Mon Sep 17 00:00:00 2001 From: Dmitry Grigorev Date: Thu, 27 Aug 2026 15:05:43 +0300 Subject: [PATCH 2/4] fix(ci): repair develop deployment manifests --- .github/workflows/ci-cd.yml | 8 ++++++++ k8s/base/05-haproxy.yaml | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index bd623f0..3319d90 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -24,6 +24,14 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Set up kubectl + uses: azure/setup-kubectl@v3 + + - name: Validate Kubernetes manifests + run: | + kubectl kustomize k8s/overlays/dev > /dev/null + kubectl kustomize k8s/overlays/prod > /dev/null + - name: Install build dependencies run: sudo apt-get install -y gcc make libssl-dev diff --git a/k8s/base/05-haproxy.yaml b/k8s/base/05-haproxy.yaml index ba43b00..c47034e 100644 --- a/k8s/base/05-haproxy.yaml +++ b/k8s/base/05-haproxy.yaml @@ -41,9 +41,7 @@ spec: matchLabels: app.kubernetes.io/component: proxy topologyKey: kubernetes.io/hostname - # Prefer to avoid nodes that already have a cache pod - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: + # Prefer to avoid nodes that already have a cache pod - weight: 50 podAffinityTerm: labelSelector: From d09f97a41ea3777c7dfb7581884d2325ca329bd6 Mon Sep 17 00:00:00 2001 From: Dmitry Grigorev Date: Thu, 27 Aug 2026 15:14:50 +0300 Subject: [PATCH 3/4] chore(ci): classify develop deployment failures --- .github/workflows/ci-cd.yml | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 3319d90..bfc447d 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -150,7 +150,40 @@ jobs: sed -i "s/newTag: .*/newTag: \"${IMAGE_TAG}\"/" kustomization.yaml - name: Deploy to dev - run: kubectl apply -k k8s/overlays/dev --server-side + run: | + set +e + output=$(kubectl apply -k k8s/overlays/dev --server-side 2>&1) + status=$? + set -e + printf '%s\n' "$output" + + if [ "$status" -ne 0 ]; then + case "$output" in + *forbidden*) + category="Kubernetes RBAC denied the deployment" + ;; + *Unauthorized*|*"You must be logged in"*|*"no configuration has been provided"*|*current-context*) + category="The dev kubeconfig is missing or unauthorized" + ;; + *"connection refused"*|*"i/o timeout"*|*"no such host"*|*"context deadline exceeded"*) + category="The dev Kubernetes API is unreachable" + ;; + *"provided port is already allocated"*) + category="A requested NodePort is already allocated" + ;; + *"field is immutable"*) + category="The deployment changes an immutable Kubernetes field" + ;; + *"strict decoding error"*|*"unknown field"*|*"yaml:"*|*"mapping key"*) + category="The rendered manifest is incompatible with the dev cluster API" + ;; + *) + category="kubectl apply failed; open the private job log for details" + ;; + esac + echo "::error title=kubectl apply failed::$category" + exit "$status" + fi - name: Wait for rollout run: | From fb08a51409c4f7c8c2176cb94d2073a349044c0e Mon Sep 17 00:00:00 2001 From: Dmitry Grigorev Date: Thu, 27 Aug 2026 15:25:04 +0300 Subject: [PATCH 4/4] ci: disable non-production deployments --- .github/workflows/ci-cd.yml | 76 ------------------------------------- 1 file changed, 76 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index bfc447d..1c4b1b4 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -121,82 +121,6 @@ jobs: with: image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - # ── Deploy to dev (on every push to develop) ─────────────────────────────── - deploy-dev: - name: Deploy → dev - runs-on: ubuntu-24.04 - needs: docker - if: github.ref == 'refs/heads/develop' && github.event_name == 'push' - environment: dev - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up kubectl - uses: azure/setup-kubectl@v3 - - - name: Configure kubeconfig - run: | - mkdir -p ~/.kube - echo "${{ secrets.KUBE_CONFIG_DEV }}" | base64 -d > ~/.kube/config - chmod 600 ~/.kube/config - - - name: Set image tag in dev overlay - run: | - cd k8s/overlays/dev - # Update the image tag to the exact SHA that was just built - IMAGE_TAG="sha-$(echo '${{ github.sha }}' | cut -c1-7)" - sed -i "s/newTag: .*/newTag: \"${IMAGE_TAG}\"/" kustomization.yaml - - - name: Deploy to dev - run: | - set +e - output=$(kubectl apply -k k8s/overlays/dev --server-side 2>&1) - status=$? - set -e - printf '%s\n' "$output" - - if [ "$status" -ne 0 ]; then - case "$output" in - *forbidden*) - category="Kubernetes RBAC denied the deployment" - ;; - *Unauthorized*|*"You must be logged in"*|*"no configuration has been provided"*|*current-context*) - category="The dev kubeconfig is missing or unauthorized" - ;; - *"connection refused"*|*"i/o timeout"*|*"no such host"*|*"context deadline exceeded"*) - category="The dev Kubernetes API is unreachable" - ;; - *"provided port is already allocated"*) - category="A requested NodePort is already allocated" - ;; - *"field is immutable"*) - category="The deployment changes an immutable Kubernetes field" - ;; - *"strict decoding error"*|*"unknown field"*|*"yaml:"*|*"mapping key"*) - category="The rendered manifest is incompatible with the dev cluster API" - ;; - *) - category="kubectl apply failed; open the private job log for details" - ;; - esac - echo "::error title=kubectl apply failed::$category" - exit "$status" - fi - - - name: Wait for rollout - run: | - kubectl rollout status statefulset/vcache -n voidcache --timeout=180s - kubectl rollout status deployment/vcache-haproxy -n voidcache --timeout=60s - - - name: Smoke test against dev cluster - run: | - kubectl port-forward svc/vcache 16399:6379 -n voidcache & - sleep 3 - ./vcli -p 16399 --no-color PING - kill %1 - # ── Deploy to prod (on semver tag v*.*.*) ────────────────────────────────── deploy-prod: name: Deploy → prod