No description
  • Go 98.9%
  • Earthly 1.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sheogorath e03928dc41 Merge branch 'renovate/sigs.k8s.io-controller-runtime-0.x' into 'main'
fix(deps): update module sigs.k8s.io/controller-runtime to v0.24.1

See merge request shivering-isles/s3-controller!10
2026-07-06 16:59:28 +02:00
admin ci: Fix golangci-lint findings 2026-07-02 03:00:45 +02:00
api/v1alpha1 fix(deps): update module sigs.k8s.io/controller-runtime to v0.24.1 2026-07-06 16:47:05 +02:00
controller ci: Fix golangci-lint findings 2026-07-02 03:00:45 +02:00
crds Initial Commit 2026-07-02 02:49:01 +02:00
examples Initial Commit 2026-07-02 02:49:01 +02:00
policy ci: Fix golangci-lint findings 2026-07-02 03:00:45 +02:00
s3client Initial Commit 2026-07-02 02:49:01 +02:00
vendor fix(deps): update module sigs.k8s.io/controller-runtime to v0.24.1 2026-07-06 16:47:05 +02:00
.gitignore Initial Commit 2026-07-02 02:49:01 +02:00
.gitlab-ci.yml chore(deps): update ghcr.io/ko-build/ko docker tag to v0.19.1 2026-07-06 06:18:22 +00:00
.golangci.yaml Initial Commit 2026-07-02 02:49:01 +02:00
.ko.yaml fix: Simplify ko config 2026-07-02 04:25:09 +02:00
.semrelrc Initial Commit 2026-07-02 02:49:01 +02:00
Earthfile Initial Commit 2026-07-02 02:49:01 +02:00
go.mod fix(deps): update module sigs.k8s.io/controller-runtime to v0.24.1 2026-07-06 16:47:05 +02:00
go.sum fix(deps): update module sigs.k8s.io/controller-runtime to v0.24.1 2026-07-06 16:47:05 +02:00
main.go ci: Fix golangci-lint findings 2026-07-02 03:00:45 +02:00
README.md Initial Commit 2026-07-02 02:49:01 +02:00
renovate.json fix(config): migrate config renovate.json 2026-07-06 07:13:48 +00:00

s3-controller

A Kubernetes controller that manages S3 buckets and their associated credentials as custom resources (S3Bucket) using VersityGW as the S3 backend.

CRDs

The CRD is defined in crds/s3bucket.yaml:

  • Group: s3.shivering-isles.com
  • Kind: S3Bucket
  • Plural: s3buckets
  • Short names: s3b

Install it:

kubectl apply -f crds/

Examples

See examples/ for sample S3Bucket resources:

File Policy Use case
s3bucket-readwrite.yaml readWrite Application with full bucket access
s3bucket-readonly.yaml readWritePublicRead Public assets bucket
s3bucket-custom-policy.yaml Custom JSON Cross-user access
kubectl apply -f examples/s3bucket-readwrite.yaml

Functionality

  • Creates S3 users and buckets on demand
  • Manages bucket policies (read-write, read-write + public read, or custom S3 bucket policy JSON)
  • Stores credentials in Kubernetes secrets
  • Handles graceful deletion with exponential backoff for non-empty buckets
  • Supports Delete and Retain deletion policies

Local development

# Run tests
go test -mod=vendor ./...

# Build binary
CGO_ENABLED=0 go build -mod=vendor -o s3-controller .

Required environment variables

Variable Description
S3_ENDPOINT S3 endpoint URL
S3_ACCESS_KEY Admin access key
S3_SECRET_KEY Admin secret key
S3_REGION S3 region (default: us-east-1)

Deployment

Production Kubernetes manifests are maintained in the infrastructure-gitops repository under apps/base/s3-controller/. For local development, apply the CRDs and run the controller binary directly.