K8S常见的微服务中间件部署之sentinel
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
一.部署sentinel
1.编写资源清单
[root@master241 07-sentinel]# cat 01-deploy-sentinel.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: deploy-sentinel
spec:
replicas: 1
selector:
matchLabels:
apps: sentinel
template:
metadata:
labels:
apps: sentinel
spec:
containers:
- name: sentinel
image: docker.io/herodotus/sentinel-dashboard:v1.8.8
ports:
- containerPort: 8858
name: web
[root@master241 07-sentinel]#
[root@master241 07-sentinel]# cat 02-svc-sentinel.yaml
apiVersion: v1
kind: Service
metadata:
name: svc-sentinel
spec:
ports:
- port: 8858
selector:
apps: sentinel
type: LoadBalancer
[root@master241 07-sentinel]#
2.部署服务
[root@master241 07-sentinel]# ll
total 16
drwxr-xr-x 2 root root 4096 Jul 14 17:53 ./
drwxr-xr-x 9 root root 4096 Jul 14 16:38 ../
-rw-r--r-- 1 root root 382 Jul 14 17:49 01-deploy-sentinel.yaml
-rw-r--r-- 1 root root 142 Jul 14 17:53 02-svc-sentinel.yaml
[root@master241 07-sentinel]#
[root@master241 07-sentinel]# kubectl apply -f .
deployment.apps/deploy-sentinel created
service/svc-sentinel created
[root@master241 07-sentinel]#
[root@master241 07-sentinel]# kubectl get pods -l apps=sentinel -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
deploy-sentinel-7877d554f-9pmk4 1/1 Running 0 14s 10.100.165.188 worker242 <none> <none>
[root@master241 07-sentinel]#
[root@master241 07-sentinel]# kubectl get svc svc-sentinel
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
svc-sentinel LoadBalancer 10.197.103.252 10.0.0.157 8858:30105/TCP 20s
[root@master241 07-sentinel]#
二.登录sentinel的WebUI
1.访问sentinel的WebUI
如上图所示,我们可以输入默认的用户名密码"sentinel",来登录WebUI。
2.登录sentinel的WebUI
如上图所示,登录成功后,我们就可以在sentinel来进行操作啦~
本文来自博客园,作者:尹正杰,转载请注明原文链接:https://www.cnblogs.com/yinzhengjie/p/18988512,个人微信: "JasonYin2020"(添加时请备注来源及意图备注,有偿付费)
当你的才华还撑不起你的野心的时候,你就应该静下心来学习。当你的能力还驾驭不了你的目标的时候,你就应该沉下心来历练。问问自己,想要怎样的人生。