How To Setup NetApp Harvest Using Kubernetes (Using Pre-Built Container Image)

*2018-03-18: Updated for version 1.4.1 of my container image which includes bug fixes, Grafana 4.5.2 and NetApp Harvest 1.4

This post is based on the original “How To Setup NetApp Harvest Using Docker” blog post however it has been tweaked to reflect the use of Kubernetes and the NetApp Trident plugin. It is assumed both Kubernetes and NetApp Trident are already deployed so if you have questions on deploying these technologies see here.
    • Image download and distribution
      • Create the appropriate directories which will house the docker container build files
        # mkdir -pv /root/docker/harvest
    • Deploy NetApp Harvest in the Kubernetes Environment
      • Login to your kubernetes master node and create the harvest namespace
        # kubectl create namespace harvest
      • Define the persistent volume claims (PVCs) on your kubernetes master node
        # cd trident-installer
        # vi setup/pvc-dburkland_harvest_carbon.yaml
        kind: PersistentVolumeClaim
        apiVersion: v1
        metadata:
        name: var-lib-carbon
        namespace: harvest
        annotations:
        volume.beta.kubernetes.io/storage-class: default-dburkland
        trident.netapp.io/exportPolicy: "prod_kubernetes_nodes"
        trident.netapp.io/snapshotPolicy: "default-dburkland"
        spec:
        accessModes:
        - ReadWriteMany
        resources:
        requests:
        storage: 5Gi
        # vi setup/pvc-dburkland_harvest_conf.yaml
        kind: PersistentVolumeClaim
        apiVersion: v1
        metadata:
        name: opt-netapp-harvest-conf
        namespace: harvest
        annotations:
        volume.beta.kubernetes.io/storage-class: default-dburkland
        trident.netapp.io/exportPolicy: "prod_kubernetes_nodes"
        trident.netapp.io/snapshotPolicy: "default-dburkland"
        spec:
        accessModes:
        - ReadWriteMany
        resources:
        requests:
        storage: 5Gi
      • Create the PVCs
        # kubectl create -f pvc-dburkland_harvest_carbon.yaml
        # kubectl create -f pvc-dburkland_harvest_conf.yaml
      • Define the deployment which relies on the aforementioned persistent volume claims
        # vi setup/deployment-dburkland_harvest.yaml
        apiVersion: extensions/v1beta1
        kind: Deployment
        metadata:
          name: harvest
          namespace: harvest
        spec:
          replicas: 1
          template:
            metadata:
              labels:
                app: harvest
            spec:
              volumes:
                - name: volume-var-lib-carbon
                  persistentVolumeClaim:
                    claimName: var-lib-carbon
                - name: volume-opt-netapp-harvest-conf
                  persistentVolumeClaim:
                    claimName: opt-netapp-harvest-conf
                - name: volume-tmpfs-run
                  emptyDir:
                    medium: "Memory"
                - name: volume-tmpfs-run-lock
                  emptyDir:
                    medium: "Memory"
                - name: volume-tmpfs-tmp
                  emptyDir:
                    medium: "Memory"
              containers:
                - name: harvest
                  image: mn1s21000.dburkland.com:5000/dburkland/harvest:latest
                  ports:
                    - containerPort: 80
                    - containerPort: 8080
                  volumeMounts:
                    - mountPath: "/opt/netapp-harvest-conf"
                      name: volume-opt-netapp-harvest-conf
                    - mountPath: "/var/lib/carbon"
                      name: volume-var-lib-carbon
                    - mountPath: "/run"
                      name: volume-tmpfs-run
                    - mountPath: "/run/lock"
                      name: volume-tmpfs-run-lock
                    - mountPath: "/tmp"
                      name: volume-tmpfs-tmp
                  readinessProbe:
                    httpGet:
                      path: /
                      port: 80
                    initialDelaySeconds: 120
                    timeoutSeconds: 1
                    periodSeconds: 15
                  livenessProbe:
                    httpGet:
                      path: /
                      port: 80
                    initialDelaySeconds: 120
                    timeoutSeconds: 1
                    periodSeconds: 15
                  securityContext:
                    capabilities:
                      add:
                        - SYS_ADMIN
        ---
          kind: Service
          metadata:
            name: harvest
            namespace: harvest
            labels:
              app: harvest
          spec:
            type: NodePort
            ports:
              - name: grafana
                port: 80
                nodePort: 30080
              - name: graphite
                port: 8080
                nodePort: 30081
            selector:
              app: harvest
      • Create the deployment
        # kubectl create -f setup/deployment-dburkland_harvest.yaml
        # kubectl get deployment --all-namespaces --watch=true
        <CTRL+C>
        # kubectl get pod --all-namespaces --watch=true
    • NetApp Controller / OCUM Appliance Preparation Steps
      • Create the Harvest role on each NetApp system you wish to monitor
        • 7mode
          useradmin role add role-harvest -c "Role for performance monitoring by NetApp Harvest" -a login-http-admin,api-system-get-version,api-system-get-info,api-perf-object-*,api-ems- autosupport-log
          useradmin group add group-harvest -c "Group for performance monitoring by NetApp Harvest" -r role-harvest
        • cDOT
          security login role create -role role-harvest -access readonly -cmddirname "version"
          security login role create -role role-harvest -access readonly -cmddirname "cluster identity show"
          security login role create -role role-harvest -access readonly -cmddirname "cluster show"
          security login role create -role role-harvest -access readonly -cmddirname "system node show"
          security login role create -role role-harvest -access readonly -cmddirname "statistics"
          security login role create -role role-harvest -access readonly -cmddirname "lun show"
          security login role create -role role-harvest -access readonly -cmddirname "network interface show"
          security login role create -role role-harvest -access readonly -cmddirname "network interface show"
          security login role create -role role-harvest -access readonly -cmddirname "qos workload show"
      • Create the Harvest user on each NetApp system you wish to monitor
        • 7mode
          useradmin user add netapp-harvest -c "User account for performance monitoring by NetApp Harvest" -n "NetApp Harvest" -g group-harvest
        • cDOT 8.2 or earlier
          security login create -username harvest -application ontapi -role role-harvest -authmethod password
        • cDOT 8.3 or greater
          security login create -user-or-group-name harvest -application ontapi -role role-harvest -authmethod password
        • OCUM 6.x/7.x (Required for capacity data)
          • Login to the OCUM web interface as the “admin” user
          • Navigate to “Administration” -> “Manage Users”
          • Click “Add” to bring up the “Add User” window and create the “harvest” user as seen in the screenshot
            8B4D735D-9DBD-43FA-B7AA-EB4398318A66
        • For certificate authentication see the “NetApp Harvest Installation and Administration Guide” located here for more information
    • Final NetApp Harvest Container Configuration & Validation Steps
      • Login to the container and add all applicable NetApp 7mode or cDOT systems to the bottom of “/opt/netapp-harvest-conf/netapp-harvest.conf” and then restart the Harvest service to apply the changes
        # kubectl get pod --all-namespaces (Grab the harvest pod name)
        # kubectl exec -n harvest -ti harvest-1257702773-j1qzg -- /bin/bash
        # vi /opt/netapp-harvest-conf/netapp-harvest.conf
        [mn1d41000]
        host_type = FILER
        hostname = mn1d41000
        site = mn1
        [mn1s41007]
        host_type               = OCUM
        hostname                = mn1s41007.dburkland.com
        site = mn1
        data_update_freq        = 900
        # /etc/init.d/netapp-harvest restart
        # exit