Create an Object Storage Bucket

AppCat allows DevOps engineers to quickly provision Amazon S3-compatible Object Storage Buckets in various environments.

Apply the following object on your namespace, as specified by its YAML description.

Example to create an Object Storage bucket
apiVersion: appcat.vshn.io/v1
kind: ObjectBucket
metadata:
  name: my-cool-bucket
  namespace: my-namespace (1)
spec:
  parameters:
    bucketName: my-bucket-change-name (2)
    region: rma (3)
  writeConnectionSecretToRef:
    name: objectbucket-creds (4)
1 The namespace where the object will be created.
2 The bucket name for this ObjectBucket.
3 The bucket’s region depends on the selected Provider, see here for more details
4 Secret where the connection details are provisioned. This secret shouldn’t exist at this time.
Object Storage Bucket names must be unique across providers. Make sure to choose a name with prefixes and other guards, to prevent any issue during the creation of the bucket. Check the status field of the ObjectBucket for such errors.

Create a Bucket in another cloud provider

By default the bucket is created on the same cloud provider where the cluster is running on. For instance, if you are on an Exoscale cluster, to create an ObjectBucket on cloudscale.ch add the following YAML snippet to the spec of an ObjectBucket:

spec:
  compositionRef:
    name: cloudscale.objectbuckets.appcat.vshn.io (1)
  parameters:
    region: rma (2)
1 The reference name of the backing cloud provider, see here for available references.
2 Change the region identifier in accordance for the resp. cloud provider, see here for more details.

This mechanism allows advanced deployment or failover scenarios. For example, if your application is running on Exoscale, you can create a primary bucket on Exoscale and a secondary bucket on cloudscale.ch or vice versa. Using a mirroring tool like rclone you can achieve bucket replication between different cloud providers.

  1. Get information about your new bucket object.

    $ oc get objectbucket
    NAME               READY   CONNECTION-SECRET    AGE
    my-cool-bucket     True    objectbucket-creds   5s

    If you see the "True" value in the READY column, it means that your bucket is provisioned and ready to use.

    If your object bucket doesn’t get the state ready after a while, try to delete the bucket and re-create it with a different name.
  2. Get the required secrets to use your bucket from other applications.

    $ oc get secrets objectbucket-creds -oyaml

Find the complete specification of the generated secret in the secrets page.

  1. Check the bucket status

    $ oc describe objectbucket my-cool-bucket
    Name:         my-cool-bucket
    Namespace:    a-demo-project
    # …
    Status:
      Conditions:
        Last Transition Time:  2022-09-02T07:38:40Z
        Reason:                Available
        Status:                True
        Type:                  Ready
      Connection Details:
        Last Published Time:  2022-09-02T07:38:40Z
    Events:
      Type     Reason                      Age                From                                                             Message
      ----     ------                      ----               ----                                                             -------
      Warning  ConfigureCompositeResource  12m (x2 over 12m)  offered/compositeresourcedefinition.apiextensions.crossplane.io  cannot apply composite resource: cannot patch object: Operation cannot be fulfilled on xobjectbuckets.appcat.vshn.io "my-cool-bucket-2ds78": the object has been modified; please apply your changes to the latest version and try again
      Normal   ConfigureCompositeResource  12m (x8 over 12m)  offered/compositeresourcedefinition.apiextensions.crossplane.io  Successfully applied composite resource
      Normal   BindCompositeResource       12m (x6 over 12m)  offered/compositeresourcedefinition.apiextensions.crossplane.io  Composite resource is not yet ready
      Normal   BindCompositeResource       12m (x2 over 12m)  offered/compositeresourcedefinition.apiextensions.crossplane.io  Successfully bound composite resource
      Normal   PropagateConnectionSecret   12m                offered/compositeresourcedefinition.apiextensions.crossplane.io  Successfully propagated connection details from composite resource