I am running minikube on my mac (running OSX 10.14.5)
minikube version: 1.1.0
minikube is using VirtualBox
I would like to have a single set of kubernetes yaml files that I use in different environments. Therefore, I'm trying to mount the same directory I would use in other environments into my minikube. (If there's a different way to go about this but ease development let me know.)
Anyway, the mount fails.
$ minikube mount /etc/vsc:/etc/vsc
π Mounting host path /etc/vsc into VM as /etc/vsc ...
πΎ Mount options:
βͺ Type: 9p
βͺ UID: docker
βͺ GID: docker
βͺ Version: 9p2000.L
βͺ MSize: 262144
βͺ Mode: 755 (-rwxr-xr-x)
βͺ Options: map[]
π Userspace file server: ufs starting
π£ mount failed: mount: /etc/vsc: mount(2) system call failed: Connection timed out.
: Process exited with status 32
Related
I'm following a Kubernetes tutorial, and cannot run first command (minikube start --vm-driver=hyperkit). I'm using a MacBook Pro Intel on macOs Monterey. I cannot make it work because of TLS error.
$ minikube start --vm-driver=hyperkit
π minikube v1.25.2 on Darwin 12.2.1
π Kubernetes 1.23.3 is now available. If you would like to upgrade, specify: --kubernetes-version=v1.23.3
β¨ Using the hyperkit driver based on existing profile
π Starting control plane node minikube in cluster minikube
π Restarting existing hyperkit VM for "minikube" ...
π³ Preparing Kubernetes v1.20.2 on Docker 20.10.3 ...
β Problems detected in etcd [592b8a58065e]:
2022-03-19 22:12:03.193985 I | embed: rejected connection from "127.0.0.1:38132" (error "remote error: tls: bad certificate", ServerName "")
I tried :
Restarted the computer : https://github.com/kubernetes/minikube/issues/4329
Used --embed-certs argument
$ minikube start --vm-driver=hyperkit --embed-certs
π minikube v1.25.2 on Darwin 12.2.1
π Kubernetes 1.23.3 is now available. If you would like to upgrade, specify: --kubernetes-version=v1.23.3
β¨ Using the hyperkit driver based on existing profile
π Starting control plane node minikube in cluster minikube
π Restarting existing hyperkit VM for "minikube" ...
π³ Preparing Kubernetes v1.20.2 on Docker 20.10.3 ...
β Problems detected in etcd [78d1e36569b8]:
2022-03-19 22:20:53.503532 I | embed: rejected connection from "127.0.0.1:34926" (error "remote error: tls: bad certificate", ServerName "")
I'm new to K8s, what could cause such behaviour ?
I installed minikube and hyperkit with homebrew. When I display the kubectl version I get another connection error :
kubectl version
Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.5", GitCommit:"5c99e2ac2ff9a3c549d9ca665e7bc05a3e18f07e", GitTreeState:"clean", BuildDate:"2021-12-16T08:38:33Z", GoVersion:"go1.16.12", Compiler:"gc", Platform:"darwin/amd64"}
Unable to connect to the server: dial tcp 192.168.64.2:8443: i/o timeout
The kubectl version error helped :
Unable to connect to the server: dial tcp i/o time out
It seems I had already played with k8s :
$ kubectl config view
apiVersion: v1
clusters:
- cluster:
certificate-authority: /Users/xxx/.minikube/ca.crt
extensions:
- extension:
last-update: Sat, 13 Mar 2021 13:40:06 CET
provider: minikube.sigs.k8s.io
version: v1.18.1
name: cluster_info
server: https://192.168.64.2:8443
name: minikube
contexts:
- context:
cluster: minikube
extensions:
- extension:
last-update: Sat, 13 Mar 2021 13:40:06 CET
provider: minikube.sigs.k8s.io
version: v1.18.1
name: context_info
namespace: default
user: minikube
name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
user:
client-certificate: /Users/xxx/.minikube/profiles/minikube/client.crt
client-key: /Users/xxx/.minikube/profiles/minikube/client.key
First I deleted the existing cluster :
$ kubectl config delete-cluster minikube
deleted cluster minikube from /Users/xxx/.kube/config
Then run
$ minikube delete
π₯ Deleting "minikube" in hyperkit ...
π Removed all traces of the "minikube" cluster.
Finally :
$ minikube start --vm-driver=hyperkit
π minikube v1.25.2 on Darwin 12.2.1
β¨ Using the hyperkit driver based on user configuration
π Starting control plane node minikube in cluster minikube
πΎ Downloading Kubernetes v1.23.3 preload ...
> preloaded-images-k8s-v17-v1...: 505.68 MiB / 505.68 MiB 100.00% 923.34 K
π₯ Creating hyperkit VM (CPUs=2, Memory=4000MB, Disk=20000MB) ...
π³ Preparing Kubernetes v1.23.3 on Docker 20.10.12 ...
βͺ kubelet.housekeeping-interval=5m
βͺ Generating certificates and keys ...
βͺ Booting up control plane ...
βͺ Configuring RBAC rules ...
π Verifying Kubernetes components...
βͺ Using image gcr.io/k8s-minikube/storage-provisioner:v5
π Enabled addons: default-storageclass, storage-provisioner
π Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
I want to have a container that can access and run kubectl command on my host machine. Here is what I have:
I have installed Kubernetes and Minikube on my host machine.
I used this docker container: helm-kubectl link
This is the command I run my docker:
docker run -it -v ~/.kube:/root/.kube -v ~/.minikube:/Users/xxxx/.minikube dtzar/helm-kubectl
Inside the container, when I checked the cluster, I can see the context has loaded my minikube, However, I can't run another kubectl command due to the reason "The connection to the server 127.0.0.1:32768 was refused - did you specify the right host or port?".
bash-5.0# kubectl config get-contexts
CURRENT NAME CLUSTER AUTHINFO NAMESPACE
docker-desktop docker-desktop docker-desktop
docker-for-desktop docker-desktop docker-desktop
* minikube minikube minikube
bash-5.0# kubectl get all
The connection to the server 127.0.0.1:32768 was refused - did you specify the right host or port?
I have checked my Kubenetes config at ~/.kube and the port is 32768.
- cluster:
certificate-authority: /Users/xxx/.minikube/ca.crt
server: https://127.0.0.1:32768
name: minikube
I have tried port -p 32768 or --expose 32768 but no luck. So anyone can help this?
Thanks zerkms! It works with --network host
Unable to mount a pod - nfs: access denied by server while mounting
I have NFS Manager for Mac and i have tried removing all of the security. Right click on finder and connect to server and it works as it should. I can also see it in showmount -e
The error message in full;
MountVolume.SetUp failed for volume "magento2-monolith-volume" : mount failed: exit status 32 Mounting command: systemd-run Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/pods/cd5fb5f0-885a-11e9-9fb4-080027390119/volumes/kubernetes.io~nfs/magento2-monolith-volume
--scope -- mount -t nfs 192.168.31.135:/Users/macmini/desktop/magento2-devbox /var/lib/kubelet/pods/cd5fb5f0-885a-11e9-9fb4-080027390119/volumes/kubernetes.io~nfs/magento2-monolith-volume Output: Running scope as unit: run-r256a12ba3ca8416c904902f477ec2397.scope mount.nfs: access denied by server while mounting
192.168.31.135:/Users/macmini/desktop/magento2-devbox
Is there something that I am missing on MacOS? Most of the issues seem to be with people running on Linux. Is there anything specific to Mac and Kubernetes?
I am running docker on my arm based 32 bit device.
However, when i try to run an ubuntu bash shell as a docker container via the command : docker run -it ubuntu bash , I keep getting the following error:
docker: Error response from daemon: OCI runtime create failed:
container_linux.go:348: starting container process caused
"process_linux.go:402: container init caused \"open /dev/ptmx: no such file or directory\"": unknown.
Here's what docker info gives:
Containers: 4
Running: 0
Paused: 0
Stopped: 4
Images: 3
Server Version: 18.06.1-ce
Storage Driver: vfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 3.10.65-00273-gfa38327-dirty
OSType: linux
Architecture: armv7l
CPUs: 4
Total Memory: 923MiB
ID: 2PDV:3KHU:VZZM:DM6F:4MVR:TXBN:35YJ:VWP5:TMHD:GMKW:TPMI:MALC
Docker Root Dir: /opt/usr/media/docker_workdir
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
It would be great if someone could tell me what's wrong and how can I fix this ?
It could be that, for one reason or another, your docker container can't find its own /dev/ptmx or even perhaps your /dev/ altogether.
One quick solution is to do:
docker run -it -v /dev:/dev ubuntu bash
This binds your /dev/ directory to the container's, meaning that they will use the same files.
Notice that, although in of itself this operation is harmless, in production environments this means that the isolation between the host's and the container's devices is gone.
For that reason, make sure to only ever use this trick in test environments.
It looks like your OS is missing pseudo-terminals (PTY) - a device that has the functions of a physical terminal without actually being one.
The file /dev/ptmx is a character file with major number 5
and minor number 2, usually of mode 0666 and owner.group
of root.root. It is used to create a pseudo-terminal masΒter and slave pair.
FILES
/dev/ptmx - UNIX 98 master clone device
/dev/pts/* - UNIX 98 slave devices
/dev/pty[p-za-e][0-9a-f] - BSD master devices
/dev/tty[p-za-e][0-9a-f] - BSD slave devices
Reference: http://man7.org/linux/man-pages/man7/pty.7.html
This is by default included into Linux kernel. Maybe lack of it is somehow related to your OS architecture. Also, I'm not sure how can you fix, maybe try to update && upgrade OS.
Quick workaround if you don't need a tty would be to skip -t flag:
docker run -i ubuntu bash
In docker run -it, -i/--interactive means "keep stdin open" and -t/--tty means "tell the container that stdin is a pseudo tty". The key here is the word "interactive". If you omit the flag, the container still executes /bin/bash but exits immediately. With the flag, the container executes /bin/bash then patiently waits for your input. That means now you will have bash session inside the container, so you can ls, mkdir, or do any bash command inside the container.
one workable fix:
docker exec -i hello-world rm /dev/ptmx
docker exec -i hello-world mknod /dev/ptmx c 5 2
or enable kernel config: CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
I'm trying to run the official 5.4.3 Filebeat docker container via VirtualBox on a Windows host. Rather than creating a custom image, I'm using a volume mapping to pass the filebeat.yml file to the container using the automatically created VirtualBox mount /c/Users which points to C:\Users on my host.
Unfortunately I'm stuck on this error:
Exiting: error loading config file: config file ("filebeat.yml") can only be writable by the owner but the permissions are "-rwxrwxrwx" (to fix the permissions use: 'chmod go-w /usr/share/filebeat/filebeat.yml')
My docker-compose config is:
filebeat:
image: "docker.elastic.co/beats/filebeat:5.4.3"
volumes:
- "/c/Users/Nathan/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro"
- "/c/Users/Nathan/log:/mnt/log:ro"
I've tried SSH-ing into the machine and running the chmod go-w command but no change. Is this some kind of permission limitation when working with VirtualBox shared folders on a Windows host?
It looks like this is a side effect of the Windows DACL permissions system. Fortunately I only need this for a development environment so I've simply disabled the permission check by overriding the container entry point and passing the strict.perms argument.
filebeat:
image: "docker.elastic.co/beats/filebeat:5.4.3"
entrypoint: "filebeat -e -strict.perms=false"
volumes:
- "/c/Users/Nathan/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro"
- "/c/Users/Nathan/log:/mnt/log:ro"