5.k8s部署sentinel
5.k8s部署sentinel
一.编写资源清单
01-deploy-sentinel.yaml
root@master231:/opt/pods/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: harbor.wuflstu.com/middleware/sentinel-dashboard:v1.8.8
ports:
- containerPort: 8858
name: web
02-svc-sentinel.yaml
root@master231:/opt/pods/sentinel# cat 02-svc-sentinel.yaml
apiVersion: v1
kind: Service
metadata:
name: svc-sentinel
spec:
type: NodePort
ports:
- port: 8858
targetPort: 8858
nodePort: 30858
selector:
apps: sentinel
二.部署服务
1)启动服务
root@master231:/opt/pods/sentinel# ll
total 16
drwxr-xr-x 2 root root 4096 Apr 15 15:11 ./
drwxr-xr-x 11 root root 4096 Apr 15 15:01 ../
-rw-r--r-- 1 root root 393 Apr 15 15:11 01-deploy-sentinel.yaml
-rw-r--r-- 1 root root 179 Apr 15 15:05 02-svc-sentinel.yaml
2)启动
root@master231:/opt/pods/sentinel# kubectl apply -f .
deployment.apps/deploy-sentinel created
service/svc-sentinel created
3)查看服务
root@master231:/opt/pods/sentinel# kubectl get pod,svc -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
pod/deploy-sentinel-666f57d6c-z2wr2 1/1 Running 0 8m5s 10.100.2.54 worker233 <none> <none>
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
service/kubernetes ClusterIP 10.200.0.1 <none> 443/TCP 85d <none>
service/svc-sentinel NodePort 10.200.210.203 <none> 8858:30858/TCP 8m6s apps=sentinel
访问页面
账号密码默认 sentinel/sentinel

登录成功


浙公网安备 33010602011771号