|
| 1 | +--- |
| 2 | +# Configuration for the samba domain member pod. |
| 3 | +apiVersion: v1 |
| 4 | +kind: ConfigMap |
| 5 | +metadata: |
| 6 | + name: samba-container-config |
| 7 | +data: |
| 8 | + config.json: | |
| 9 | + { |
| 10 | + "samba-container-config": "v0", |
| 11 | + "configs": { |
| 12 | + "sambadm1": { |
| 13 | + "shares": [ |
| 14 | + "share" |
| 15 | + ], |
| 16 | + "globals": [ |
| 17 | + "noprinting", |
| 18 | + "sambadm1" |
| 19 | + ], |
| 20 | + "instance_name": "SMBDM1" |
| 21 | + } |
| 22 | + }, |
| 23 | + "shares": { |
| 24 | + "share": { |
| 25 | + "options": { |
| 26 | + "path": "/share", |
| 27 | + "read only": "no" |
| 28 | + } |
| 29 | + } |
| 30 | + }, |
| 31 | + "_NOTE": "Change the security and workgroup keys to match your domain.", |
| 32 | + "globals": { |
| 33 | + "noprinting": { |
| 34 | + "options": { |
| 35 | + "load printers": "no", |
| 36 | + "printing": "bsd", |
| 37 | + "printcap name": "/dev/null", |
| 38 | + "disable spoolss": "yes" |
| 39 | + } |
| 40 | + }, |
| 41 | + "sambadm1": { |
| 42 | + "options": { |
| 43 | + "log level": "10", |
| 44 | + "security": "ads", |
| 45 | + "workgroup": "DOMAIN1", |
| 46 | + "realm": "DOMAIN1.SINK.TEST", |
| 47 | + "server min protocol": "SMB2", |
| 48 | + "idmap config * : backend": "autorid", |
| 49 | + "idmap config * : range": "2000-9999999" |
| 50 | + } |
| 51 | + } |
| 52 | + } |
| 53 | + } |
| 54 | +--- |
| 55 | +# Secret used to pass a AD join password to the winbind pod. |
| 56 | +apiVersion: v1 |
| 57 | +kind: Secret |
| 58 | +metadata: |
| 59 | + name: ad-join-secret |
| 60 | +type: Opaque |
| 61 | +stringData: |
| 62 | + # Change the value below to match the username and password for a user that |
| 63 | + # can join systems your test AD Domain |
| 64 | + join.json: | |
| 65 | + {"username": "Administrator", "password": "Passw0rd"} |
| 66 | +--- |
| 67 | +# The pod itself. |
| 68 | +apiVersion: v1 |
| 69 | +kind: Pod |
| 70 | +metadata: |
| 71 | + labels: |
| 72 | + app: samba-dm-example |
| 73 | + name: samba-dm |
| 74 | +spec: |
| 75 | + shareProcessNamespace: true |
| 76 | + containers: |
| 77 | + - image: samba-container:latest |
| 78 | + # Need imagePullPolicy Never for working with local images. |
| 79 | + # Otherwise we get "ErrImagePull". |
| 80 | + imagePullPolicy: Never |
| 81 | + name: smb |
| 82 | + command: |
| 83 | + - "samba-container" |
| 84 | + - "--debug-delay=1" |
| 85 | + - "run" |
| 86 | + - "smbd" |
| 87 | + env: |
| 88 | + - name: SAMBACC_CONFIG |
| 89 | + value: /etc/samba-container/config.json |
| 90 | + - name: SAMBA_CONTAINER_ID |
| 91 | + value: sambadm1 |
| 92 | + - name: SAMBACC_VERSION |
| 93 | + value: "0.1" |
| 94 | + - name: HOSTNAME |
| 95 | + value: sambadm1 |
| 96 | + ports: |
| 97 | + - containerPort: 445 |
| 98 | + hostPort: 455 |
| 99 | + protocol: TCP |
| 100 | + name: "smb" |
| 101 | + securityContext: |
| 102 | + allowPrivilegeEscalation: true |
| 103 | + volumeMounts: |
| 104 | + - mountPath: "/share" |
| 105 | + name: samba-sharedir |
| 106 | + - mountPath: "/etc/samba-container" |
| 107 | + name: samba-container-config |
| 108 | + - mountPath: "/var/lib/samba" |
| 109 | + name: samba-state-dir |
| 110 | + - mountPath: "/run/samba/winbindd" |
| 111 | + name: samba-sockets-dir |
| 112 | + - image: quay.io/samba.org/samba-server:latest |
| 113 | + name: winbind |
| 114 | + command: |
| 115 | + - "samba-container" |
| 116 | + - "run" |
| 117 | + - "winbindd" |
| 118 | + env: |
| 119 | + - name: SAMBACC_VERSION |
| 120 | + value: "0.1" |
| 121 | + - name: SAMBACC_CONFIG |
| 122 | + value: /etc/samba-container/config.json |
| 123 | + - name: SAMBA_CONTAINER_ID |
| 124 | + value: sambadm1 |
| 125 | + - name: HOSTNAME |
| 126 | + value: sambadm1 |
| 127 | + securityContext: |
| 128 | + allowPrivilegeEscalation: true |
| 129 | + volumeMounts: |
| 130 | + - mountPath: "/etc/samba-container" |
| 131 | + name: samba-container-config |
| 132 | + - mountPath: "/var/lib/samba" |
| 133 | + name: samba-state-dir |
| 134 | + - mountPath: "/run/samba/winbindd" |
| 135 | + name: samba-sockets-dir |
| 136 | + initContainers: |
| 137 | + - image: quay.io/samba.org/samba-server:latest |
| 138 | + name: init |
| 139 | + args: |
| 140 | + - "init" |
| 141 | + env: |
| 142 | + - name: SAMBACC_VERSION |
| 143 | + value: "0.1" |
| 144 | + - name: SAMBACC_CONFIG |
| 145 | + value: /etc/samba-container/config.json |
| 146 | + - name: SAMBA_CONTAINER_ID |
| 147 | + value: sambadm1 |
| 148 | + - name: HOSTNAME |
| 149 | + value: sambadm1 |
| 150 | + securityContext: |
| 151 | + allowPrivilegeEscalation: true |
| 152 | + volumeMounts: |
| 153 | + - mountPath: "/etc/samba-container" |
| 154 | + name: samba-container-config |
| 155 | + - mountPath: "/var/lib/samba" |
| 156 | + name: samba-state-dir |
| 157 | + - image: quay.io/samba.org/samba-server:latest |
| 158 | + name: must-join |
| 159 | + args: |
| 160 | + - "must-join" |
| 161 | + - "--files" |
| 162 | + - "--join-file=/etc/join-data/join.json" |
| 163 | + env: |
| 164 | + - name: SAMBACC_VERSION |
| 165 | + value: "0.1" |
| 166 | + - name: SAMBACC_CONFIG |
| 167 | + value: /etc/samba-container/config.json |
| 168 | + - name: SAMBA_CONTAINER_ID |
| 169 | + value: sambadm1 |
| 170 | + - name: HOSTNAME |
| 171 | + value: sambadm1 |
| 172 | + securityContext: |
| 173 | + allowPrivilegeEscalation: true |
| 174 | + volumeMounts: |
| 175 | + - mountPath: "/etc/samba-container" |
| 176 | + name: samba-container-config |
| 177 | + - mountPath: "/var/lib/samba" |
| 178 | + name: samba-state-dir |
| 179 | + - mountPath: "/etc/join-data" |
| 180 | + name: samba-join-data |
| 181 | + readOnly: true |
| 182 | + volumes: |
| 183 | + - configMap: |
| 184 | + name: samba-container-config |
| 185 | + name: samba-container-config |
| 186 | + - secret: |
| 187 | + secretName: ad-join-secret |
| 188 | + items: |
| 189 | + - key: join.json |
| 190 | + path: join.json |
| 191 | + name: samba-join-data |
| 192 | + - emptyDir: |
| 193 | + medium: Memory |
| 194 | + name: samba-sockets-dir |
| 195 | + - emptyDir: {} |
| 196 | + name: samba-state-dir |
| 197 | +# Comment out the section below to skip using a PVC for the share |
| 198 | +# - persistentVolumeClaim: |
| 199 | +# claimName: mypvc |
| 200 | +# name: samba-sharedir |
| 201 | +# Uncomment the section below to use an empty dir for the share |
| 202 | + - emptyDir: |
| 203 | + medium: Memory |
| 204 | + name: samba-sharedir |
0 commit comments