.net kubernetes群集中有2个或更多副本时的dotnet监视器

yks3o0rb  于 2022-12-24  发布在  .NET
关注(0)|答案(1)|浏览(136)

我想在kubernetes部署中监控同一个应用的几个pod,结果是正确监控一个pod,如果有很多pod,那么如何正确监控
单个复制副本部署配置

apiVersion: apps/v1
kind: Deployment 
namespace: test       
spec:
  progressDeadlineSeconds: 600
  replicas: 1 
  template:  
    spec:
      volumes:
      - name: diagnostics
        emptyDir: {}
      containers:
      - env:
        - name: DOTNETMONITOR_DiagnosticPort__ConnectionMode
          value: Listen
        - name: DOTNETMONITOR_DiagnosticPort__EndpointName
          value: /diag/port.sock
        - name: DOTNETMONITOR_Storage__DumpTempFolder
          value: /diag/dumps
        - name: DOTNETMONITOR_Urls
          value: http://localhost:52323           
        image: manager:master
        imagePullPolicy: Always
        name: chart
        ports:
        - containerPort: 10800
          protocol: TCP
        securityContext: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
          - mountPath: /tmp
            name: diagnostics
      - name: sidecar
        image: dotnet/nightly/monitor
        ports:
        - containerPort: 52325
        args: ["collect","--urls", "http://*:52323", "--metricUrls", "http://*:52325", "--no-auth"]
        volumeMounts:
          - name: diagnostics
            mountPath: /tmp
        resources:
          limits:
            cpu: "1"
            memory: 500Mi
          requests:
            cpu: 200m
            memory: 500Mi
unftdfkk

unftdfkk1#

这不是一个很好的解决方案,但我决定使用vmagent和configsforpod中的一个角色

相关问题