apiVersion: apps/v1
kind: Deployment
metadata:
  name: watchdog-amd64
  namespace: kube-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: watchdog
  template:
    metadata:
      annotations:
        prometheus.io/path: /metrics
        prometheus.io/port: '9101'
        prometheus.io/scrape: 'true'
      labels:
        app: watchdog
        task: monitoring
      name: watchdog-amd64
    spec:
      nodeSelector:
        watchdog: active
        archType: amd64
      containers:
      - command:
        - python
        - /watchdog.py
        - --interval
        - '30'
        - --port
        - '9101'
        - --ca
        - /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        - --bearer
        - /var/run/secrets/kubernetes.io/serviceaccount/token
        - https://conip:443
        env:
        - name: LOGGING_LEVEL
          value: INFO
        volumeMounts:
        - mountPath: /usr/bin/kubectl
          name: kubectl-binary
          readOnly: true
        - mountPath: /root/.kube/config 
          name: kubeconfig
          readOnly: true    
        image: harbor.apulis.cn:8443/aiarts_v1.5.0_rc8/apulistech/watchdog:1.9

        imagePullPolicy: Always
        name: watchdog
        readinessProbe:
          httpGet:
            path: /healthz
            port: 9101
          initialDelaySeconds: 3
          periodSeconds: 30
          timeoutSeconds: 10
        resources:
          limits:
            memory: 256Mi
      hostNetwork: true
      imagePullSecrets:
      - name: pai-secret
      volumes:
      - name: kubectl-binary
        hostPath:
          path: /opt/kube/bin/kubectl
      - name: kubeconfig
        hostPath:
          path: /root/.kube/config
      tolerations:
      - key: node.kubernetes.io/memory-pressure
        operator: Exists
      - key: node.kubernetes.io/disk-pressure
        operator: Exists
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
