部署k8s-dashboard完成以后访问出现错误v

原文:http://dockone.io/question/1266
浏览器访问8080端跳转出现这个,是什么原因
Error: 'dial tcp 172.17.34.2:9090: getsockopt: connection refused'
Trying to reach: 'http://172.17.34.2:9090/'
求各位大神支招 
qq 2323273838

pod文件是官方的

Copyright 2015 Google Inc. All Rights Reserved.

#

Licensed under the Apache License, Version 2.0 (the "License");

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

#

http://www.apache.org/licenses/LICENSE-2.0

#

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

Configuration to deploy release version of the Dashboard UI.

#

Example usage: kubectl create -f <this_file>

kind: Deployment
apiVersion: extensions/v1beta1
metadata:
labels:
app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
app: kubernetes-dashboard
template:
metadata:
labels:
app: kubernetes-dashboard
# Comment the following annotation if Dashboard must not be deployed on master
annotations:
scheduler.alpha.kubernetes.io/tolerations: |
[
{
"key": "dedicated",
"operator": "Equal",
"value": "master",
"effect": "NoSchedule"
}
]
spec:
containers:
- name: kubernetes-dashboard
image: docker.io/mritd/kubernetes-dashboard-amd64
#imagePullPolicy: Always
ports:
- containerPort: 9090
protocol: TCP
args:
# Uncomment the following line to manually specify Kubernetes API server Host
# If not specified, Dashboard will attempt to auto discover the API server and connect
# to it. Uncomment only if the default does not work.
- --apiserver-host= http://192.168.88.128:8080
livenessProbe:
httpGet:
path: /
port: 9090
initialDelaySeconds: 30

timeoutSeconds: 30

kind: Service
apiVersion: v1
metadata:
labels:
app: kubernetes-dashboard
name: kubernetes-dashboard
namespace: kube-system
spec:
type: NodePort
ports:
- port: 80
targetPort: 9090
selector:
app: kubernetes-dashboard
QQ图片20161229161654.png
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
部署k8sdashboard,你可以按照以下步骤进行操作: 1. 下载Dashboard所需的yaml文件,并进行相应修改。可以使用以下命令下载文件: ``` wget https://www.cloudelf.cn/kubernetes/kubernetes-dashboard.yaml ``` 然后,你需要修改yaml文件中的一些字段,包括将service type字段设置为nodeport,并将所有的ns修改为kube-system。 2. 在K8S工具目录中创建dashboard工作目录。 3. 查看核心文件,包括dashboard-rbac.yaml、dashboard-secret.yaml、dashboard-configmap.yaml、dashboard-controller.yaml、dashboard-service.yaml、k8s-admin.yaml和dashboard-cert.sh。这些文件包含了dashboard所需的配置和资源。 4. 使用kubectl create命令创建资源。你需要分别使用kubectl create命令创建dashboard-rbac.yaml、dashboard-secret.yaml、dashboard-configmap.yaml、dashboard-controller.yaml和dashboard-service.yaml。 5. 如果需要,为node节点准备加载dashboard镜像。这一步骤可以根据需要进行,如果不需要加载镜像,可以跳过这一步。 6. 进行访问测试。可以使用不同的浏览器进行访问测试,包括Edge浏览器、火狐浏览器和360浏览器。对于每个浏览器,你需要进行相应的配置和操作。 7. 获取令牌并使用令牌登录dashboard。你可以使用k8s-admin.yaml文件创建令牌,并获取相应的令牌信息。然后,你可以使用获取到的令牌登录dashboard。 8. 最后,你可以进行dashboard的操作,包括命名空间、节点、角色、工作负载、命令行、日志和创建容器等。这些操作可以根据需求进行。 以上是部署k8sdashboard的一般步骤,你可以按照这些步骤进行操作。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值