Try original samba server with netowkring in the right place

This commit is contained in:
2025-07-09 20:45:38 +01:00
parent 595f244bad
commit ba105d67c3
2 changed files with 71 additions and 24 deletions

View File

@@ -3,17 +3,57 @@ kind: ConfigMap
metadata:
name: samba-config
data:
FAIL_FAST: "true"
SAMBA_CONF_LOG_LEVEL: "3"
ACCOUNT_samba: samba
GROUPS_samba: samba
SAMBA_GLOBAL_STANZA: "map to guest = Bad User;guest account = samba;wins support = yes;load printers = no;"
SAMBA_VOLUME_CONFIG_share: |
[share]
path = /shares/data
comment = K3s share data
browseable = yes
writable = yes
read only = no
printable = no
public = yes
config.json: |
{
"samba-container-config": "v0",
"configs": {
"local": {
"shares": [
"share"
],
"globals": [
"default"
],
"instance_name": "SAMBA"
}
},
"shares": {
"share": {
"options": {
"path": "/share",
"valid users": "sambauser",
"writeable": "yes",
"guest ok": "yes",
"guest only": "yes"
}
}
},
"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": "sambauser",
"create mask": "0775",
"directory mask": "0755",
"map to guest": "bad user"
}
}
},
"users": {
"all_entries": [
{
"name": "sambauser",
"password": "samba"
}
]
},
"_footer": 1
}

View File

@@ -18,9 +18,15 @@ spec:
spec:
containers:
- name: samba
image: ghcr.io/servercontainers/samba:a3.22.0-s4.21.4-r4
image: quay.io/samba.org/samba-server:latest
ports:
- containerPort: 445
hostPort: 445
env:
- name: SAMBACC_CONFIG
value: /etc/samba-container/config.json
- name: SAMBA_CONTAINER_ID
value: local
resources:
limits:
cpu: 1000m
@@ -29,19 +35,20 @@ spec:
cpu: 10m
memory: 64Mi
volumeMounts:
- mountPath: /shares/data
name: share-path
envFrom:
- configMapRef:
name: samba-config
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
- mountPath: /share
name: local-path
- mountPath: /etc/samba-container
name: samba-config
securityContext:
privileged: true
capabilities:
add: ["NET_ADMIN"]
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
volumes:
- name: share-path
- name: local-path
hostPath:
path: /usr/local/data
type: DirectoryOrCreate
- name: samba-config
configMap:
name: samba-config