How to Use Spaces With Kubernetes Clusters

DigitalOcean Kubernetes (DOKS) is a managed Kubernetes service. Deploy Kubernetes clusters with a fully managed control plane, high availability, autoscaling, and native integration with DigitalOcean Load Balancers and volumes. DOKS clusters are compatible with standard Kubernetes toolchains and the DigitalOcean API and CLI.


DigitalOcean Spaces Object Storage allows you to store large amounts of static, unstructured data, such as text, audio, video, and images, for your Kubernetes cluster. To programmatically integrate a Spaces bucket with your Kubernetes environment, you can use one of AWS’ S3 Software Development Kits (SDKs). This enables your DOKS pods to share access to the bucket(s) at all times and freely store and retrieve files. Spaces buckets can perform up to 800 total operations per second per bucket, and to scale further, you can add more buckets to meet your application’s needs.

To use Spaces with your DOKS cluster:

  1. Create a DigitalOcean Spaces bucket.

  2. Set up s3cmd 2.x with DigitalOcean Spaces.

  3. Enable persistent storage for your application to use the DigitalOcean Spaces bucket.

    The persistent storage configuration is application specific. Refer to the provider’s documentation for specific details. For example, if you are using Grafana Loki for aggregating application logs, you need to add the following to the Helm chart YAML file to configure DigitalOcean Spaces persistent storage:

        
            
                
        aws:
        bucketnames: <YOUR_DO_SPACES_BUCKET_NAME>
        endpoint: <YOUR_DO_SPACES_BUCKET_ENDPOINT>
        region: <YOUR_DO_SPACES_BUCKET_REGION>
        access_key_id: <YOUR_DO_SPACES_ACCESS_KEY>
        secret_access_key: <YOUR_DO_SPACES_SECRET_KEY>
        
            
        
    
  4. Install your application.

    Once installed, you should see a DigitalOcean Spaces bucket created in the control panel that your DOKS cluster can access for storage. You can manage its stored data from within the control panel.

    The index page of an empty bucket