Untitled

 avatar
unknown
sh
4 months ago
888 B
7
Indexable
# 1. Create the SMB Server Pod
oc apply -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
  name: smb-server
  labels:
    app: smb-server
spec:
  containers:
  - name: samba
    image: dperson/samba
    args: ["-s", "share;/data;yes;no;no"]
    ports:
    - containerPort: 445
      name: smb
    volumeMounts:
    - mountPath: /data
      name: pvc-volume
    securityContext:
        runAsUser: 0 
        runAsGroup: 0  # Group ID to run the container
        fsGroup: 0     # Ensures group permissions for mounted volumes   
  volumes:
  - name: pvc-volume
    persistentVolumeClaim:
      claimName: test
EOF

# 2. Create the SMB Service
oc apply -f - <<EOF
apiVersion: v1
kind: Service
metadata:
  name: smb-service
spec:
  selector:
    app: smb-server
  ports:
  - protocol: TCP
    port: 445
    targetPort: 445
  type: NodePort
EOF

# 3. Get Service Details
oc get svc smb-service
Editor is loading...
Leave a Comment