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
59 changes: 3 additions & 56 deletions .github/workflows/helm-install-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,58 +71,6 @@ jobs:
EOF
kubectl wait --for=condition=ready pod -l app=minio -n s3proxy --timeout=120s

- name: Deploy Redis with password
run: |
# Create Redis password secret
kubectl create secret generic redis-secret \
--from-literal=redis-password=testredispassword123 \
-n s3proxy

cat <<EOF | kubectl apply -n s3proxy -f -
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis:7-alpine
command: ["redis-server"]
args: ["--requirepass", "\$(REDIS_PASSWORD)"]
env:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: redis-secret
key: redis-password
ports:
- containerPort: 6379
resources:
limits:
memory: 128Mi
cpu: 100m
---
apiVersion: v1
kind: Service
metadata:
name: redis
spec:
selector:
app: redis
ports:
- port: 6379
EOF
kubectl wait --for=condition=ready pod -l app=redis -n s3proxy --timeout=120s

- name: Create K8s Image Pull Secret & Patch Namespace
run: |
# 1. Create the secret using the workflow token
Expand Down Expand Up @@ -150,10 +98,9 @@ jobs:
--set secrets.credentials[0].accessKey=minioadmin \
--set secrets.credentials[0].secretKey=minioadmin \
--set secrets.credentials[0].kek=test-encryption-key-for-ci \
--set redis-ha.enabled=false \
--set externalRedis.url="redis://redis:6379/0" \
--set externalRedis.existingSecret=redis-secret \
--set externalRedis.passwordKey=redis-password \
--set redis.enabled=true \
--set redis.auth.enabled=true \
--set redis.auth.password=testredispassword123 \
--set admin.enabled=true \
--set admin.secret=test-admin-secret-for-ci \
--set frontproxy.enabled=true \
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ S3's server-side encryption is great, but your cloud provider holds the keys. S3
<img src="https://img.shields.io/badge/✓_Streaming_I/O-00d4aa?style=flat-square" alt="Streaming">
<img src="https://img.shields.io/badge/✓_Multipart_Uploads-00d4aa?style=flat-square" alt="Multipart">
<img src="https://img.shields.io/badge/✓_SigV4_Auth-00d4aa?style=flat-square" alt="SigV4">
<img src="https://img.shields.io/badge/✓_Redis_HA-00d4aa?style=flat-square" alt="Redis HA">
<img src="https://img.shields.io/badge/✓_Distributed_State-00d4aa?style=flat-square" alt="Distributed State">
<img src="https://img.shields.io/badge/✓_Horizontal_Scaling-00d4aa?style=flat-square" alt="Scaling">
</p>

Expand Down Expand Up @@ -130,7 +130,7 @@ A request signed by an access key with no configured KEK is rejected. Via Helm:
| `secrets.credentials` | `[]` | AWS credentials, each `{accessKey, secretKey, kek}` |
| `secrets.existingSecrets.enabled` | `false` | Use existing K8s secret |
| `admin.secret` | `change-me` | Secret signing admin session cookies (when admin UI on) |
| `redis-ha.enabled` | `true` | Deploy embedded Redis HA |
| `redis.enabled` | `true` | Deploy the bundled single Redis pod (transient upload state) |
| `frontproxy.enabled` | `false` | Bundled HAProxy for even load distribution (no external dependency) |
| `ingress.enabled` | `false` | Expose S3 outside the cluster via Ingress (requires `frontproxy.enabled`) |
| `performance.memoryLimitMb` | `64` | Memory budget for streaming concurrency |
Expand All @@ -153,7 +153,7 @@ Data written by that credential is unrecoverable. Each object records the access

<details>
<summary><strong>What if Redis fails mid-upload?</strong></summary>
Upload fails and must restart. Use <code>redis-ha.enabled=true</code> with persistence.
Only in-flight multipart uploads are affected — they fail and must restart. No committed object is ever at risk, since Redis holds only transient, TTL'd upload state. For extra resilience, point <code>externalRedis.url</code> at your own HA Redis and set <code>redis.enabled=false</code>.
</details>

<details>
Expand Down
6 changes: 0 additions & 6 deletions chart/Chart.lock

This file was deleted.

6 changes: 0 additions & 6 deletions chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,3 @@ description: Transparent S3 encryption proxy with AES-256-GCM
type: application
version: 2026.2.0
appVersion: "2026.2.0"

