锐单电子商城 , 一站式电子元器件采购平台!
  • 电话:400-990-0325

k8s-部署netchecker-service

时间:2022-09-07 13:00:00 16z二极管丝印

1 网络检查服务器

网络检查器是一个应用程序,旨在为网络连接提供简单的测试。检查服务器部分和大量代理之间的连接。然后代理将定期向服务器报告,报告数据显示链接的活动。

2 用法

要在 k8s pod 并监控中启动服务器 8081 请使用以下参数:

server -v 5 -logtostderr -kubeproxyinit -endpoint 0.0.0.0:8081

3 API接口

以下服务器公开 API 接口。

  • GET/POST - /api/v1/agents/{agent_name} - 获取并创建/更新代理缓存中的代理项目

  • GET - /api/v1/agents/ - 整个代理缓存转储

  • GET - /api/v1/connectivity_check - 服务器与代理之间的连接检查结果


yaml部署文件

 --- apiVersion: apps/v1 kind: Deployment metadata:   annotations: { 
        }   labels:     app: netchecker-server   name: netchecker-server   namespace: default   resourceVersion: '69696' spec:   progressDeadlineSeconds: 600   replicas: 0   revisionHistoryLimit: 10   selector:     matchLabels:       app: netchecker-server   strategy:     rollingUpdate:       maxSurge: 25%       maxUnavailable: 25%     type: RollingUpdate   template:     metadata:       creationTimestamp: null       labels:         app: netchecker-server       name: netchecker-server     spec:       containers:         - args:             - '-v=5'             - '-logtostderr'             - '-kubeproxyinit=false'             - '-endpoint=0.0.0.0:8081'             - '-etcd-endpoints=http://127.0.0.1:2379'          image: 'docker.io/mirantis/k8s-netchecker-server:v1.2.2'
          imagePullPolicy: IfNotPresent
          name: netchecker-server
          ports:
            - containerPort: 8081
              protocol: TCP
          resources:
            limits:
              cpu: 100m
              memory: 256M
            requests:
              cpu: 50m
              memory: 64M
          securityContext:
            runAsGroup: 1000
            runAsUser: 1000
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
        - command:
            - etcd
            - '--listen-client-urls=http://127.0.0.1:2379'
            - '--advertise-client-urls=http://127.0.0.1:2379'
            - '--data-dir=/var/lib/etcd'
            - '--enable-v2'
            - '--force-new-cluster'
          image: 'quay.io/coreos/etcd:v3.5.4'
          imagePullPolicy: IfNotPresent
          name: etcd
          resources:
            limits:
              cpu: 200m
              memory: 256M
            requests:
              cpu: 100m
              memory: 128M
          securityContext:
            runAsGroup: 1000
            runAsUser: 1000
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /var/lib/etcd
              name: etcd-data
      dnsPolicy: ClusterFirst
      priorityClassName: k8s-cluster-critical
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: { 
        }
      serviceAccount: netchecker-server
      serviceAccountName: netchecker-server
      terminationGracePeriodSeconds: 30
      tolerations:
        - effect: NoSchedule
          operator: Exists
      volumes:
        - emptyDir: { 
        }
          name: etcd-data
status:
  conditions:
    - lastTransitionTime: '2022-06-18T09:47:16Z'
      lastUpdateTime: '2022-06-18T09:47:19Z'
      message: ReplicaSet "netchecker-server-d774f8f57" has successfully progressed.
      reason: NewReplicaSetAvailable
      status: 'True'
      type: Progressing
    - lastTransitionTime: '2022-06-19T00:23:09Z'
      lastUpdateTime: '2022-06-19T00:23:09Z'
      message: Deployment has minimum availability.
      reason: MinimumReplicasAvailable
      status: 'True'
      type: Available
  observedGeneration: 4



---
apiVersion: v1
kind: Service
metadata:
  annotations: { 
        }
  name: netchecker-service
  namespace: default
  resourceVersion: '886'
spec:
  clusterIP: 10.233.112.9
  clusterIPs:
    - 10.233.112.9
  externalTrafficPolicy: Cluster
  internalTrafficPolicy: Cluster
  ipFamilies:
    - IPv4
  ipFamilyPolicy: SingleStack
  ports:
    - nodePort: 31081
      port: 8081
      protocol: TCP
      targetPort: 8081
  selector:
    app: netchecker-server
  sessionAffinity: None
  type: NodePort
status:
  loadBalancer: { 
        }


锐单商城拥有海量元器件数据手册IC替代型号,打造电子元器件IC百科大全!

相关文章