Run RustFS (S3)
This assumes you can already reach your cluster with kubectl (see the
kubectl quickstart).
RustFS is an S3-compatible object store. You’ll deploy a single instance in its own namespace, backed by persistent storage so its buckets survive pod restarts. The cluster’s default StorageClass provisions the volume for you.
Deploy
Section titled “Deploy”Create a dedicated namespace:
kubectl create namespace rustfsDeploy RustFS, its storage, and a Service into the namespace:
cat <<'EOF' | kubectl apply -f -apiVersion: v1kind: Secretmetadata: name: rustfs namespace: rustfsstringData: RUSTFS_ACCESS_KEY: rustfsadmin RUSTFS_SECRET_KEY: change-me---apiVersion: v1kind: PersistentVolumeClaimmetadata: name: rustfs namespace: rustfsspec: accessModes: - ReadWriteOnce resources: requests: storage: 10Gi---apiVersion: apps/v1kind: Deploymentmetadata: name: rustfs namespace: rustfsspec: replicas: 1 strategy: type: Recreate selector: matchLabels: app: rustfs template: metadata: labels: app: rustfs spec: securityContext: # RustFS runs as uid/gid 10001; fsGroup lets it write the volume. fsGroup: 10001 containers: - name: rustfs image: rustfs/rustfs:latest envFrom: - secretRef: name: rustfs env: - name: RUSTFS_VOLUMES value: /data - name: RUSTFS_ADDRESS value: 0.0.0.0:9000 - name: RUSTFS_CONSOLE_ENABLE value: "true" - name: RUSTFS_CONSOLE_ADDRESS value: 0.0.0.0:9001 ports: - containerPort: 9000 - containerPort: 9001 volumeMounts: - name: data mountPath: /data volumes: - name: data persistentVolumeClaim: claimName: rustfs---apiVersion: v1kind: Servicemetadata: name: rustfs namespace: rustfsspec: selector: app: rustfs ports: - name: s3 port: 9000 targetPort: 9000 - name: console port: 9001 targetPort: 9001EOFSecurity
Section titled “Security”This Service is ClusterIP, so the store is only reachable from inside the
cluster. On a single-tenant skube cluster that’s the safe default: keep your app
and the store in the cluster and connect over the Service.
If you need to reach it from outside the cluster:
- For occasional access, prefer
kubectl port-forward -n rustfs service/rustfs 9000:9000over a public endpoint. It tunnels through the API server and exposes nothing. - The S3 API is plain HTTP, so you can publish it over HTTPS with an Ingress or Gateway. See Expose over HTTPS below.
- Use a strong secret key, not
change-me, and rotate the secret if it leaks.
Connect
Section titled “Connect”Confirm the pod rolled out:
kubectl rollout status -n rustfs deploy/rustfsPort-forward the S3 API:
kubectl port-forward -n rustfs service/rustfs 9000:9000Point the MinIO Client (mc)
at it, then create a bucket and list:
mc alias set rustfs http://localhost:9000 rustfsadmin change-memc mb rustfs/my-bucketmc ls rustfsThe web console is on port 9001:
kubectl port-forward -n rustfs service/rustfs 9001:9001Then open http://localhost:9001.
Other workloads in the cluster use the endpoint
http://rustfs.rustfs.svc.cluster.local:9000 with the access and secret keys
from the secret above.
Expose over HTTPS
Section titled “Expose over HTTPS”The S3 API is plain HTTP, so you can publish it with the Ingress or Gateway guide for automatic TLS. Set up the DNS record as described there, then apply an Ingress for the S3 port only.
cat <<'EOF' | kubectl apply -f -apiVersion: networking.k8s.io/v1kind: Ingressmetadata: name: rustfs namespace: rustfs annotations: cert-manager.io/cluster-issuer: letsencrypt-prodspec: ingressClassName: traefik tls: - hosts: - s3.example.com secretName: rustfs-tls rules: - host: s3.example.com http: paths: - path: / pathType: Prefix backend: service: name: rustfs port: number: 9000EOFClients then use https://s3.example.com as the endpoint:
mc alias set rustfs https://s3.example.com rustfsadmin change-meThis serves buckets in path-style form (https://s3.example.com/my-bucket).
Virtual-host style (https://my-bucket.s3.example.com) would additionally need a
wildcard DNS record and certificate.
Clean up
Section titled “Clean up”Delete the namespace to remove everything at once:
kubectl delete namespace rustfsThis destroys the stored objects along with it.