Custom resources

SaunaFS Operator introduces custom resources: SaunafsCluster, SaunafsMetadataVolume, SaunafsChunkVolume and SaunafsExport.

All these resources are namespaced. Single SaunaFS cluster can consist only of SaunafsCluster, SaunafsMetadataVolumes, SaunafsChunkVolumes and persistent volume claims from the same namespace.

DANGER

SaunaFS Operator doesn't verify if the persistent volume claims are empty before use nor empties them when their Saunafs...Volumes are removed. Be careful when adding new volumes, especially for metadata - you might lose your data if the volume you introduce already has metadata from another cluster.

SaunafsCluster

This resource represents a single SaunaFS Cluster - you can deploy more than one SaunaFS cluster in a single Kubernetes cluster.

Example manifest:

apiVersion: saunafs.sarkan.io/v1beta1
kind: SaunafsCluster
metadata:
  name: example-cluster
  namespace: saunafs-operator
spec:
  # Decides whether the cluster should be exposed externally (i.e. outside Kubernetes cluster).
  #
  #  If true then
  #  - metadata servers will be exposed using LoadBalancer service,
  #  - chunkservers will be exposed using host ports of Kubernetes nodes.
  exposeExternally: true

  # Optional PVC selectors for metadata and chunk storage. When present operator will
  # watch for PVCs with that labels and create a corresponding objects automatically.
  pvcSelectors:
    # Create SaunafsMetadataVolume object automatically for PVC with that label.
    # Required if PV selector for metadata storage is specified.
    metadataStorage: example-cluster=metadata

    # Create SaunafsChunkVolume object automatically for PVC with that label.
    # Required if PV selector for chunk storage is specified.
    chunkStorage: example-cluster=chunks
  
  # Optional PV selectors for metadata and chunk storage. When present operator will
  # watch for PVs with that labels and create a corresponding PVCs automatically. 
  pvSelectors:
    # The created PVCs will be automatically assigned PVC metadata storage label.
    metadataStorage: example-cluster=metadata

    # The created PVCs will be automatically assigned PVC chunk storage label.
    chunkStorage: example-cluster=chunks

  # Optional container image overrides.
  images:
    metadataServer: ""
    chunkServer: ""
    elector: ""

SaunafsMetadataVolume

This resource represents a single PVC for metadata storage. Instance of this resource belongs to a SaunafsCluster instance.

Example manifest:

apiVersion: saunafs.sarkan.io/v1beta1
kind: SaunafsMetadataVolume
metadata:
  name: example-metadata-volume
  namespace: saunafs-operator
spec:
  # Name of the SaunaFS cluster this metadata volume belongs to.
  clusterName: example-cluster

  # Name of the persistent volume claim to use.
  persistentVolumeClaimName: pvc-1

TIP

SaunaFS Metadata Volume must be in the same namespace as SaunaFS Cluster it belongs to.

SaunafsChunkVolume

This resource represents a single PVC for chunk storage. Instance of this resource belongs to a SaunafsCluster instance.

Example manifest:

apiVersion: saunafs.sarkan.io/v1beta1
kind: SaunafsChunkVolume
metadata:
  name: example-chunks-volume
  namespace: saunafs-operator
spec:
  # Name of the SaunaFS cluster this metadata volume belongs to.
  clusterName: example-cluster

  # Name of the persistent volume claim to use.
  persistentVolumeClaimName: pvc-2

TIP

SaunaFS Metadata Volume must be in the same namespace as SaunaFS Cluster it belongs to.

SaunafsExport

This resource represents a SaunaFS export. Instance of this resource belongs to a SaunafsCluster instance. It serves as access control for sfsmounts.

Example manifest:

apiVersion: saunafs.sarkan.io/v1beta1
kind: SaunafsExport
metadata:
  name: example-saunafs-export
  namespace: saunafs-operator
spec:
  # Name of the SaunaFS cluster this export belongs to.
  clusterName: saunafs-cluster

  # Path to be exported relative to your SaunaFS root.
  path: "/my-password-protected-export"

  # Comma separated list of export options, refer to SaunaFS documentation for list of possible options. Defaults to 'readonly'.
  options: "rw"

  # Kubernetes secret with password that should protect the export. Secret must contain field with key 'saunafs-export-password'. Secret must be in the same namespace as SaunaFS Cluster.
  exportSecretName: saunafs-export