phlogistonjohn / samba-operator

An operator for a Samba as a service on PVCs in kubernetes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Samba Operator

An operator for Samba as a service on PVCs in kubernetes.

Description

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 the SmbPvc, the created backend PVC will also be deleted.

Trying it out

Prerequisite

You need to have a kubernetes cluster running. For example, minikube is sufficient.

Start the operator

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.

Creating an SmbService

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.

Creating an SmbPvc

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

Containers on quay.io

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.

About

An operator for a Samba as a service on PVCs in kubernetes

License:Apache License 2.0


Languages

Language:Go 87.1%Language:Shell 8.0%Language:Makefile 3.9%Language:Dockerfile 1.0%