# borrowed from https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.9.3
apiVersion: apps/v1
kind: Deployment
metadata:
  name: weave-scope-cluster-agent
  labels:
    name: weave-scope-cluster-agent
    app: weave-scope
    weave-cloud-component: scope
    weave-scope-component: cluster-agent
  namespace: weave
spec:
  replicas: 1
  selector:
    matchLabels:
      name: weave-scope-cluster-agent
      app: weave-scope
      weave-cloud-component: scope
      weave-scope-component: cluster-agent
  revisionHistoryLimit: 2
  template:
    metadata:
      labels:
        name: weave-scope-cluster-agent
        app: weave-scope
        weave-cloud-component: scope
        weave-scope-component: cluster-agent
    spec:
      containers:
        - name: scope-cluster-agent
          args:
            - '--mode=probe'
            - '--probe-only'
            - '--probe.kubernetes.role=cluster'
            - 'weave-scope-app.weave.svc.cluster.local.:80'
          command:
            - /home/weave/scope
          image: 'docker.io/weaveworks/scope:1.13.1'
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              cpu: 100m
              memory: 100Mi
          volumeMounts:
            - name: scope-plugins
              mountPath: /var/run/scope/plugins
      serviceAccountName: weave-scope
      volumes:
        - name: scope-plugins
          hostPath:
            path: /var/run/scope/plugins
