k8s部署sentinel-1.8.1


1.參考連接

https://blog.51cto.com/saynaihe/2774368
https://github.com/foxiswho/docker-sentinel

2.拷貝: https://github.com/foxiswho/docker-sentinel  修改Dockerfile,並下載在  https://github.com/alibaba/Sentinel/releases/tag/1.8.1  下載安裝包,改名字為sentinel-dashboard.jar

 

 3.開始build鏡像

docker build . -t  xxxxx/sentinel:1.8.1
docker push   xxxxx/sentinel:1.8.1

4.在kubernetes集群中部署sentinel

apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: sentinel
  namespace: milvus-test
  labels:
    app: sentinel
spec:
  serviceName: sentinel
  replicas: 1
  selector:
    matchLabels:
      app: sentinel
  template:
    metadata:
      labels:
        app: sentinel
    spec:
      nodeSelector:
        gpu: prod-gpu
      imagePullSecrets:
        - name: ksyunregistrykey
      containers:
        - name: sentinel
          image: xxxxxxx/sentinel:1.8.1
          imagePullPolicy: IfNotPresent
          resources:
            limits:
              cpu: 4000m
              memory: 8G
            requests:
              cpu: 400m
              memory: 1024Mi
          env:
            - name: TZ
              value: Asia/Shanghai
            - name: JAVA_OPT_EXT
              value: "-Dserver.servlet.session.timeout=7200"

          ports:
            - containerPort: 8280
            - containerPort: 8719
          volumeMounts:
            - name: vol-log
              mountPath: /opt/logs
      volumes:
        - name: vol-log
          hostPath:
            path: /logs/sentinel/logs-test
            type: Directory
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: sentinel
  name: sentinel
  namespace: milvus-test

spec:
  type: NodePort
  ports:
  - name: "8280"
    port: 8280
    targetPort: 8280
    nodePort: 19534
  - name: "8719"
    port: 8719
    targetPort: 8719
    nodePort: 19535
  selector:
    app: sentinel

5.驗證:

 

 用戶名密碼為   sentinel   /sentinel

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM