πŸ“šBook Signing at KubeCon EU 2026Meet us at Booking.com HQ (Mon 18:30-21:00) & vCluster booth #521 (Tue 24 Mar, 12:30-1:30pm) β€” free book giveaway!RSVP Booking.com Event
Storage beginner ⏱ 15 minutes K8s Any

Configure S3 Storage Permissions for ML Models

Set up S3 bucket ACLs, IAM roles, and PVC permissions so Kubernetes inference pods can securely read large ML model weights from object storage.

By Luca Berton β€’ β€’ πŸ“– 5 min read

πŸ’‘ Quick Answer: In S3 Browser, select the model folder, go to Permissions tab, check Full Control for the Owner, enable Apply for all subfolders and files, then click Apply. For PVCs, ensure the ReadOnlyMany or ReadWriteMany access mode and verify the model directory is complete.

Model inference pods need reliable read access to model files stored on S3-backed volumes. Incorrect ACLs cause silent mount failures or permission-denied errors.

Model Directory Structure

Before setting permissions, ensure the model directory is complete:

Mistral-7B-v0.1/
β”œβ”€β”€ config.json
β”œβ”€β”€ generation_config.json
β”œβ”€β”€ tokenizer.json
β”œβ”€β”€ tokenizer_config.json
β”œβ”€β”€ special_tokens_map.json
β”œβ”€β”€ model-00001-of-00002.safetensors
β”œβ”€β”€ model-00002-of-00002.safetensors
└── model.safetensors.index.json

Missing files (especially config.json or safetensors) cause model load failures.

Set ACL via S3 Browser (GUI)

Step 1: Navigate to the Bucket

  1. Open S3 Browser
  2. Expand the S3 endpoint in the left tree
  3. Navigate to the model folder (e.g., Mistral-7B-v0.1/)

Step 2: Open Permissions

  1. Select the model folder
  2. Click the Permissions tab in the bottom panel

You will see a permissions grid:

UserFull ControlReadWriteRead PermissionsWrite Permissions
Owner☐☐☐☐☐
Any AWS Users☐☐☐☐☐
All Users☐☐☐☐☐

Step 3: Grant Full Control

Check Full Control for the Owner row.

For inference workloads, Owner Full Control is sufficient. Do not grant broad permissions to β€œAll Users” unless explicitly required.

Step 4: Apply Recursively

Check: Apply for all subfolders and files

This ensures permissions propagate to every file inside the model directory.

Step 5: Apply Changes

Click Apply changes. S3 Browser updates ACLs on all objects.

Set ACL via AWS CLI

# Set full control on the model prefix
aws s3api put-object-acl \
  --bucket my-model-bucket \
  --key Mistral-7B-v0.1/ \
  --acl bucket-owner-full-control

# Apply recursively to all objects in the prefix
aws s3 ls s3://my-model-bucket/Mistral-7B-v0.1/ --recursive | \
  awk '{print $4}' | \
  xargs -I {} aws s3api put-object-acl \
    --bucket my-model-bucket \
    --key {} \
    --acl bucket-owner-full-control

Verify Permissions

# Check ACL on a specific file
aws s3api get-object-acl \
  --bucket my-model-bucket \
  --key Mistral-7B-v0.1/config.json

# List files to confirm access
aws s3 ls s3://my-model-bucket/Mistral-7B-v0.1/

PVC Configuration for Kubernetes

Once S3 permissions are correct, the PVC should be mounted in the inference pod:

volumes:
  - name: model-data
    persistentVolumeClaim:
      claimName: model-storage-pvc

containers:
  - name: inference
    volumeMounts:
      - name: model-data
        mountPath: /data
        readOnly: true

Verify Inside the Pod

kubectl exec -it <inference-pod> -- ls -la /data/Mistral-7B-v0.1/
kubectl exec -it <inference-pod> -- cat /data/Mistral-7B-v0.1/config.json | head -5

Common Issues

SymptomCauseFix
Permission denied in pod logsACL not applied to filesApply Full Control recursively
FileNotFoundError: config.jsonIncomplete model uploadRe-upload missing files
Access Denied on S3 list/getBucket policy blocks accessUpdate bucket policy or IAM role
Pod mounts empty /dataPVC not bound or wrong claim nameCheck kubectl get pvc
Model loads partiallySome safetensors files missingVerify all shards are uploaded

Security Best Practices

  • Use Owner Full Control only β€” avoid granting public access
  • Use IAM roles or service accounts instead of static keys when possible
  • Prefer ReadOnlyMany PVC access mode for inference (no writes needed)
  • Rotate S3/IAM credentials regularly
  • Audit bucket access patterns periodically
#s3 #storage #permissions #acl #model-storage #ai-workloads
Luca Berton
Written by Luca Berton

Principal Solutions Architect specializing in Kubernetes, AI/GPU infrastructure, and cloud-native platforms. Author of Kubernetes Recipes and creator of CopyPasteLearn courses.

Kubernetes Recipes book cover

Want More Kubernetes Recipes?

This recipe is from Kubernetes Recipes, our 750-page practical guide with hundreds of production-ready patterns.

Luca Berton Ansible Pilot Ansible by Example Open Empower K8s Recipes Terraform Pilot CopyPasteLearn ProteinLens