120 lines
2.9 KiB
YAML
120 lines
2.9 KiB
YAML
|
|
apiVersion: storage.k8s.io/v1
|
|
kind: StorageClass
|
|
metadata:
|
|
name: samba
|
|
# Change "rook-ceph" provisioner prefix to match the operator namespace if needed
|
|
provisioner: rook-ceph.cephfs.csi.ceph.com
|
|
parameters:
|
|
# clusterID is the namespace where the rook cluster is running
|
|
# If you change this namespace, also change the namespace below where the secret namespaces are defined
|
|
clusterID: rook-ceph
|
|
|
|
# CephFS filesystem name into which the volume shall be created
|
|
fsName: fileserver
|
|
|
|
# Ceph pool into which the volume shall be created
|
|
# Required for provisionVolume: "true"
|
|
pool: fileserver-replicated
|
|
|
|
# The secrets contain Ceph admin credentials. These are generated automatically by the operator
|
|
# in the same namespace as the cluster.
|
|
csi.storage.k8s.io/provisioner-secret-name: rook-csi-cephfs-provisioner
|
|
csi.storage.k8s.io/provisioner-secret-namespace: rook-ceph
|
|
csi.storage.k8s.io/controller-expand-secret-name: rook-csi-cephfs-provisioner
|
|
csi.storage.k8s.io/controller-expand-secret-namespace: rook-ceph
|
|
csi.storage.k8s.io/node-stage-secret-name: rook-csi-cephfs-node
|
|
csi.storage.k8s.io/node-stage-secret-namespace: rook-ceph
|
|
|
|
reclaimPolicy: Delete
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: samba
|
|
namespace: fileserver
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteMany
|
|
resources:
|
|
requests:
|
|
storage: 64Gi
|
|
storageClassName: samba
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: samba
|
|
namespace: fileserver
|
|
labels:
|
|
app: samba
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: samba
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: samba
|
|
spec:
|
|
initContainers:
|
|
- name: createfolders
|
|
image: dperson/samba
|
|
command: ["bash", "-c", "mkdir -p /data/music && mkdir -p /data/movies && mkdir -p /data/tvshows"]
|
|
volumeMounts:
|
|
- mountPath: /data
|
|
name: data
|
|
containers:
|
|
- name: samba
|
|
image: dperson/samba
|
|
imagePullPolicy: IfNotPresent
|
|
ports:
|
|
- containerPort: 139
|
|
- containerPort: 445
|
|
env:
|
|
- name: SHARE
|
|
value: "data;/data"
|
|
- name: SHARE2
|
|
value: "music;/music"
|
|
- name: SHARE3
|
|
value: "movies;/movies"
|
|
- name: SHARE4
|
|
value: "tvshows;/tvshows"
|
|
- name: USER
|
|
value: "admin;4IsTheMindKiller"
|
|
volumeMounts:
|
|
- mountPath: "/data"
|
|
name: data
|
|
volumes:
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: samba
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: samba
|
|
namespace: fileserver
|
|
labels:
|
|
app: samba
|
|
spec:
|
|
internalTrafficPolicy: Cluster
|
|
ipFamilies:
|
|
- IPv6
|
|
- IPv4
|
|
ipFamilyPolicy: PreferDualStack
|
|
ports:
|
|
- name: smb1
|
|
port: 139
|
|
protocol: TCP
|
|
targetPort: 139
|
|
- name: smb2
|
|
port: 445
|
|
protocol: TCP
|
|
targetPort: 445
|
|
selector:
|
|
app: samba
|
|
sessionAffinity: None
|
|
type: ClusterIP
|