Add config map to configure samba

This commit is contained in:
2025-01-26 19:54:31 +00:00
parent 00b75f08cf
commit f304183d87
2 changed files with 65 additions and 1 deletions

View File

@@ -0,0 +1,55 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: samba-config
data:
config.json: |
{
"samba-container-config": "v0",
"configs": {
"local": {
"shares": [
"share"
],
"globals": [
"default"
],
"instance_name": "SAMBA"
}
},
"shares": {
"share": {
"options": {
"path": "/share",
"valid users": "user"
}
}
},
"globals": {
"default": {
"options": {
"security": "user",
"server min protocol": "SMB2",
"load printers": "no",
"printing": "bsd",
"printcap name": "/dev/null",
"disable spoolss": "yes",
"guest ok": "yes",
"browsable": "yes",
"writable": "yes",
"guest account": "user",
"create mask": "0775",
"directory mask": "0755",
}
}
},
"users": {
"all_entries": [
{
"name": "user",
"password": "public"
}
]
},
"_footer": 1
}

View File

@@ -29,6 +29,9 @@ spec:
ports: ports:
- containerPort: 445 - containerPort: 445
hostPort: 445 hostPort: 445
env:
- name: SAMBACC_CONFIG
value: /etc/samba-container/config.json
resources: resources:
limits: limits:
cpu: 1000m cpu: 1000m
@@ -44,3 +47,9 @@ spec:
hostPath: hostPath:
path: /usr/local/data path: /usr/local/data
type: Directory type: Directory
- name: samba-config
configMap:
name: samba-config
items:
- key: config.json
path: /etc/samba-container/config.json