我是kubernetes的新手,我正在天蓝色的上面设置它。
我已根据我在Azure文档中找到的内容创建了此脚本:
}
现在,我希望看到kubernetes仪表板,我可以做很多事情。但似乎事实并非如此。如果我打开FF控制台,我会看到大量的404,页面仍然是空白的。
有人看到它不起作用的原因吗?或者就如何解决这个问题给我任何建议?
由于
我已尝试执行#!/bin/bash
cd "$( dirname "$0" )"
source vars.sh
echo "Create group $KUBE_GROUP"
az group create \
--verbose \
--name $KUBE_GROUP \
--location $LOCATION
echo "Create acs $KUBE_NAME"
az acs create \
--verbose \
--name $KUBE_NAME \
--resource-group $KUBE_GROUP \
--orchestrator-type Kubernetes \
--dns-prefix $KUBE_NAME \
--generate-ssh-key \
--agent-count 3 > creategroup.log 2>&1
echo "Get credentials for $KUBE_GROUP"
az acs kubernetes get-credentials \
--verbose \
--resource-group $KUBE_GROUP \
--name $KUBE_NAME > getcredentials.log 2>&1
echo "Create registry $REGISTRY_NAME"
az acr create \
--name $REGISTRY_NAME \
--resource-group $KUBE_GROUP \
--location $LOCATION \
--admin-enabled true \
--sku Basic > create_registry.log
echo "Setup kubernetes environment"
ssh-keygen -f "${HOME}/.ssh/known_hosts" -R "${KUBE_NAME}mgmt.westeurope.cloudapp.azure.com"
scp azureuser@${KUBE_NAME}mgmt.westeurope.cloudapp.azure.com:.kube/config $HOME/.kube/config
kubectl config current-context
#echo "Create a single nginx instance in kubernetes"
#kubectl run namenginx1 --image=nginx
REGISTRY_PASSWORD=$( az acr credential show \
--name $REGISTRY_NAME \
--resource-group $KUBE_GROUP \
| jq '.passwords[0] .value' \
| sed 's/"//g' )
echo "Create secret docker-registry"
kubectl create secret docker-registry kuberegistry \
--docker-server $REGISTRY_URL \
--docker-username $REGISTRY_NAME \
--docker-password $REGISTRY_PASSWORD \
--docker-email $REGISTRY_EMAIL > kuberegistry.log 2>&1
nohup kubectl proxy &
firefox 'http://localhost:8001/ui/'
但我收到此错误:
az acs kubernetes browse -g $KUBE_GROUP -n $KUBE_NAME
注意:我已确保'proxycommand'
Traceback (most recent call last):
File "/usr/local/Cellar/azure-cli/2.0.19/libexec/lib/python3.6/site-packages/azure/cli/main.py", line 36, in main
cmd_result = APPLICATION.execute(args)
File "/usr/local/Cellar/azure-cli/2.0.19/libexec/lib/python3.6/site-packages/azure/cli/core/application.py", line 212, in execute
result = expanded_arg.func(params)
File "/usr/local/Cellar/azure-cli/2.0.19/libexec/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 377, in __call__
return self.handler(*args, **kwargs)
File "/usr/local/Cellar/azure-cli/2.0.19/libexec/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 620, in _execute_command
reraise(*sys.exc_info())
File "/usr/local/Cellar/azure-cli/2.0.19/libexec/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/usr/local/Cellar/azure-cli/2.0.19/libexec/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 602, in _execute_command
result = op(client, **kwargs) if client else op(**kwargs)
File "/usr/local/Cellar/azure-cli/2.0.19/libexec/lib/python3.6/site-packages/azure/cli/command_modules/acs/custom.py", line 154, in k8s_browse
_k8s_browse_internal(name, acs_info, disable_browser, ssh_key_file)
File "/usr/local/Cellar/azure-cli/2.0.19/libexec/lib/python3.6/site-packages/azure/cli/command_modules/acs/custom.py", line 164, in _k8s_browse_internal
_k8s_get_credentials_internal(name, acs_info, browse_path, ssh_key_file)
File "/usr/local/Cellar/azure-cli/2.0.19/libexec/lib/python3.6/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 "/usr/local/Cellar/azure-cli/2.0.19/libexec/lib/python3.6/site-packages/azure/cli/command_modules/acs/acs_client.py", line 65, in secure_copy
proxy = paramiko.ProxyCommand(host_config['proxycommand'])
KeyError: 'proxycommand'
未运行且端口没有“忙碌”。
答案 0 :(得分:1)
我在我的实验室测试你的脚本,你的脚本中有一个错误。
{KUBE_NAME}mgmt.westeurope.cloudapp.azure.com
它应该是{KUBE_NAME}.westeurope.cloudapp.azure.com
。不需要管理。
如果要连接到Web UI,则需要运行
az acs kubernetes get-credentials --resource-group=$KUBE_GROUP --name=$KUBE_NAME
nohup az acs kubernetes browse -g $KUBE_GROUP -n $KUBE_NAME &
有关此问题的详情,请参阅此link。
更新
您需要检查.kube/config
文件,如果可能,您可以重新创建它。
问题是因为浏览器缓存。清理浏览器中的缓存将解决此问题。
外部更新:
在缓存旁边,当命令在浏览器上打开页面时,它会直接转到http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy
。最后有一个缺失/。它应该是http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/