Previously Valkey ran as a sidecar container in the main deployment, causing it to restart every time the web app deployed. This resulted in connection errors and cache loss during deployments. Changes: - Created valkey-statefulset.yaml with StatefulSet resource (1 replica) - Created valkey-service.yaml with headless service - Removed Valkey sidecar container from deployment.yaml - Updated REDIS_HOST from 127.0.0.1 to valkey-0.valkey.towerops.svc.cluster.local - Added new resources to kustomization.yaml Benefits: - Valkey persists across web app deployments - No connection errors during rolling updates - Cache data preserved - Independent scaling and resource management
13 lines
301 B
YAML
13 lines
301 B
YAML
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
kind: Kustomization
|
|
namespace: towerops
|
|
resources:
|
|
- namespace.yaml
|
|
- deployment.yaml
|
|
- service.yaml
|
|
- service-headless.yaml
|
|
- valkey-statefulset.yaml
|
|
- valkey-service.yaml
|
|
- certificate.yaml
|
|
- ingressroute.yaml
|
|
- poddisruptionbudget.yaml
|