Dockerfile
FROM openjdk:8-jdk-alpine
LABEL maintainer="l.hao.2012@qq.com"
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV LC_ALL "zh_CN.UTF-8"
RUN mkdir /app
WORKDIR /app
COPY sentinel-dashboard-1.8.4.jar .
EXPOSE 8088
ENTRYPOINT ["java","-Dserver.port=8080","-Dcsp.sentinel.dashboard.server=localhost:8080","-jar","sentinel-dashboard-1.8.4.jar"]
docker build
docker push
sentinel.yaml
---
apiVersion: v1
kind: Service
metadata:
name: sentinel-headless
namespace: kube-public
labels:
app: sentinel
spec:
ports:
- protocol: TCP
name: http
port: 8080
targetPort: 8080
clusterIP: None
selector:
app: sentinel
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: sentinel
namespace: kube-public
spec:
serviceName: sentinel-headless
replicas: 1
template:
metadata:
labels:
app: sentinel
annotations:
pod.alpha.kubernetes.io/initialized: "true"
spec:
containers:
- name: sentinel
imagePullPolicy: IfNotPresent
image: tanghao2018/sentinel:1.8.4
ports:
- containerPort: 8080
name: client
selector:
matchLabels:
app: sentinel
kubectl create -f sentinal.yaml
在master节点配置反向代理
:8080 {
reverse_proxy sentinel-0.sentinel-headless.kube-public.svc.cluster.local:8080
}
重新加载配置
caddy reload
浏览器访问
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)