Skip to content

Commit 6bdffc1

Browse files
authored
Merge pull request #638 from davhdavh/windows-name-resolution-docs
doc: refine windows server name resolution docs
2 parents f16c76b + b3f46b9 commit 6bdffc1

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

deploy/example/windows/README.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,65 @@ C:/ $ ls mnt/smb
2626
```
2727

2828
In the above example, there is a `c:\mnt\smb` directory mounted as SMB filesystem.
29+
30+
## Name resolution
31+
32+
It is important to note that if you have defined your Storage class based on the name of the service, then the Windows NODE must be able to resolve that name (ie. outside Kubernetes).
33+
34+
e.g.
35+
36+
```yaml
37+
apiVersion: storage.k8s.io/v1
38+
kind: StorageClass
39+
metadata:
40+
name: smb
41+
provisioner: smb.csi.k8s.io
42+
parameters:
43+
source: "//smb-server.default.svc.cluster.local/share"
44+
...
45+
```
46+
47+
and the error you get in logs (`kubectl logs -n kube-system ds/csi-proxy`) is the famous `The network path was not found`:
48+
49+
```
50+
I0706 02:11:47.703698 4460 server.go:56] calling NewSmbGlobalMapping with remote path "\\\\smb-server.default.svc.cluster.local\\share\\pvc-1a6c607b-df88-4a61-8628-4d9d066dc158"
51+
I0706 02:11:48.524376 4460 server.go:98] Remote \\smb-server.default.svc.cluster.local\share not mapped. Mapping now!
52+
E0706 02:11:49.319012 4460 server.go:101] failed NewSmbGlobalMapping NewSmbGlobalMapping failed. output: "New-SmbGlobalMapping : The network path was not found. \r\nAt line:1 char:190\r\n+ ... , $PWord;New-SmbGlobalMapping -RemotePath $Env:smbremotepath -Cred ...\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : NotSpecified: (MSFT_SmbGlobalMapping:ROOT/Microsoft/...mbGlobalMapping) [New-SmbGlobalMa \r\n pping], CimException\r\n + FullyQualifiedErrorId : Windows System Error 53,New-SmbGlobalMapping\r\n \r\n", err: exit status 1
53+
```
54+
55+
For most cloud providers that offer Windows nodes, this is not an issue. Those nodes will be part of a domain where name resolution includes the Kubernetes dns resolution.
56+
57+
For self-hosted Kubernetes clusters there is no default name resolution to solve this issue.
58+
59+
### Name resolution solution
60+
61+
A simple _hack_ workaround is to use a fixed ClusterIP for the smb service, and use the IP in the storageClass.
62+
63+
It is VERY VERY much not recommended to use fixed IPs inside Kubernetes, but in this very specific case it make for a simple workaround.
64+
65+
The IP needs to be in the service CIDR range, e.g. if it is `10.96.0.0/12`, you could pick `10.111.254.254`.
66+
67+
```yaml
68+
apiVersion: v1
69+
kind: Service
70+
metadata:
71+
...
72+
spec:
73+
type: ClusterIP
74+
clusterIP: 10.111.254.254
75+
...
76+
```
77+
and
78+
```yaml
79+
apiVersion: storage.k8s.io/v1
80+
kind: StorageClass
81+
metadata:
82+
name: smb
83+
provisioner: smb.csi.k8s.io
84+
parameters:
85+
source: "//10.111.254.254/share"
86+
...
87+
```
88+
89+
If `kubectl logs -n kube-system ds/csi-proxy` continues to use names after this fix, it might be necessary to reboot the node.
90+

0 commit comments

Comments
 (0)