6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[helm] elasticsearchをinstallしたらkubectlが「Unable to connect to the server:」しか返さなくなった

Last updated at Posted at 2019-01-08

Pickup

  • k8sのログ管理を試してみようと思って軽い気持ちで helmでelasticsearch をapplyした失敗まとめ
  • デフォルト設定のまま挑むとkubectlオペレーションの標準出力がすべて↓のエラーになってしまいます
  • Unable to connect to the server: EOF
  • Unable to connect to the server: net/http: TLS handshake timeout

Requirement

  • k8s

    $ kubectl version
    Client Version: version.Info{Major:"1", Minor:"13", GitVersion:"v1.13.1",     GitCommit:"eec55b9ba98609a46fee712359c7b5b365bdd920", GitTreeState:"clean", BuildDate:"2018-12-13T19:44:10Z", GoVersion:"go1.11.2", Compiler:"gc", Platform:"darwin/amd64"}
    Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.3", GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", GitTreeState:"clean", BuildDate:"2018-05-21T09:05:37Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
    

※ namespace移動のために kubens をinstallしておくと楽

  • helm

    $ helm version
    Client: &version.Version{SemVer:"v2.12.0", GitCommit:"d325d2a9c179b33af1a024cdb5a4472b6288016a", GitTreeState:"clean"}
    Server: &version.Version{SemVer:"v2.12.0", GitCommit:"d325d2a9c179b33af1a024cdb5a4472b6288016a", GitTreeState:"clean"}
    
  • docker

    $ docker -v
    Docker version 18.09.0, build 4d60db4
    
  • 参考にしたelasticsearch

Document

■ 問題の再現方法

  1. kubectlを使えるようにインストール

  2. kube-systemに移動

    $ kubens kube-system
    
  3. gitを参考にhelm installする

    $ helm repo add incubator http://storage.googleapis.com/kubernetes-charts-incubator
    $ helm install --name my-release incubator/elasticsearch
    
  4. 問題発生!!

    $ kubectl get po
    Unable to connect to the server: net/http: TLS handshake timeout
    
    $ kubectl get nemaspace
    Unable to connect to the server: EOF
    
    $ kubectl proxy
    Starting to serve on 127.0.0.1:8001
    I0108 23:33:34.280873    1751 log.go:172] http: proxy error: net/http: TLS handshake timeout
    I0108 23:34:08.619748    1751 log.go:172] http: proxy error: net/http: TLS handshake timeout
    I0108 23:34:21.963468    1751 log.go:172] http: proxy error: net/http: TLS handshake timeout
    

■ 原因

Docker Engineに割り振っているメモリやSwapが不足していたことだった。
参考文献: https://github.com/docker/for-mac/issues/2717

■ 解決方法

「Docker Engine > Preferences > Advanced」でメモリとSwapを上げる
※ ↓は上げた後
Advanced.jpg

これで無事解決!!

6
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?