dependencies:
- name: redis-ha
version: 4.35.10
repository: "https://dandydeveloper.github.io/charts"
condition: redis-ha.enabled
15 changes: 8 additions & 7 deletions chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,14 @@ helm install s3proxy oci://ghcr.io/serversidehannes/s3proxy-python/charts/s3prox
| `admin.ingress.host` | `""` | Hostname for the dashboard (required when enabled) |
| `admin.ingress.annotations` | `{}` | Annotations (e.g. IP allowlist) for the admin Ingress |
| `admin.ingress.tls` | `[]` | TLS config for the admin Ingress |
| `redis-ha.enabled` | `true` | Deploy embedded Redis HA |
| `redis-ha.replicas` | `1` | Redis replicas |
| `redis-ha.auth` | `false` | Enable Redis auth |
| `redis-ha.haproxy.enabled` | `true` | Deploy HAProxy for Redis |
| `redis-ha.persistentVolume.enabled` | `true` | Persistent storage |
| `redis-ha.persistentVolume.size` | `10Gi` | Volume size |
| `externalRedis.url` | `""` | External Redis URL |
| `redis.enabled` | `true` | Deploy the bundled single Redis pod (transient upload state) |
| `redis.image.repository` | `redis` | Redis image (bump manually; not tracked by dependabot) |
| `redis.image.tag` | `7-alpine` | Redis image tag |
| `redis.auth.enabled` | `false` | Require a password on the bundled Redis |
| `redis.auth.password` | `""` | Password (when auth enabled and no existingSecret) |
| `redis.auth.existingSecret` | `""` | Use a pre-created Secret for the Redis password |
| `redis.auth.passwordKey` | `redis-password` | Key name in the Redis password Secret |
| `externalRedis.url` | `""` | External Redis URL (used when `redis.enabled=false`) |
| `externalRedis.uploadTtlHours` | `24` | Upload state TTL |
| `externalRedis.existingSecret` | `""` | K8s secret with Redis password |
| `externalRedis.passwordKey` | `redis-password` | Key name in Redis secret |
Expand Down
4 changes: 2 additions & 2 deletions chart/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ data:
S3PROXY_PORT: {{ .Values.server.port | quote }}
S3PROXY_NO_TLS: {{ .Values.server.noTls | quote }}
S3PROXY_MEMORY_LIMIT_MB: {{ .Values.performance.memoryLimitMb | quote }}
{{- if index .Values "redis-ha" "enabled" }}
S3PROXY_REDIS_URL: "redis://{{ .Release.Name }}-redis-ha-haproxy:6379/0"
{{- if .Values.redis.enabled }}
S3PROXY_REDIS_URL: "redis://{{ .Chart.Name }}-redis:{{ .Values.redis.port }}/0"
{{- else }}
S3PROXY_REDIS_URL: {{ .Values.externalRedis.url | quote }}
{{- end }}
Expand Down
20 changes: 10 additions & 10 deletions chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ spec:
is set, or the app uses an existing secret so envFrom never fires). */ -}}
{{- $adminFromChartSecret := and .Values.admin.enabled (not .Values.admin.existingSecret.name) (not .Values.secrets.existingSecrets.enabled) }}
{{- $adminNeedsEnv := and .Values.admin.enabled (not $adminFromChartSecret) }}
{{- /* Redis password is needed when the bundled Redis has auth on, or
external Redis is used with an existing secret. */ -}}
{{- $redisAuth := and .Values.redis.enabled .Values.redis.auth.enabled }}
{{- $extRedisAuth := and (not .Values.redis.enabled) .Values.externalRedis.existingSecret }}
{{- /* Determine if we need env section */ -}}
{{- $needsEnv := or .Values.secrets.existingSecrets.enabled $adminNeedsEnv (and (index .Values "redis-ha" "enabled") (index .Values "redis-ha" "auth")) (and (not (index .Values "redis-ha" "enabled")) .Values.externalRedis.existingSecret) }}
{{- $needsEnv := or .Values.secrets.existingSecrets.enabled $adminNeedsEnv $redisAuth $extRedisAuth }}
{{- if $needsEnv }}
env:
{{- /* App secrets from existing secret */ -}}
Expand Down Expand Up @@ -66,19 +70,15 @@ spec:
name: {{ $adminSecret }}
key: {{ .Values.admin.existingSecret.secretKey }}
{{- end }}
{{- /* Redis password from redis-ha secret */ -}}
{{- if and (index .Values "redis-ha" "enabled") (index .Values "redis-ha" "auth") }}
{{- /* Redis password from the bundled Redis secret */ -}}
{{- if $redisAuth }}
- name: S3PROXY_REDIS_PASSWORD
valueFrom:
secretKeyRef:
{{- if index .Values "redis-ha" "existingSecret" }}
name: {{ index .Values "redis-ha" "existingSecret" }}
{{- else }}
name: {{ .Release.Name }}-redis-ha
{{- end }}
key: {{ index .Values "redis-ha" "authKey" | default "auth" }}
name: {{ .Values.redis.auth.existingSecret | default (printf "%s-redis" .Chart.Name) }}
key: {{ .Values.redis.auth.passwordKey }}
{{- /* Redis password from external Redis secret */ -}}
{{- else if and (not (index .Values "redis-ha" "enabled")) .Values.externalRedis.existingSecret }}
{{- else if $extRedisAuth }}
- name: S3PROXY_REDIS_PASSWORD
valueFrom:
secretKeyRef:
Expand Down
4 changes: 3 additions & 1 deletion chart/templates/frontproxy-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ data:
balance leastconn
# Per-request balancing: don't pin a client to one server, and re-resolve the
# headless Service via DNS so new/restarted pods are picked up automatically.
# Use the FQDN: HAProxy's resolver does NOT apply /etc/resolv.conf search
# domains, so a bare service name NXDOMAINs and leaves 0 backends (503 <NOSRV>).
option redispatch
server-template pod 1-{{ int .Values.replicaCount }} {{ .Chart.Name }}-headless:{{ .Values.service.port }} check resolvers k8s init-addr none
server-template pod 1-{{ int .Values.replicaCount }} {{ .Chart.Name }}-headless.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.service.port }} check resolvers k8s init-addr none

