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: metadata:
name: samba-config name: samba-config
data: data:
FAIL_FAST: "true" config.json: |
SAMBA_CONF_LOG_LEVEL: "3" {
ACCOUNT_samba: samba "samba-container-config": "v0",
GROUPS_samba: samba "configs": {
SAMBA_GLOBAL_STANZA: "map to guest = Bad User;guest account = samba;wins support = yes;load printers = no;" "local": {
SAMBA_VOLUME_CONFIG_share: | "shares": [
[share] "share"
path = /shares/data ],
comment = K3s share data "globals": [
browseable = yes "default"
writable = yes ],
read only = no "instance_name": "SAMBA"
printable = no }
public = yes },
"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: spec:
containers: containers:
- name: samba - name: samba
image: ghcr.io/servercontainers/samba:a3.22.0-s4.21.4-r4 image: quay.io/samba.org/samba-server:latest
ports: ports:
- containerPort: 445 - containerPort: 445
hostPort: 445
env:
- name: SAMBACC_CONFIG
value: /etc/samba-container/config.json
- name: SAMBA_CONTAINER_ID
value: local
resources: resources:
limits: limits:
cpu: 1000m cpu: 1000m
@@ -29,19 +35,20 @@ spec:
cpu: 10m cpu: 10m
memory: 64Mi memory: 64Mi
volumeMounts: volumeMounts:
- mountPath: /shares/data - mountPath: /share
name: share-path name: local-path
envFrom: - mountPath: /etc/samba-container
- configMapRef:
name: samba-config name: samba-config
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
securityContext: securityContext:
privileged: true privileged: true
capabilities: capabilities:
add: ["NET_ADMIN"] add: ["NET_ADMIN"]
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
volumes: volumes:
- name: share-path - name: local-path
hostPath: hostPath:
path: /usr/local/data path: /usr/local/data
type: DirectoryOrCreate - name: samba-config
configMap:
name: samba-config