Building images

Cluster pre-requisites for building images

To connect a Builder Cluster to Bunnyshell, you need to create a StorageClass in Kubernetes with the name bns-builder-sc.

Bunnyshell needs it to make sure of the following:

  • The reclaimPolicy property is set to delete;
  • Auto-provisioning of volumes is enabled - Private Volume (PV) from Private Volume Claim (PVC).

📘

By default, the build commands are executed in the current working directory. Bunnyshell considers the working directory to be the one where the docker-compose file is located.

 

Creating a Storage Class

To create a class you can use kubectl and follow the instructions below:

  1. Create a spec.yaml file with the following contents
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: bns-builder-sc
provisioner: <varies according to provider>
reclaimPolicy: Delete
allowVolumeExpansion: true
volumeBindingMode: Immediate
  1. Make sure kubectl has access to the cluster in question..

  2. Run kubectl apply -f spec.yaml

🚧

Important

To make sure the operation was successful, run:
kubectl describe storageclass bns-builder-sc

 

Specific Cloud Provider Recipes

As an alternative, you can follow these instructions to create the storage class:

Amazon Web Services

Define the StorageClass using the content below:

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: bns-builder-sc
provisioner: kubernetes.io/aws-ebs
reclaimPolicy: Delete
allowVolumeExpansion: true

📘

Note

Read more about StorageClasses on the AWS documentation website here.

 

DigitalOcean

To add a Storage Class in DigitalOcean, follow the steps detailed below:

  1. Log in to your DigitalOcean account and select a cluster.
  2. Click Kubernetes Dashboard.
  3. On the left side menu, scroll to the Config and Storage category and click Storage Classes.
  4. Click the Create new resource button in the upper-right corner of the main interface.
  5. Input the content below, then click Upload.
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: bns-builder-sc
provisioner: dobs.csi.digitalocean.com
reclaimPolicy: Delete
allowVolumeExpansion: true
volumeBindingMode: Immediate

 

Google Cloud Platform

Define the StorageClass using the content below:

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: bns-builder-sc
provisioner: kubernetes.io/gce-pd
reclaimPolicy: Delete
allowVolumeExpansion: true

📘

Note

You can find out more about Storage Classes on the Google Cloud documentation website.

 

Microsoft Azure

Define the StorageClass using the content below:

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: bns-builder-sc
provisioner: disk.csi.azure.com
reclaimPolicy: Delete
allowVolumeExpansion: true
volumeBindingMode: Immediate

📘

Note

Additional information regarding StorageClasses is available on the Azure docs website.

 

Other / Private Kubernetes Clusters

For other Kubernetes clusters, the provisioner will vary, so you will have to fill it in youeself.

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: bns-builder-sc
provisioner: <varies according to provider>
reclaimPolicy: Delete
allowVolumeExpansion: true
volumeBindingMode: Immediate

📘

Note

You can find additional information regarding Storage Classes on the official Kubernetes documentation platform.