Skip to main content
Version: Next 🚧

Accessing Epinio's internal SeaweedFS S3 service

Epinio uses SeaweedFS as its default S3-compatible storage for application source code. You can expose the internal S3 API for debugging, for example using the Amazon Web Services (AWS) CLI or the MinIO Client (mc). In both cases you expose the internal service through a Kubernetes NodePort service.

caution

For security reasons, delete the exposed services when you finish debugging.

Access Epinio's S3 storage through the AWS CLI​

Expose the SeaweedFS S3 service and use the AWS CLI to talk to it.

# Expose the SeaweedFS S3 service (service name may vary; typically seaweedfs-s3)
kubectl expose deployment seaweedfs-s3 -n epinio --name epinio-s3-np --port=8333 --type=NodePort
# If the S3 component is a different workload type, use the appropriate resource (e.g. pod or service)
PORT=$(kubectl get svc -n epinio epinio-s3-np -o jsonpath='{.spec.ports[0].nodePort}')
NODE=$(kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}")
S3_KEY=$(kubectl get secrets/seaweedfs-creds -n epinio -o=go-template='{{index .data "accesskey" | base64decode}}')
S3_SECRET=$(kubectl get secrets/seaweedfs-creds -n epinio -o=go-template='{{index .data "secretkey" | base64decode}}')

Install the AWS CLI and configure it for the internal S3 endpoint:

aws configure set aws_access_key_id $S3_KEY
aws configure set aws_secret_access_key $S3_SECRET
aws configure set default.region us-east-1
echo "Usage: aws --no-verify-ssl --endpoint-url https://$NODE:$PORT s3 ls"

To list the Epinio bucket:

aws --no-verify-ssl --endpoint-url https://$NODE:$PORT s3 ls s3://epinio/

When you are done, remove the NodePort service:

kubectl delete service epinio-s3-np -n epinio

Access using MinIO Client (mc)​

You can also use the MinIO Client (mc), which works with any S3-compatible API. After exposing the S3 service as above, configure an alias and use mc ls, mc cp, etc. as needed.

For more on S3-compatible access, see AWS CLI S3 and MinIO Client with S3.