Yiyiyimu opened a new issue #3412:
URL: https://github.com/apache/apisix/issues/3412
### Issue description
When deploy apisix on k8s in minikube, it works fine. But on kind, when
apply apisix deployment, error would come as:
```
Events:
Type Reason Age From
Message
---- ------ ---- ----
-------
Warning FailedMount 59m kubelet, kind-control-plane
Unable to attach or mount volumes: unmounted volumes=[localtime], unattached
volumes=[localtime default-token-k4dr7 apisix-config-yaml-configmap]: timed out
waiting for the condition
Warning FailedMount 47m (x2 over 50m) kubelet, kind-control-plane
Unable to attach or mount volumes: unmounted volumes=[localtime], unattached
volumes=[apisix-config-yaml-configmap localtime default-token-k4dr7]: timed out
waiting for the condition
Warning FailedMount 4m43s (x19 over 63m) kubelet, kind-control-plane
Unable to attach or mount volumes: unmounted volumes=[localtime], unattached
volumes=[default-token-k4dr7 apisix-config-yaml-configmap localtime]: timed out
waiting for the condition
Warning FailedMount 24s (x40 over 65m) kubelet, kind-control-plane
MountVolume.SetUp failed for volume "localtime" : hostPath type check failed:
/etc/localtime is not a file
```
So the error comes from the file existence check, which is
https://github.com/apache/apisix/blob/6331e5d05734f19f398b8dbae7f0470ce6069c98/kubernetes/deployment.yaml#L104-L111
although the file does exist. Try to replace the symbolic link with the
actual file, but it still not work. If removed the file check, the error would
be like:
```
Error: failed to create containerd task: OCI runtime create failed:
container_linux.go:349: starting container process caused
"process_linux.go:449: container init caused \"rootfs_linux.go:58: mounting
\\\"/etc/localtime\\\" to rootfs
\\\"/run/containerd/io.containerd.runtime.v2.task/k8s.io/apisix-gw-deployment/rootfs\\\"
at
\\\"/run/containerd/io.containerd.runtime.v2.task/k8s.io/apisix-gw-deployment/rootfs/usr/share/zoneinfo/UTC\\\"
caused \\\"not a directory\\\"\"": unknown
```
### Environment
* apisix version : master
* OS: WSL2, Ubuntu 18.04
* kind version: v0.8.1
* k8s version: v1.18.2
### Minimal test code / Steps to reproduce the issue
Following https://github.com/apache/apisix/blob/master/kubernetes/README.md
### What's the actual result? (including assertion message & call stack if
applicable)
### What's the expected result?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]