kubesphere / ks-installer

Install KubeSphere on existing Kubernetes cluster
https://kubesphere.io
Apache License 2.0
529 stars 744 forks source link

pipeline: Deploy to Kubernetes error #345

Open c4fun opened 4 years ago

c4fun commented 4 years ago

Hi, I installed kubesphere on a 2-master-3-computer k8s cluster. And when I tried devops according to this link. It always reminds me of this error:

[Pipeline] kubernetesDeploy
Starting Kubernetes deployment
ERROR: ERROR: io.fabric8.kubernetes.client.KubernetesClientException: An error has occurred.
hudson.remoting.ProxyException: io.fabric8.kubernetes.client.KubernetesClientException: An error has occurred.
    at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:62)
    at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:53)
    at io.fabric8.kubernetes.client.BaseClient.<init>(BaseClient.java:71)
    at io.fabric8.kubernetes.client.BaseClient.<init>(BaseClient.java:55)
    at io.fabric8.kubernetes.client.DefaultKubernetesClient.<init>(DefaultKubernetesClient.java:61)
    at com.microsoft.jenkins.kubernetes.KubernetesClientWrapper.<init>(KubernetesClientWrapper.java:76)
    at com.microsoft.jenkins.kubernetes.KubernetesDeployContext$ClientWrapperFactoryImpl.buildClient(KubernetesDeployContext.java:466)
    at com.microsoft.jenkins.kubernetes.command.DeploymentCommand$DeploymentTask.doCall(DeploymentCommand.java:141)
    at com.microsoft.jenkins.kubernetes.command.DeploymentCommand$DeploymentTask.call(DeploymentCommand.java:122)
    at com.microsoft.jenkins.kubernetes.command.DeploymentCommand$DeploymentTask.call(DeploymentCommand.java:105)
    at hudson.remoting.UserRequest.perform(UserRequest.java:212)
    at hudson.remoting.UserRequest.perform(UserRequest.java:54)
    at hudson.remoting.Request$2.run(Request.java:369)
    at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:93)
    at java.lang.Thread.run(Thread.java:748)
    Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from 172.20.3.54/172.20.3.54:56932
        at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)
        at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
        at hudson.remoting.Channel.call(Channel.java:955)
        at hudson.FilePath.act(FilePath.java:1163)
        at com.microsoft.jenkins.kubernetes.command.DeploymentCommand.execute(DeploymentCommand.java:67)
        at com.microsoft.jenkins.kubernetes.command.DeploymentCommand.execute(DeploymentCommand.java:46)
        at com.microsoft.jenkins.azurecommons.command.CommandService.runCommand(CommandService.java:88)
        at com.microsoft.jenkins.azurecommons.command.CommandService.execute(CommandService.java:96)
        at com.microsoft.jenkins.azurecommons.command.CommandService.executeCommands(CommandService.java:75)
        at com.microsoft.jenkins.azurecommons.command.BaseCommandContext.executeCommands(BaseCommandContext.java:77)
        at com.microsoft.jenkins.kubernetes.KubernetesDeploy.perform(KubernetesDeploy.java:42)
        at com.microsoft.jenkins.azurecommons.command.SimpleBuildStepExecution.run(SimpleBuildStepExecution.java:54)
        at com.microsoft.jenkins.azurecommons.command.SimpleBuildStepExecution.run(SimpleBuildStepExecution.java:35)
        at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        ... 1 more
Caused by: hudson.remoting.ProxyException: java.net.MalformedURLException: no protocol: 10.11.2.48:6443
    at java.net.URL.<init>(URL.java:593)
    at java.net.URL.<init>(URL.java:490)
    at java.net.URL.<init>(URL.java:439)
    at io.fabric8.kubernetes.client.BaseClient.<init>(BaseClient.java:69)
    ... 16 more

What is the cause of this? The virtual machine I deploy my kubernetes to have two IPs, a eIP and a LAN IP. Both IPs are accessible. I deployed the k8s on the LAN IP, which is the IP on eth0; the eIP is for accessing on the external net, which is not shown in ifconfig. I don't know if it is relevant, but here's the ifconfig result:

$ ifconfig
cni0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
        inet 172.20.1.1  netmask 255.255.255.0  broadcast 0.0.0.0
        ether 32:c2:2e:5b:9b:ad  txqueuelen 1000  (Ethernet)
        RX packets 22  bytes 3001 (2.9 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 20  bytes 9115 (8.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 172.17.0.1  netmask 255.255.0.0  broadcast 172.17.255.255
        ether 02:42:fe:36:c5:51  txqueuelen 0  (Ethernet)
        RX packets 625  bytes 4046122 (3.8 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 526  bytes 101198 (98.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.11.2.48  netmask 255.255.255.0  broadcast 10.11.2.255
        ether fa:16:3e:62:91:55  txqueuelen 1000  (Ethernet)
        RX packets 65959561  bytes 13534066841 (12.6 GiB)
        RX errors 0  dropped 5  overruns 0  frame 0
        TX packets 65000731  bytes 18128711546 (16.8 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

flannel.1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450
        inet 172.20.1.0  netmask 255.255.255.255  broadcast 0.0.0.0
        ether 22:9a:72:b7:8f:78  txqueuelen 0  (Ethernet)
        RX packets 352505  bytes 73621901 (70.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 400596  bytes 34363833 (32.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 28306576  bytes 9829124594 (9.1 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 28306576  bytes 9829124594 (9.1 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
pixiake commented 4 years ago

@runzexia

runzexia commented 4 years ago

https://github.com/kubesphere/kubesphere/issues/898 Try to solve this problem with the method in the above issue. fix in 2.1.0