Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use path.join instead of filepath.join for ssh copy #1959

Merged
merged 1 commit into from
Sep 14, 2017

Conversation

aaron-prindle
Copy link
Contributor

No description provided.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 13, 2017
@aaron-prindle aaron-prindle force-pushed the path-fix-windows branch 2 times, most recently from 1cf83cc to 87d5561 Compare September 13, 2017 23:17
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 13, 2017
@aaron-prindle aaron-prindle force-pushed the path-fix-windows branch 2 times, most recently from b0dceef to d613618 Compare September 13, 2017 23:36
@@ -170,7 +170,7 @@ func setRemoteAuthOptions(p provision.Provisioner) auth.Options {
dockerDir := p.GetDockerOptionsDir()
authOptions := p.GetAuthOptions()

// due to windows clients, we cannot use filepath.Join as the paths
// due to windows clients, we cannot use path.Join as the paths
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want this comment to stay the same

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -170,7 +170,7 @@ func setRemoteAuthOptions(p provision.Provisioner) auth.Options {
dockerDir := p.GetDockerOptionsDir()
authOptions := p.GetAuthOptions()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be good to figure out if we can catch this in a unit test somehow.

@codecov-io
Copy link

codecov-io commented Sep 14, 2017

Codecov Report

Merging #1959 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1959   +/-   ##
=======================================
  Coverage   30.11%   30.11%           
=======================================
  Files          76       76           
  Lines        4722     4722           
=======================================
  Hits         1422     1422           
  Misses       3120     3120           
  Partials      180      180
Impacted Files Coverage Δ
pkg/minikube/bootstrapper/ssh_runner.go 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 651128d...e575585. Read the comment docs.

Copy link
Contributor

@r2d4 r2d4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is one instance of filepath.Join in the exec_runner and the ssh_runner.

Do you want to change all instances of filepath.Join to path.Join?

@aaron-prindle
Copy link
Contributor Author

This is working on windows with the changes made

@aaron-prindle
Copy link
Contributor Author

I changed the ssh_runner to use path. but kept the exec_runner filepath. as it copies files on the host

@kfaseela
Copy link

I had installed minikube v0.22.1 from https://github.com/kubernetes/minikube/releases
Are there any updated exe s available with this, or do I have to pull and build?

@r2d4
Copy link
Contributor

r2d4 commented Sep 16, 2017

@kfaseela you can use https://storage.googleapis.com/minikube-builds/1959/minikube-windows-amd64.exe but a new version will be released soon #1971

@richardjharding
Copy link

I just tried that version above but I still get the following (note the missing ip reported in #1945 seems to be fixed)

 Retrying.
E0918 09:13:20.058596   12740 start.go:149] Error starting host:  Error creating host: Error executing step: Provision
g VM.
: Temporary Error: ssh command error:
command : sudo systemctl -f restart docker
err     : Process exited with status 1
output  : Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

Temporary Error: ssh command error:
command : sudo systemctl -f restart docker
err     : Process exited with status 1
output  : Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

Temporary Error: ssh command error:
command : sudo systemctl -f restart docker
err     : Process exited with status 1
output  : Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

Temporary Error: ssh command error:
command : sudo systemctl -f restart docker
err     : Process exited with status 1
output  : Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

Temporary Error: ssh command error:
command : sudo systemctl -f restart docker
err     : Process exited with status 1
output  : Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.

@sarra-bouhenni
Copy link

Hello @richardjharding I had the same problem like yours when I was using Hyper-v because my VM wasn't correctly connected to Internet ! Moved to VirtualBox and the problem was solved!

@r2d4 the fixed version works for me but I'm getting a new error.

C:\WINDOWS\system32>minikube start
Starting local Kubernetes v1.7.5 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.

C:\WINDOWS\system32>minikube status
minikube: Running
cluster: Running
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100

None of kubectl commands works for me, even minikube dashboard gives connection refused error.

C:\WINDOWS\system32>kubectl get pods --all-namespaces
Unable to connect to the server: dial tcp 192.168.99.100:8443: connectex: Aucune connexion n’a pu être établie car l’ordinateur cible l’a expressément refusée.

@sbueringer
Copy link
Member

sbueringer commented Sep 23, 2017

@r2d4

Seems like the certs are setup correctly now:

ls -la /var/lib/localkube/certs
total 40
drwxr-xr-x 2 root root 4096 Sep 23 16:27 .
drwxr-xr-x 4 root root 4096 Sep 23 16:27 ..
-rw-r--r-- 1 root root 1269 Sep 23 16:27 apiserver.crt
-rw------- 1 root root 1675 Sep 23 16:27 apiserver.key
-rw-r--r-- 1 root root 1066 Sep 23 16:27 ca.crt
-rw------- 1 root root 1679 Sep 23 16:27 ca.key
-rw-r--r-- 1 root root 1074 Sep 23 16:27 proxy-client-ca.crt
-rw------- 1 root root 1671 Sep 23 16:27 proxy-client-ca.key
-rw-r--r-- 1 root root 1103 Sep 23 16:27 proxy-client.crt
-rw------- 1 root root 1679 Sep 23 16:27 proxy-client.key

I get errors on startup of localkube. Localkube seems to search at the wrong place for the certificates:

journalctl -f -u localkube
 I0923 16:39:43.699081    6102 ready.go:32] Performing healthcheck on https://localhost:8443/healthz
Sep 23 16:39:43 profile localkube[6102]: I0923 16:39:43.708378    6102 ready.go:67] Got healthcheck response: ok
Sep 23 16:39:43 profile localkube[6102]: apiserver is ready!
Sep 23 16:39:43 profile localkube[6102]: Starting controller-manager...
Sep 23 16:39:43 profile localkube[6102]: Waiting for controller-manager to be healthy...
Sep 23 16:39:43 profile localkube[6102]: I0923 16:39:43.708443    6102 controllermanager.go:108] Version: v1.7.5
Sep 23 16:39:43 profile localkube[6102]: controller-manager: Exit with error: invalid configuration: [unable to read client-cert /var/lib/localkube/\var\lib\localkube\certs\apiserver.crt for profile due to open /var/lib/localkube/\var\lib\localkube\certs\apiserver.crt: no such file or directory, unable to read client-key /var/lib/localkube/\var\lib\localkube\certs\apiserver.key for profile due to open /var/lib/localkube/\var\lib\localkube\certs\apiserver.key: no such file or directory, unable to read certificate-authority /var/lib/localkube/\var\lib\localkube\certs\ca.crt for profile due to open /var/lib/localkube/\var\lib\localkube\certs\ca.crt: no such file or directory]
Sep 23 16:39:43 profile localkube[6102]: I0923 16:39:43.910460    6102 controllermanager.go:108] Version: v1.7.5
Sep 23 16:39:43 profile localkube[6102]: E0923 16:39:43.910601    6102 controllermanager.go:116] unable to register configz: register config "componentconfig" twice
Sep 23 16:39:43 profile localkube[6102]: controller-manager: Exit with error: invalid configuration: [unable to read client-cert /var/lib/localkube/\var\lib\localkube\certs\apiserver.crt for profile due to open /var/lib/localkube/\var\lib\localkube\certs\apiserver.crt: no such file or directory, unable to read client-key /var/lib/localkube/\var\lib\localkube\certs\apiserver.key for profile due to open /var/lib/localkube/\var\lib\localkube\certs\apiserver.key: no such file or directory, unable to read certificate-authority /var/lib/localkube/\var\lib\localkube\certs\ca.crt for profile due to open /var/lib/localkube/\var\lib\localkube\certs\ca.crt: no such file or directory]
Sep 23 16:39:44 profile localkube[6102]: I0923 16:39:44.111675    6102 controllermanager.go:108] Version: v1.7.5
Sep 23 16:39:44 profile localkube[6102]: E0923 16:39:44.111941    6102 controllermanager.go:116] unable to register configz: register config "componentconfig" twice
Sep 23 16:39:44 profile localkube[6102]: controller-manager: Exit with error: invalid configuration: [unable to read client-cert /var/lib/localkube/\var\lib\localkube\certs\apiserver.crt for profile due to open /var/lib/localkube/\var\lib\localkube\certs\apiserver.crt: no such file or directory, unable to read client-key /var/lib/localkube/\var\lib\localkube\certs\apiserver.key for profile due to open /var/lib/localkube/\var\lib\localkube\certs\apiserver.key: no such file or directory, unable to read certificate-authority /var/lib/localkube/\var\lib\localkube\certs\ca.crt for profile due to open /var/lib/localkube/\var\lib\localkube\certs\ca.crt: no such file or directory]
Sep 23 16:39:44 profile localkube[6102]: I0923 16:39:44.313584    6102 controllermanager.go:108] Version: v1.7.5
Sep 23 16:39:44 profile localkube[6102]: E0923 16:39:44.313956    6102 controllermanager.go:116] unable to register configz: register config "componentconfig" twice
Sep 23 16:39:44 profile localkube[6102]: controller-manager: Exit with error: invalid configuration: [unable to read client-cert /var/lib/localkube/\var\lib\localkube\certs\apiserver.crt for profile due to open /var/lib/localkube/\var\lib\localkube\certs\apiserver.crt: no such file or directory, unable to read client-key /var/lib/localkube/\var\lib\localkube\certs\apiserver.key for profile due to open /var/lib/localkube/\var\lib\localkube\certs\apiserver.key: no such file or directory, unable to read certificate-authority /var/lib/localkube/\var\lib\localkube\certs\ca.crt for profile due to open /var/lib/localkube/\var\lib\localkube\certs\ca.crt: no such file or directory]
Sep 23 16:39:44 profile localkube[6102]: I0923 16:39:44.515916    6102 controllermanager.go:108] Version: v1.7.5
Sep 23 16:39:44 profile localkube[6102]: E0923 16:39:44.516407    6102 controllermanager.go:116] unable to register configz: register config "componentconfig" twice
Sep 23 16:39:44 profile localkube[6102]: controller-manager: Exit with error: invalid configuration: [unable to read client-cert /var/lib/localkube/\var\lib\localkube\certs\apiserver.crt for profile due to open /var/lib/localkube/\var\lib\localkube\certs\apiserver.crt: no such file or directory, unable to read client-key /var/lib/localkube/\var\lib\localkube\certs\apiserver.key for profile due to open /var/lib/localkube/\var\lib\localkube\certs\apiserver.key: no such file or directory, unable to read certificate-authority /var/lib/localkube/\var\lib\localkube\certs\ca.crt for profile due to open /var/lib/localkube/\var\lib\localkube\certs\ca.crt: no such file or directory]
Sep 23 16:39:44 profile localkube[6102]: controller-manager is ready!
Sep 23 16:39:44 profile localkube[6102]: Starting scheduler...
Sep 23 16:39:44 profile localkube[6102]: Waiting for scheduler to be healthy...
Sep 23 16:39:44 profile localkube[6102]: scheduler: Exit with error: unable to create kube client: unable to build config from flags: invalid configuration: [unable to read client-cert /var/lib/localkube/\var\lib\localkube\certs\apiserver.crt for profile due to open /var/lib/localkube/\var\lib\localkube\certs\apiserver.crt: no such file or directory, unable to read client-key /var/lib/localkube/\var\lib\localkube\certs\apiserver.key for profile due to open /var/lib/localkube/\var\lib\localkube\certs\apiserver.key: no such file or directory, unable to read certificate-authority /var/lib/localkube/\var\lib\localkube\certs\ca.crt for profile due to open /var/lib/localkube/\var\lib\localkube\certs\ca.crt: no such file or directory]
....

The paths in the /var/lib/localkube/kubeconfig have backslashes instead of slashes:

apiVersion: v1
clusters:
- cluster:
    certificate-authority: \var\lib\localkube\certs\ca.crt
    server: https://localhost:8443
  name: profile
contexts:
- context:
    cluster: profile
    user: profile
  name: profile
current-context: profile
kind: Config
preferences: {}
users:
- name: profile
  user:
    client-certificate: \var\lib\localkube\certs\apiserver.crt
    client-key: \var\lib\localkube\certs\apiserver.key

````
After fixing this with the following Minikube seems to come up again:
````
$ sudo su
$ cd /var/lib/localkube
$ sed -i 's/\\/\//g' kubeconfig
````

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants