Skip to content

Commit

Permalink
✨ smb adapter for fileserver (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasklinger authored Jun 21, 2024
2 parents 08f7ce0 + 81f39c1 commit 1c07567
Show file tree
Hide file tree
Showing 6 changed files with 145 additions and 0 deletions.
26 changes: 26 additions & 0 deletions apps/samba-adapter/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: samba-adapter
data:
config.yml: |
auth:
- user: foo
group: foo
uid: 1000
gid: 1000
password: bar
global:
- "force user = foo"
- "force group = foo"
share:
- name: public
comment: Public
path: /samba/public
browsable: yes
readonly: no
guestok: yes
veto: no
recycle: yes
54 changes: 54 additions & 0 deletions apps/samba-adapter/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: samba-adapter
namespace: samba-adapter
labels:
app: samba-adapter
spec:
replicas: 3
selector:
matchLabels:
app: samba-adapter
template:
metadata:
labels:
app: samba-adapter
spec:
containers:
- name: samba-adapter
image: ghcr.io/crazy-max/samba:latest
resources:
limits:
cpu: 250m
memory: 512Mi
requests:
cpu: 50m
memory: 512Mi
env:
- name: SAMBA_HOSTS_ALLOW
value: "0.0.0.0/0"
- name: CONFIG_FILE
value: /config/config.yml
ports:
- containerPort: 445
name: smb
volumeMounts:
- name: data
mountPath: "/samba/public"
readOnly: false
- name: config
mountPath: "/config"
readOnly: true
- mountPath: /data
name: cache
volumes:
- name: config
configMap:
name: samba-adapter
- name: data
persistentVolumeClaim:
claimName: samba-adapter-data
- name: cache
emptyDir:
sizeLimit: 500Mi
9 changes: 9 additions & 0 deletions apps/samba-adapter/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: samba-adapter
resources:
- namespace.yaml
- deployment.yaml
- configmap.yaml
- service.yaml
- volume.yaml
4 changes: 4 additions & 0 deletions apps/samba-adapter/namespace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: samba-adapter
16 changes: 16 additions & 0 deletions apps/samba-adapter/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v1
kind: Service
metadata:
name: samba-adapter
namespace: samba-adapter
annotations:
external-dns.alpha.kubernetes.io/hostname: smb.fileserver.chaosdorf.space.
spec:
type: LoadBalancer
selector:
app: samba-adapter
ports:
- name: smb
protocol: TCP
port: 445
targetPort: smb
36 changes: 36 additions & 0 deletions apps/samba-adapter/volume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: samba-adapter-data
labels:
app: samba-adapter
volume: data
spec:
capacity:
storage: 16Ti
nfs:
server: fileserver.chaosdorf.space
path: /srv/storage
accessModes:
- ReadWriteOnce
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: samba-adapter-data
labels:
app: samba-adapter
volume: data
spec:
accessModes:
- ReadWriteOnce
selector:
matchLabels:
app: samba-adapter
volume: data
resources:
requests:
storage: 16Ti
volumeName: samba-adapter-data
storageClassName: ''
volumeMode: Filesystem

0 comments on commit 1c07567

Please sign in to comment.