2017-10-07 3 views
0

クラスタをAzureに正常にデプロイしました。それではkubectlをセットアップしようとしています。KubectlがAzure ACSクラスタに接続しています

実行:

az acs kubernetes get-credentials --resource-group=group --name=cluster 

結果で:

scp: .kube/config: No such file or directory 
Traceback (most recent call last): 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/main.py", line 36, in main 
    cmd_result = APPLICATION.execute(args) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/application.py", line 212, in execute 
    result = expanded_arg.func(params) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 377, in __call__ 
    return self.handler(*args, **kwargs) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 626, in _execute_command 
    reraise(*sys.exc_info()) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 603, in _execute_command 
    result = op(client, **kwargs) if client else op(**kwargs) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/acs/custom.py", line 814, in k8s_get_credentials 
    _k8s_get_credentials_internal(name, acs_info, path, ssh_key_file) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/acs/custom.py", line 835, in _k8s_get_credentials_internal 
    '.kube/config', path_candidate, key_filename=ssh_key_file) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/acs/acs_client.py", line 64, in secure_copy 
    scp.get(src, dest) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/scp.py", line 198, in get 
    self._recv_all() 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/scp.py", line 348, in _recv_all 
    raise SCPException(asunicode(msg[1:])) 
SCPException: scp: .kube/config: No such file or directory 

ファイル~/.kube/config存在する、と私は、クラスタのマスターノードへのSSHことができます。

私がやっていることで何が間違っているのでしょうか?

更新。

ここのコメントの1あたりのコマンドを実行しようとしました:

az acs kubernetes get-credentials --resource-group=group --name=cluster -f /Users/me/.kube/config --debug 

そして、次の情報受信:紺碧CLIの

Password for private key: 
paramiko.transport : starting thread (client mode): 0x9659890L 
paramiko.transport : Local version/idstring: SSH-2.0-paramiko_2.3.1 
paramiko.transport : Remote version/idstring: SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2 
paramiko.transport : Connected (version 2.0, client OpenSSH_7.2p2) 
paramiko.transport : kex algos:[u'[email protected]', u'ecdh-sha2-nistp256', u'ecdh-sha2-nistp384', u'ecdh-sha2-nistp521', u'diffie-hellman-group-exchange-sha256', u'diffie-hellman-group14-sha1'] server key:[u'ssh-rsa', u'rsa-sha2-512', u'rsa-sha2-256', u'ecdsa-sha2-nistp256', u'ssh-ed25519'] client encrypt:[u'[email protected]', u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'[email protected]', u'[email protected]'] server encrypt:[u'[email protected]', u'aes128-ctr', u'aes192-ctr', u'aes256-ctr', u'[email protected]', u'[email protected]'] client mac:[u'[email protected]', u'[email protected]', u'[email protected]', u'[email protected]', u'[email protected]', u'[email protected]', u'[email protected]', u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-sha1'] server mac:[u'[email protected]', u'[email protected]', u'[email protected]', u'[email protected]', u'[email protected]', u'[email protected]', u'[email protected]', u'hmac-sha2-256', u'hmac-sha2-512', u'hmac-sha1'] client compress:[u'none', u'[email protected]'] server compress:[u'none', u'[email protected]'] client lang:[u''] server lang:[u''] kex follows?False 
paramiko.transport : Kex agreed: ecdh-sha2-nistp256 
paramiko.transport : HostKey agreed: ecdsa-sha2-nistp256 
paramiko.transport : Cipher agreed: aes128-ctr 
paramiko.transport : MAC agreed: hmac-sha2-256 
paramiko.transport : Compression agreed: none 
paramiko.transport : kex engine KexNistp256 specified hash_algo <built-in function openssl_sha256> 
paramiko.transport : Switch to new keys ... 
paramiko.transport : Trying SSH key 765f702f5fff7fe30260d53b5bbb57eb 
paramiko.transport : userauth is OK 
paramiko.transport : Authentication (publickey) successful! 
paramiko.transport : [chan 0] Max packet in: 32768 bytes 
paramiko.transport : Received global request "[email protected]" 
paramiko.transport : Rejecting "[email protected]" global request from server. 
paramiko.transport : [chan 0] Max packet out: 32768 bytes 
paramiko.transport : Secsh channel 0 opened. 
paramiko.transport : [chan 0] Sesch channel 0 request ok 
paramiko.transport : [chan 0] EOF received (0) 
paramiko.transport : [chan 0] EOF sent (0) 
scp: .kube/config: No such file or directory 
Traceback (most recent call last): 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/main.py", line 36, in main 
    cmd_result = APPLICATION.execute(args) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/application.py", line 212, in execute 
    result = expanded_arg.func(params) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 377, in __call__ 
    return self.handler(*args, **kwargs) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 626, in _execute_command 
    reraise(*sys.exc_info()) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 603, in _execute_command 
    result = op(client, **kwargs) if client else op(**kwargs) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/acs/custom.py", line 814, in k8s_get_credentials 
    _k8s_get_credentials_internal(name, acs_info, path, ssh_key_file) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/acs/custom.py", line 835, in _k8s_get_credentials_internal 
    '.kube/config', path_candidate, key_filename=ssh_key_file) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/azure/cli/command_modules/acs/acs_client.py", line 64, in secure_copy 
    scp.get(src, dest) 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/scp.py", line 198, in get 
    self._recv_all() 
    File "/Users/me/lib/azure-cli/lib/python2.7/site-packages/scp.py", line 348, in _recv_all 
    raise SCPException(asunicode(msg[1:])) 
SCPException: scp: .kube/config: No such file or directory 

バージョンは2.0.18です。アドバイスをいただければ幸いです。

答えて

0

--file -fフラグを使用して、.kubeディレクトリの "config"ファイルの絶対パスを指定し、さらに--debugを使用してさらにデバッグすることができます。私の場合は

az acs kubernetes get-credentials --resource-group=group --name=cluster -f /.../.../.kube/config --debug

+0

ありがとう、私はそれを試します – experimenter

+0

私はそれを試して、私の質問を更新しました。あなたが見ていればそれほど感謝しています! – experimenter

+0

〜/ .kube/configに自分のクラスタを追加しようとしていますが、get-credentialsコマンドがそのように見えますが、私にとっては失敗します。また、Python 3.6でそれをやろうとしましたが、それと同じエラーです。 – experimenter

0

、.kube/configファイルは、マスター上で作成されませんでした。 .kube/configファイルを作成しようとしたときにエラーが発生しました。私はマスターノードにssh-ingして/ var/log/azureディレクトリを調べました。エラーはサービスプリンシパルのパスワードに関連していました。新しいサービスプリンシパルでは、新しいクラスターは正常に動作します。

関連する問題