1
私のポッドからログを取得しようとしていますが、kubectl describe pod
がうまく動作しますが、何らかの理由で動作しません。docker logs
がうまくいきます。私はKubernetes 1.2.3 Debianの8 x64のは、シングルノードKubernetes:pubログをフェッチするときにkubectlが404を返しません
$ kubectl logs -f web-backend-alzc1 --namespace=my-namespace --v=6
round_trippers.go:286] GET http://localhost:8080/api 200 OK in 0 milliseconds
round_trippers.go:286] GET http://localhost:8080/apis 200 OK in 0 milliseconds
round_trippers.go:286] GET http://localhost:8080/api/v1/namespaces/my-namespace/pods/web-backend-alzc1 200 OK in 1 milliseconds
round_trippers.go:286] GET http://localhost:8080/api 200 OK in 0 milliseconds
round_trippers.go:286] GET http://localhost:8080/apis 200 OK in 0 milliseconds
round_trippers.go:286] GET http://localhost:8080/api/v1/namespaces/my-namespace/pods/web-backend-alzc1/log?follow=true 404 Not Found in 1 milliseconds
helpers.go:172] server response object: [{
"metadata": {},
"status": "Failure",
"message": "the server could not find the requested resource (pods/log web-backend-alzc1)",
"reason": "NotFound",
"details": {
"name": "web-backend-alzc1",
"kind": "pods/log"
},
"code": 404
}]
helpers.go:107] Error from server: the server could not find the requested resource (pods/log web-backend-alzc1)
に手動でインストールしている私は、このポッドのログを有効にするには、RC方式で記述すべきものはありますか?
私は、RCを再作成し、journalctlを見てみました、私はこれらのメッセージを参照してください。これは、容器に装着すると、ログをフェッチからkubeletを防ぐfalseに設定されている--enable-debugging-handlers
フラグ、によって引き起こされる
hyperkube[443]: I0510 12:14:13.754922 443 hairpin.go:51] Unable to find pair interface, setting up all interfaces: exec: "ethtool": executable file not found in $PATH
hyperkube[443]: I0510 12:14:13.756866 443 provider.go:91] Refreshing cache for provider: *credentialprovider.defaultDockerConfigProvider
hyperkube[435]: W0510 12:14:38.835863 435 request.go:344] Field selector: v1 - serviceaccounts - metadata.name - default: need to check if this is versioned correctly.
ノードをどのように起動しましたか?具体的には、 '--enable-debugging-handlers'フラグをfalseに設定していますか? –
これは定期的なEC2ノードで、hyperkubeとkubectlのバイナリをダウンロードし、kubelet、proxy、controller、scheduler、apiserverをsystemd経由で起動しました。この解決策はすでに数ヶ月間、別のマシン上で動作しています。これまではログにならないように努力したことはありません – chingis
申し訳ありませんが、私はkubeletを開始するためにどのコマンドを使用しましたか? ( '--enable-debugging-handlers'フラグを無効にしましたか?) –