An operator for Samba as a service on PVCs in kubernetes.
This project implements the samba-operator. It it responsible for the
the SmbService
and SmbPvc
custom resources:
SmbService
describes an SMB service deployment that is created for a given PersistentVolumeClaim (PVC).SmbPvc
) describes a PVC bundled with an SmbService. I.e. you request a pvc along with an SmbService. When you delete theSmbPvc
, the created backend PVC will also be deleted.
You need to have a kubernetes cluster running. For example, minikube is sufficient.
In order to install the CRDs and the operator, and start the operator, invoke the install script either directly or as
$ make install
Correspondingly, the uninstall script, also available as
make uninstall
will remove all traces of the operator and CRDs from the
cluster again.
If you have a PVC mypvc
, create a mysmbservice.yml
file as folows (see
examples/mysmbservice.yml):
apiVersion: smbservice.samba.org/v1alpha1
kind: SmbService
metadata:
name: my-smbservice
spec:
pvcname: "mypvc"
And apply it with kubectl apply -f mysmbservice.yml
.
You will get a samba container deployment serving out your pvc as share share
.
For an SmbPvc
example that uses the minikube gluster storage addon, see
examples/smbpvc.yml. The yaml file looks like this:
apiVersion: smbpvc.samba.org/v1alpha1
kind: SmbPvc
metadata:
name: "mysmbpvc1"
spec:
pvc:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 2Mi
storageClassName: glusterfile
This operator uses the container built from obnoxxx/samba-container as found on quay.io.
The container from this codebase is published on quay.io too.