当前位置: 首页 > 工具软件 > kubewatch > 使用案例 >

kubewatch

池麒
2023-12-01
  1. Kubewatch是一款Kubernetes监控工具,该产品可将Kubernetes事件发布到团队通信应用程序,即Slack。Kubewatch以Kubernetes集群内部pod的形式运行,借此监视相关系统中所发生的各种变化。另外,您可以通过编辑配置文件来指定需要接收的通知
  2. github地址 GitHub - vmware-archive/kubewatch: Watch k8s events and trigger Handlers
  3. apiVersion: v1
    kind: ConfigMap
    metadata:
      name: kubewatch
      namespace: test
    data:
      .kubewatch.yaml: |
        namespace: ""
        handler:
          slack:
            token: <token>
            channel: <channel>
        resource:
          deployment: false
          replicationcontroller: false
          replicaset: false
          daemonset: false
          services: true
          pod: true
          secret: false
          configmap: false
    ---
    kind: ClusterRole
    apiVersion: rbac.authorization.k8s.io/v1
    metadata:
      name: kubewatch
    rules:
    - apiGroups: [""]
      resources: ["pods"]
      verbs: ["get", "watch", "list"]
    ---
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: kubewatch
      namespace: test
    ---
    apiVersion: rbac.authorization.k8s.io/v1beta1
    kind: ClusterRoleBinding
    metadata:
      name: kubewatch
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: kubewatch
    subjects:
      - kind: ServiceAccount
        name: kubewatch
        namespace: test
    ---
    apiVersion: v1
    kind: Pod
    metadata:
      name: kubewatch
      namespace: test
    spec:
      serviceaccountName: kubewatch
      containers:
      - image: bitnami/kubewatch
        imagePullPolicy: Always
        name: kubewatch
        volumeMounts:
        - name: config-volume
          mountPath: /root
      restartPolicy: Always
      volumes:
      - name: config-volume
        configMap:
          name: kubewatch

 类似资料:

相关阅读

相关文章

相关问答