配置kubernetes UI图形化界面
配置Kubernetes网络
- 在master和nodes上都需要安装flannel
yum install flannel |
- 在master和nodes上都需要配置flannel
vi /etc/sysconfig/flanneld
# Flanneld configuration options # etcd url location. Point this to the server where etcd runs # etcd config key. This is the configuration key that flannel queries # Any additional options that you want to pass |
- 配置etcd中flannel的key,需要在etcd中进行配置
etcdctl mk /atomic.io/network/config '{ "Network": "192.168.0.0/16" }' |
- 启动
在master节点上启动
systemctl enable flanneld.service |
在各个Nodes上启动
systemctl enable flanneld.service |
运行 kubectl get pods --all-namespaces -o wide 看获取的ip地址是否正确
编辑一个kubernetes-dashboard.yaml文件
最新版本可以去官网下载
https://github.com/kubernetes/dashboard/blob/master/src/deploy/kubernetes-dashboard.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
# Keep the name in sync with image version and
# gce/coreos/kube-manifests/addons/dashboard counterparts
name: kubernetes-dashboard-latest
namespace: kube-system
spec:
replicas:
template:
metadata:
labels:
k8s-app: kubernetes-dashboard
version: latest
kubernetes.io/cluster-service: "true"
spec:
containers:
- name: kubernetes-dashboard
image: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.5.1
resources:
# keep request = limit to keep this container in guaranteed class
limits:
cpu: 100m
memory: 50Mi
requests:
cpu: 100m
memory: 50Mi
ports:
- containerPort:
args:
- --apiserver-host=http://10.182.169.33:8080
livenessProbe:
httpGet:
path: /
port:
initialDelaySeconds:
timeoutSeconds:
---
kind: Service
metadata:
name: kubernetes-dashboard
namespace: kube-system
labels:
k8s-app: kubernetes-dashboard
kubernetes.io/cluster-service: "true"
spec:
selector:
k8s-app: kubernetes-dashboard
ports:
- port:
targetPort:
注意修改--apiserver-host=http://10.182.169.33:8080 指向自己的api server.
创建dashboard
kubectl create -f kubernetes-dashboard.yaml kubectl get -f kubernetes-dashboard.yaml |
发现deploy/kubernetes-dashboard-latest一直不在avaiable状态,通过下面命令查询
kubectl get pods --all-namespaces |
发现kube-system的命名空间下,总是有个kubernetes-dashboard-latest-1590787137-pp8qd处于CrashLoopBackOff状态.
可以通过下面命令查看namespace的日志情况
kubectl describe po kubernetes-dashboard --namespace=kube-system |
删除kubernetes-dashboard
因为没搞清楚什么原因,很想再试一次,删除命令如下:
kubectl delete -f kubernetes-dashboard.yaml |
在运行kubectl get pods --all-namespaces发现总是有kube-system命名空间下的pod在运行.最后通过指定命名空间删除
kubectl delete --all pods --namespace=kube-system kubectl delete deployment kubernetes-dashboard --namespace=kube-system |
注意,如果只删除pod会发现删完后又会有个同样的pod启动起来,删除deployment即可.
查看日志确定原因
最重要还是要看日志,最重要还是要看日志,最重要还是要看日志, 重要事情说三遍,此问题浪费3个钟头时间 :(
kubectl logs -f kubernetes-dashboard-latest-3243398-thc7k -n kube-system [root@k8s-master ~]# kubectl logs -f kubernetes-dashboard-latest-3243398-thc7k -n kube-system |
发现是dns把k8s-master解析成202.96.134.33的地址了,修改kubernetes-dashboard.yaml中的apiserver-host=http://k8s-master:8080为
http://192.168.0.104:8080后,再进行create就成功.
访问http://192.168.0.104:8080/ui,界面如下:
点击weblogic Pod的日志,显示如下:
最新文章
- Configuring Service Broker for Asynchronous Processing
- Linux 学习之DNS服务器
- Regarding learning
- windows installer 出错问题解决
- Sharepoint 2013 安装部署系列篇 第一篇 -- 系统集群安装
- XtraBackup原理4
- 消息队列数量统计(MSMQ,Performance Counter)
- ASP.NET数据报表之柱状图 ------工作日志
- java.io.FileNotFoundException: class path resource [META-INF/xfire/services.xml] cannot be opened because it does not exist
- [置顶] Objective-C ,ios,iphone开发基础:命名规范
- 文件系统常用命令df、du、fsck、dumpe2fs
- [Python Study Notes]磁盘信息和IO性能
- (转)SQLServer_十步优化SQL Server中的数据访问一
- AspNet mvc的一个bug
- vue 选城市三级联动
- CodeForces 1099F - Cookies - [DFS+博弈+线段树]
- MySQL的瑞士军刀
- Markdown新手快速入门基础教程
- RGB 颜色对照表
- HOJ 2226&POJ2688 Cleaning Robot(BFS+TSP(状态压缩DP))