resolvers k8s
parse-resolv-conf
Expand Down
1 change: 1 addition & 0 deletions chart/templates/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ spec:
selector:
matchLabels:
{{- include "s3proxy.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: server
{{- end }}
81 changes: 81 additions & 0 deletions chart/templates/redis/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{{- if .Values.redis.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Chart.Name }}-redis
labels:
{{- include "s3proxy.labels" . | nindent 4 }}
app.kubernetes.io/component: redis
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
{{- include "s3proxy.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: redis
template:
metadata:
labels:
{{- include "s3proxy.labels" . | nindent 8 }}
app.kubernetes.io/component: redis
spec:
containers:
- name: redis
image: "{{ .Values.redis.image.repository }}:{{ .Values.redis.image.tag }}"
imagePullPolicy: {{ .Values.redis.image.pullPolicy }}
args:
- "--maxmemory"
- {{ .Values.redis.maxmemory | quote }}
- "--maxmemory-policy"
- {{ .Values.redis.maxmemoryPolicy | quote }}
{{- if .Values.redis.auth.enabled }}
- "--requirepass"
- "$(REDIS_PASSWORD)"
{{- end }}
{{- if .Values.redis.auth.enabled }}
env:
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.redis.auth.existingSecret | default (printf "%s-redis" .Chart.Name) }}
key: {{ .Values.redis.auth.passwordKey }}
{{- end }}
ports:
- name: redis
containerPort: {{ .Values.redis.port }}
protocol: TCP
livenessProbe:
tcpSocket:
port: redis
initialDelaySeconds: 5
periodSeconds: 10
readinessProbe:
exec:
command:
- sh
- -c
{{- if .Values.redis.auth.enabled }}
- 'redis-cli -a "$REDIS_PASSWORD" ping | grep -q PONG'
{{- else }}
- 'redis-cli ping | grep -q PONG'
{{- end }}
initialDelaySeconds: 2
periodSeconds: 5
resources:
{{- toYaml .Values.redis.resources | nindent 12 }}
securityContext:
runAsNonRoot: true
runAsUser: 999
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
emptyDir: {}
{{- end }}
15 changes: 15 additions & 0 deletions chart/templates/redis/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if and .Values.redis.enabled .Values.redis.auth.enabled (not .Values.redis.auth.existingSecret) }}
{{- if not .Values.redis.auth.password }}
{{- fail "redis.auth.enabled is true but redis.auth.password is empty — set a password or point redis.auth.existingSecret at your own Secret" }}
{{- end }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Chart.Name }}-redis
labels:
{{- include "s3proxy.labels" . | nindent 4 }}
app.kubernetes.io/component: redis
type: Opaque
stringData:
{{ .Values.redis.auth.passwordKey }}: {{ .Values.redis.auth.password | quote }}
{{- end }}
19 changes: 19 additions & 0 deletions chart/templates/redis/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.redis.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ .Chart.Name }}-redis
labels:
{{- include "s3proxy.labels" . | nindent 4 }}
app.kubernetes.io/component: redis
spec:
type: ClusterIP
selector:
{{- include "s3proxy.selectorLabels" . | nindent 4 }}
app.kubernetes.io/component: redis
ports:
- name: redis
port: {{ .Values.redis.port }}
targetPort: redis
protocol: TCP
{{- end }}
Loading