惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
博客园 - Franky
MyScale Blog
MyScale Blog
L
LangChain Blog
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
Stack Overflow Blog
Stack Overflow Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
量子位
A
About on SuperTechFans
C
Check Point Blog
大猫的无限游戏
大猫的无限游戏
Last Week in AI
Last Week in AI
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
V
Visual Studio Blog
Vercel News
Vercel News
B
Blog
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
U
Unit 42

博客园 - cn2025

kubeSphere【ks-controller-manager-webhook-cert】证书 20260814 K8s -nacos集 20260813 K8s - 安装部署redis集群-哨兵sentinels集(支持从K8s外部访问)20260812 k8s-deployment发布测试(pv-pvc-deployment-service) 20260810 K8s - 安装部署Kafka、Zookeeper集群教程(支持从K8s外部访问)20260808 k8s-关机及启动脚本工具 【kubeSphere发布ruoyi-pro前端】工具脚本20260731 【k8s】 etcd服务端及客户端版本及快照【定时】备份 20260730 harbor【https启用】及k8节点部证书20260728 kube-flannel.yml k8s集群-安装helm 【kubeShpere】 官网 20260710 kubesphere-KDP 工具脚本【kubeSphere发布ruoyi-pro前端】20260720 HbuilderX 内置终端转为 gitBash 20260720 kubeSphere发布ruoyi-pro后端-用到脚本 kubeSphere发布ruoyi-web前端 20260711 kubeSphere发布ruoyi-pro后端 k8s集群-kubeShpere 20260710 安装Helm 20260710 k8s-portainer docker 镜像查询 k8集群一键重置 docker run OceanBase spring ai alibaba doc AI2.0 【多模态】 20260615 世界只有一个墨脱 AI2.0 【Mcp-client】 20260611 AI2.0 【Mcp-server】 20260611 GoLand 配Go SDK AI2.0 【redis向量-Rag】 问答顾问器QuestionAnswerAdvisor 20260608
K8s -sentinel-dashboard【nacos版本】集 20260815
2026cn · 2026-08-15 · via 博客园 - cn2025

一、k8s节点及nacos库

master:192.168.91.166

node2:192.168.91.167

node3:192.168.91.168

image

K8s 集群:1 主 2 节点(k8s-master:192.168.91.166、node2:167、node3:168)
Nacos 镜像:swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/nacos/nacos-server:latest
Nacos 库存:192.168.91.165  ry-config   

image

image

二、创建sentinel-dashboard集群

1、创建命名空间

 kubectl create namespace sentinel-dashboard-cluster

 2、创建sentinel-dashboard  deployment

2.1 ##创建deployment

kubectl apply -f sentinel-dashboard-deployment.yaml

####查看 

kubectl get pod  -n sentinel-dashboard-cluster

image

image

image

2.2 sentinel-dashboard-deployment.yaml内容

cat << 'EOF' > sentinel-dashboard-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: sentinel-dashboard
namespace: sentinel-dashboard-cluster
spec:
replicas: 3
selector:
matchLabels:
app: sentinel-dashboard
template:
metadata:
labels:
app: sentinel-dashboard
spec:
containers:
- name: sentinel-dashboard
image: swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/bladex/sentinel-dashboard:1.8.9
ports:
- containerPort: 8858
env:
- name: NACOS_ADDR
value: "nacos-headless.nacos-cluster.svc.cluster.local:8848"
- name: NACOS_USERNAME
value: "nacos"
- name: NACOS_PASSWORD
value: "nacos"
- name: NACOS_GROUP_ID
value: "DEFAULT_GROUP"
- name: NACOS_NAMESPACE
value: ""
resources:
limits:
cpu: "1"
memory: 1Gi
requests:
cpu: 500m
memory: 512Mi
livenessProbe:
httpGet:
path: /
port: 8858
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: 8858
initialDelaySeconds: 20
periodSeconds: 5
EOF

3、创建service

3.1

##创建service
kubectl apply -f sentinel-dashboard-service.yaml

####查看 

kubectl get svc -n sentinel-dashboard-cluster

image

image

3.2 ssentinel-dashboard-service.yaml内容

cat << 'EOF' > sentinel-dashboard-service.yaml
apiVersion: v1
kind: Service
metadata:
name: sentinel-dashboard-svc
namespace: sentinel-dashboard-cluster
spec:
type: ClusterIP
selector:
app: sentinel-dashboard
ports:
- port: 8858
targetPort: 8858
EOF

4、创建ingress

注:【三、创建ingress‑nginx‑controller 控制器组件

4.1

##创建ingress
kubectl apply -f sentinel-dashboard-ingress.yaml

####查看 

kubectl get ingress -n sentinel-dashboard-cluster

image

image

image

4.2 ssentinel-dashboard-ingress.yaml内容

cat << 'EOF' > sentinel-dashboard-ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sentinel-dashboard-ingress
namespace: sentinel-dashboard-cluster
annotations:

# 开启cookie会话保持,绑定浏览器到同一个pod,解决登录401
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "SENTINEL_SESSION"
nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
spec:
ingressClassName: nginx
rules:
- host: sentinel.192.168.91.166.nip.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: sentinel-dashboard-svc
port:
number: 8858
- host: sentinel.192.168.91.167.nip.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: sentinel-dashboard-svc
port:
number: 8858
- host: sentinel.192.168.91.168.nip.io
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: sentinel-dashboard-svc
port:
number: 8858
EOF

三、创建ingress‑nginx‑controller 控制器组件

1、wget https://gitee.com/mirrors/ingress-nginx/raw/main/deploy/static/provider/cloud/deploy.yaml

2、mv deploy.yaml文件名改成 ingress-nginx-deploy.yaml

image

3、vi  ingress-nginx-deploy.yaml文件的image调整https://docker.aityp.com/有效地址

image

4、创建ingress‑nginx‑controller

kubectl apply -f ingress-nginx-deploy.yaml

image

###部署完成检查

kubectl get pods -n ingress-nginx

查看 ingress‑nginx 的

service kubectl get svc -n ingress-nginx

image

 ###编辑 service 修改类型

kubectl edit svc ingress-nginx-controller -n ingress-nginx
找到
spec:
type: LoadBalancer
修改为
spec:
type: NodePort

image

image

image

image

 ####查看 pod 分布 

kubectl get pods -n ingress-nginx -o wide

image

四、sentinel-dashboard访问

http://sentinel.192.168.91.166.nip.io:31784/#/login
http://sentinel.192.168.91.167.nip.io:31784/#/login
http://sentinel.192.168.91.168.nip.io:31784/#/login

###查看 pod 分布

image

http://sentinel.192.168.91.167.nip.io:31784/#/dashboard/metric/sentinel-dashboard

image