Geneos ["Geneos"]
You are currently viewing an older version of the documentation. You can find the latest documentation here.
["Geneos > Netprobe"]["User Guide"]

Installation using manifests

Overview

This guide takes you through the manual deployment process of Netprobe and Collection Agent in Kubernetes and OpenShift environments using manifests. You can deploy the Netprobe and the Collection Agent to

Before the installation, perform the steps in the Manual deployment prerequisites and Prepare Docker images sections.

Manual deployment prerequisites

This section provides the prerequisites for installing using manifests, you must also ensure your system meets the general prerequisites for installation in a orchestrated environment. For more info, see Prerequisites.

Download the Netprobe for Kubernetes package

All required binaries are packaged as geneos-netprobe-<version>.kubernetes.tar.gz, and can be downloaded from the ITRS Downloads site.

  1. Create a working directory:
    mkdir geneos
    cd geneos
    
  2. Download the package into the working directory.
  3. Verify the checksum and extract the files:
    sha256sum geneos-netprobe-<version>.kubernetes.tar.gz
    tar xf geneos-netprobe-<version>.kubernetes.tar.gz

Note: Beginning Geneos 5.2, sample Docker files are included in the Netprobe Kubernetes package.

Load an include file

Example include files are provided for Gateway configuration. To load an include file into the Gateway Setup Editor:

  1. Open the Gateway Setup Editor.
  2. In the Navigation panel, click Includes to create a new file.
  3. Enter the location of the file to include in the Location field.
  4. Update the Priority field. This can be any value except 1. If you input a priority of 1, the Gateway Setup Editor returns an error.
  5. Expand the file location in the Include section.
  6. Select Click to load.
  7. Click Yes to load the new include file and save your setup.

The example includes file for the KubernetesCollection Agent plugin is provided in the downloaded binaries at /include/kubernetes.xml.

Prepare Docker images

Create container images

You need to create container images to deploy the Netprobe and Collection Agent binaries in an orchestrated environment. You must ensure the container environments meet all the prerequisite software requirements.

Netprobe Docker image

The image must contain:
  • Netprobe binary.

The image must be based on one of the following:

  • CentOS.
  • Red Hat.
  • Fedora.
  • SUSE.

To create the Netprobe Docker image:

  1. Open the netprobe directory which was created when the files were extracted:
    cd netprobe
    
  2. In the working directory, create a Dockerfile with the following contents. You can use and update the sample Dockerfile that comes with the Netprobe Kubernetes package:
    FROM centos:7
    
    ADD ./geneos-netprobe-<version>.linux-x64.tar.gz /
    
    # If other plugins will be enabled that require JVM, uncomment the following:
    #
    # RUN mkdir -p /opt/java && \
    #     cd /opt/java && \
    #     PKG=https://github.com/AdoptOpenJDK/openjdk8-upstream-binaries/releases/download/jdk8u212-b04/OpenJDK8U-jre_x64_linux_8u212b04.tar.gz && \
    #     curl -L ${PKG} > jre.tar.gz && \
    #     tar xf jre.tar.gz && \
    #     rm jre.tar.gz && \
    #     ln -s openjdk-*-jre jre
    # ENV JAVA_HOME /opt/java/jre
    # ENV PATH ${JAVA_HOME}/bin:${PATH}
    # RUN java -version
    
    CMD [ "/netprobe/netprobe.linux_64" ]
    
  3. Build and tag the image:
    docker build -t netprobe:v5.1.x .

Collection Agent Docker image

The image must contain:

  • Collection Agent JAR file.
  • The desired plugin JAR files.
  • Java Runtime Environment.

Note: Any Linux based image will work as long as Java is supported.

To create the Collection Agent Docker image:

  1. In the working directory, change to the collection-agent directory which was created when the files were extracted:
    cd collection-agent
    
  2. In the working directory, create a Dockerfile with the following contents. You can use and update the sample Dockerfile that comes with the Netprobe Kubernetes package:
    FROM openjdk:8-jre-alpine
    
    WORKDIR /app
    
    RUN cd /app && mkdir -p plugins
    
    COPY collection-agent-<version>-exec.jar collection-agent.jar
    COPY statsd-plugin-<version>.jar ./plugins
    COPY kubernetes-plugin-<version>.jar ./plugins
    
  3. Build and tag the image:
    docker build -t collection-agent:1.0.0 .
    

Push Docker images to a Docker registry

You must ensure that the container images you have created are available to your orchestration tools. To do this, add them to a Docker registry.

For OpenShift

To push the Docker images in an OpenShift environment:

  1. Log in and create the geneos project.
    oc login
    oc create project geneos
    
  2. Push the images to the project's Docker repository, replacing the variables as needed for your environment:
    #!/bin/bash
    REGISTRY=docker-registry-default.apps.1.2.3.4.your-domain.com
    PROJECT=geneos
    NETPROBE=netprobe:5.1.0
    AGENT=collection-agent:2.0.0
    
    docker login -u openshift -p $(oc whoami -t) $REGISTRY &&
    docker tag $NETPROBE $REGISTRY/$PROJECT/$NETPROBE &&
    docker tag $AGENT $REGISTRY/$PROJECT/$AGENT &&
    docker push $REGISTRY/$PROJECT/$NETPROBE &&
    docker push $REGISTRY/$PROJECT/$AGENT
    

For Kubernetes

To push the Docker images in a Kubernetes environment:

  1. Push the images to the Docker registry used by Kubernetes, replacing the variables as needed for your environment:
    #!/bin/bash
    REGISTRY=docker-registry.yourdomain.com
    NETPROBE=netprobe:5.1.0
    AGENT=collection-agent:2.0.0
    
    docker tag $NETPROBE $REGISTRY/$NETPROBE &&
    docker tag $AGENT $REGISTRY/$AGENT &&
    docker push $REGISTRY/$NETPROBE &&
    docker push $REGISTRY/$AGENT
    

Monitor a single namespace

This section provides you with the procedures and the configuration files that you need in order to deploy in a Kubernetes or OpenShift environment and monitor a single namespace.

Create a namespace

To create the geneos namespace , use the following command: 

kubectl create namespace geneos

Create the service account, roles, and role bindings

  1. Create a manifest for the service account and roles.

    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: netprobe
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      name: netprobe
    rules:
    - apiGroups:
      - ""
      resources:
      - nodes
      - nodes/proxy
      verbs:
      - get
      - list
      - watch
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRoleBinding
    metadata:
      name: netprobe
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: netprobe
    subjects:
    - kind: ServiceAccount
      name: netprobe
      # Must match the namespace into which the netprobe is installed.
      namespace: geneos
    ---
    # Repeat for each namespace monitored by this netprobe.
    apiVersion: rbac.authorization.k8s.io/v1
    kind: Role
    metadata:
      name: netprobe
      # The target namespace.
      namespace: geneos
    rules:
    - apiGroups:
      - ""
      resources:
      - pods
      - resourcequotas
      - events
      verbs:
      - get
      - list
      - watch
    - apiGroups:
      - apps
      resources:
      - replicasets
      verbs:
      - get
    - apiGroups:
      - batch
      resources:
      - jobs
      verbs:
      - get
    ---
    # Repeat for each namespace monitored by this netprobe.
    apiVersion: rbac.authorization.k8s.io/v1
    kind: RoleBinding
    metadata:
      name: netprobe
      # The target namespace.
      namespace: geneos
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: Role
      name: netprobe
    subjects:
    - kind: ServiceAccount
      name: netprobe
      # Must match the namespace into which the netprobe is installed.
      namespace: geneos
  2. Apply the manifest for the service account and roles:

    kubectl apply -n geneos -f rbac.yaml

Create the ConfigMap

  1. Create the ConfigMap manifest:

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: netprobe
    data:
      config.xml: |-
        <netprobe compatibility="1"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:noNamespaceSchemaLocation="http://schema.itrsgroup.com/GA2011.2-110303/netprobe.xsd">
          <selfAnnounce>
            <enabled>true</enabled>
            <retryInterval>30</retryInterval>
            <requireReverseConnection>true</requireReverseConnection>
            <probeName><hostname/></probeName>
            <managedEntity>
              <name><data>Health_</data><hostname/></name>
              <attributes>
                <!-- Change for your environment -->
                <attribute name="Cluster">my-cluster</attribute>
                <attribute name="Application">geneos</attribute>
                <attribute name="Environment">Kubernetes</attribute>
                <attribute name="Type">Static</attribute>
              </attributes>
              <types>
                <type>Health</type>
              </types>
            </managedEntity>
            <collectionAgent>
              <run>false</run>
              <reporterPort>7137</reporterPort>
            </collectionAgent>
            <dynamicEntities>
              <mappingType>Kubernetes</mappingType>
            </dynamicEntities>
            <gateways>
              <gateway>
                <!-- Change for your environment -->
                <hostname>my-gateway</hostname>
                <port>7039</port>
                <secure>false</secure>
              </gateway>
            </gateways>
          </selfAnnounce>
        </netprobe>
      config.yaml: |-
        plugin-directory: ./plugins
        reporters:
        - name: tcp
          type: tcp
          port: 7137
        collectors:
        - name: statsd
          type: plugin
          class-name: StatsdServer
          stale-metrics-threshold: 1800000
          transport-protocol: UDP
          listen-port: 8125
        - name: kube-metrics
          type: plugin
          class-name: KubernetesMetricsCollector
          # Change for your specific namespace(s) here:
          namespaces:
          - "geneos"
          exclude-non-namespaced: false
        workflow:
          metrics:
            store:
              type: memory
              capacity: 8192
          events:
            store:
              type: memory
          common:
            processors:
            - type: plugin
              class-name: KubernetesEnricher
            - type: enrichment
              dimensions:
                cluster_name: ${env:CLUSTER_NAME}
      logback.xml: |-
        <configuration>
          <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
            <encoder>
              <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
            </encoder>
          </appender>
          <logger name="io.kubernetes.client" level="off" />
          <root level="info">
            <appender-ref ref="stdout" />
          </root>
        </configuration>
  2. Apply the manifest for the ConfigMap:

  3. kubectl apply -n geneos -f configmap.yaml

Create the Deployment

  1. Create the Deployment manifest:

  2. apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: netprobe
    spec:
      selector:
        matchLabels:
          app: netprobe
      strategy:
        type: Recreate
      template:
        metadata:
          labels:
            app: netprobe
        spec:
          # Secret required if using the ITRS Docker registry.
          #imagePullSecrets:
          #- name: itrsdocker
          serviceAccount: netprobe
          terminationGracePeriodSeconds: 30
          containers:
          - name: netprobe
            image: docker.itrsgroup.com/netprobe:<latest-version>
            command:
            - /opt/netprobe/netprobe.linux_64
            - -setup
            - /etc/netprobe/config.xml
            env:
            - name: DISABLE_MEM_PROTECTION
              value: "true"
            resources:
              limits:
                cpu: "1"
                memory: 1Gi
              requests:
                cpu: 500m
                memory: 768Mi
            securityContext:
              runAsUser: 1000
            volumeMounts:
            - mountPath: /etc/netprobe
              name: config
              readOnly: true
          - name: collection-agent
            image: docker.itrsgroup.com/collection/collection-agent-kubernetes:2.2.2-jre8-r1
            command:
            - java
            - -XX:+UseContainerSupport
            - -XX:InitialRAMPercentage=75.0
            - -XX:MaxRAMPercentage=75.0
            - -Dlogback.configurationFile=/app/config/logback.xml
            - -jar
            - /app/collection-agent.jar
            - /app/config/config.yaml
            env:
            - name: CLUSTER_NAME
              # Change for your environment.
              value: my-cluster
            - name: NODE_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: spec.nodeName
            - name: NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
            - name: CONTAINER_NAME
              value: collection-agent
            - name: STATSD_SERVER
              value: localhost
            - name: STATSD_PROTOCOL
              value: UDP
            - name: STATSD_PORT
              value: "8125"
            ports:
            - containerPort: 8125
              hostPort: 8125
              protocol: UDP
            readinessProbe:
              httpGet:
                path: /healthcheck
                port: 8080
                scheme: HTTP
              periodSeconds: 10
              failureThreshold: 6
            livenessProbe:
              httpGet:
                path: /healthcheck
                port: 8080
                scheme: HTTP
              initialDelaySeconds: 60
              periodSeconds: 10
              failureThreshold: 3
            resources:
              limits:
                cpu: "1"
                memory: 1Gi
              requests:
                cpu: 500m
                memory: 768Mi
            volumeMounts:
            - mountPath: /app/config
              name: config
              readOnly: true
          volumes:
          - name: config
            configMap:
              name: netprobe
  3. Apply the manifest for the Deployment:

  4. kubectl apply -n geneos -f deployment.yaml

Create the Service

  1. Create the Service manifest:

  2. # Optional statsd service.
    apiVersion: v1
    kind: Service
    metadata:
      name: netprobe-statsd
    spec:
      type: ClusterIP
      ports:
      - port: 8125
        protocol: UDP
        targetPort: 8125
      selector:
        app: netprobe
  3. Apply the manifest for Service, if applicable.

  4. kubectl apply -n geneos -f service.yaml

Outcome

When all the steps have been completed, a Deployment pod should be running with two containers each. They should immediately begin to read container logs, collect cluster-level metrics, and receive StatsD metrics from applications.

For more details on the Collection Agent configuration, see configuration reference.

Monitor multiple namespaces

This section provides you with the procedures and the configuration files that you need in order to deploy in a Kubernetes or OpenShift environment and monitor multiple namespaces.

Create a namespace

To create the geneos namespace , use the following command: 

kubectl create namespace geneos

Create the service account, roles, and role bindings

For OpenShift

  1. Create a manifest for the service account and roles. Please see the sample manifest below.
  2. When using StatsD or collecting log files, the service account must be privileged in order to use HostPorts and write to HostPaths. This is optional.
    oc adm policy add-scc-to-user privileged -n geneos -z netprobe-service-account
    

For Kubernetes

  1. Create a manifest for the service account and roles. Please see the sample manifest below.
  2. Apply the manifest:
    kubectl apply -n geneos -f service-account.yml
    

For OpenShift and Kubernetes, you can use this manifest for the service account and roles. Then follow the steps below to configure each environment.

apiVersion: v1
kind: ServiceAccount
metadata:
  name: netprobe
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: netprobe
rules:
- apiGroups:
  - ""
  resources:
  - nodes
  - nodes/proxy
  - events
  - pods
  - resourcequotas
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - apps
  resources:
  - replicasets
  verbs:
  - get
- apiGroups:
  - batch
  resources:
  - jobs
  verbs:
  - get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: netprobe
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: netprobe
subjects:
- kind: ServiceAccount
  name: netprobe
  # Must match the namespace into which the netprobe is installed.
  namespace: geneos

Create the ConfigMaps

The Collection Agent is configured using a YAML file. It is recommended that you store this in a Kubernetes ConfigMap.

The configurations shown here are a recommended starting point for typical installations that use StatsD and collect Kubernetes metrics, logs and events.

The ConfigMap manifest below specifies configurations for the Collection Agent and the Netprobe.

Collection Agent configuration

The following options should be configured when deploying the Collection Agent using a ConfigMap.

Persistence

By default, the Collection Agent buffers logs and events to disk. Therefore, it is necessary to create a persistent volume so that this data is not lost after a restart. Since the Collection Agent is running as a DaemonSet, it is recommended to use a read/write HostPath.

Read permissions for Docker logs

The log collector requires read-only volume mounts to the Docker log directories. The manifest below has volumes defined for the default Docker log directories.

Host ports

A HostPort must be defined for the StatsD server, which requires UDP or TCP port 8125 open to connections from clients that will be sending metrics.

Netprobe configuration

The following options are configured the example Netprobe configuration:

  • Netprobe type — this example uses a Self-Announcing Netprobe, which requires you to specify a Gateway hostname and port in the configuration file.
  • Dynamic Managed Entities — this example uses the Kubernetes dynamic mapping type to create managed entities from incoming data.
  • Dynamic Managed Entities health plugin — this example includes a managed entity that runs the Dynamic Managed Entities health plugin. This allows you to monitor if data from the Collection Agent is being processed correctly.

ConfigMap for Netprobe

Follow the steps below:

  1. Create the ConfigMap manifest:
  2. apiVersion: v1
    kind: ConfigMap
    metadata:
      name: netprobe
    data:
      config.xml: |-
        <netprobe compatibility="1"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:noNamespaceSchemaLocation="http://schema.itrsgroup.com/GA2011.2-110303/netprobe.xsd">
          <selfAnnounce>
            <enabled>true</enabled>
            <retryInterval>30</retryInterval>
            <requireReverseConnection>true</requireReverseConnection>
            <probeName><hostname/></probeName>
            <managedEntity>
              <name><data>Health_</data><hostname/></name>
              <attributes>
                <!-- Change for your environment -->
                <attribute name="Cluster">my-cluster</attribute>
                <attribute name="Application">geneos</attribute>
                <attribute name="Environment">Kubernetes</attribute>
                <attribute name="Type">Static</attribute>
              </attributes>
              <types>
                <type>Health</type>
              </types>
            </managedEntity>
            <collectionAgent>
              <run>false</run>
              <reporterPort>7137</reporterPort>
            </collectionAgent>
            <dynamicEntities>
              <mappingType>Kubernetes</mappingType>
            </dynamicEntities>
            <gateways>
              <gateway>
                <!-- Change for your environment -->
                <hostname>my-gateway</hostname>
                <port>7039</port>
                <secure>false</secure>
              </gateway>
            </gateways>
          </selfAnnounce>
        </netprobe>
      config.yaml: |-
        plugin-directory: ./plugins
        reporters:
        - name: tcp
          type: tcp
          port: 7137
        collectors:
        - name: statsd
          type: plugin
          class-name: StatsdServer
          stale-metrics-threshold: 1800000
          transport-protocol: UDP
          listen-port: 8125
        - name: kube-metrics
          type: plugin
          class-name: KubernetesMetricsCollector
          exclude-non-namespaced: false
          # By default all namespaces will be collected.  Specific namespaces may be defined here.
          #namespaces:
          #- namespace1
          #- namespace2
          processors:
          # Only forward metrics for pods on this node.  Metrics that aren't specific to
          # a node are handled by the kube-metrics deployment.
          - type: forward-filter
            matchers:
            - type: dimension
              key: node_name
              value: ${env:NODE_NAME}
        - name: kube-logs
          type: plugin
          class-name: KubernetesLogCollector
          log-directory: /var/log/containers
          persistence-directory: /var/lib/geneos/collection-agent/log-collector
          # By default all logs will be processed.  Add wildcards here to process only what's required.
          #includes:
          #- "*_namespace1_*"
          #- "*_namespace2_*"
        workflow:
          store-directory: /var/lib/geneos/collection-agent
          metrics:
            store:
              type: memory
              capacity: 8192
          events:
            store:
              type: disk
          logs:
            store:
              type: disk
          common:
            processors:
            - type: plugin
              class-name: KubernetesEnricher
            - type: enrichment
              dimensions:
                node_name: ${env:NODE_NAME}
                cluster_name: ${env:CLUSTER_NAME}
      logback.xml: |-
        <configuration>
          <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
            <encoder>
              <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
            </encoder>
          </appender>
          <logger name="io.kubernetes.client" level="off" />
          <root level="info">
            <appender-ref ref="stdout" />
          </root>
        </configuration>
    
  3. Apply the manifest:
    (oc|kubectl) apply -n geneos -f netprobe-config.yml

ConfigMap for the Kubernetes metrics collector

You should use this configuration for the standalone Netprobe for Orchestrated Environments instance that collects Kubernetes cluster metrics only. These metrics cannot be collected from the DaemonSet instance as it would result in duplicate metrics reported from every node. A Self-Announcing Netprobe is used so that the instance can run on any node in the cluster.

  1. Create the ConfigMap manifest:
  2. apiVersion: v1
    kind: ConfigMap
    metadata:
      name: netprobe-metrics
    data:
      config.xml: |-
        <netprobe compatibility="1"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:noNamespaceSchemaLocation="http://schema.itrsgroup.com/GA2011.2-110303/netprobe.xsd">
          <selfAnnounce>
            <enabled>true</enabled>
            <retryInterval>30</retryInterval>
            <requireReverseConnection>true</requireReverseConnection>
            <probeName><hostname/></probeName>
            <managedEntity>
              <name><data>Health_</data><hostname/></name>
              <attributes>
                <!-- Change for your environment -->
                <attribute name="Cluster">my-cluster</attribute>
                <attribute name="Application">geneos</attribute>
                <attribute name="Environment">Kubernetes</attribute>
                <attribute name="Type">Static</attribute>
              </attributes>
              <types>
                <type>Health</type>
              </types>
            </managedEntity>
            <collectionAgent>
              <run>false</run>
              <reporterPort>7137</reporterPort>
            </collectionAgent>
            <dynamicEntities>
              <mappingType>Kubernetes</mappingType>
            </dynamicEntities>
            <gateways>
              <gateway>
                <!-- Change for your environment -->
                <hostname>my-gateway</hostname>
                <port>7039</port>
                <secure>false</secure>
              </gateway>
            </gateways>
          </selfAnnounce>
        </netprobe>
      config.yaml: |-
        plugin-directory: ./plugins
        monitoring:
          metrics:
            delivery-mode: statsd
        reporters:
        - name: tcp
          type: tcp
          port: 7137
        collectors:
        - name: kube-metrics
          type: plugin
          class-name: KubernetesMetricsCollector
          exclude-non-namespaced: false
          # By default all namespaces will be collected.  Specific namespaces may be defined here.
          #namespaces:
          #- "my-namespace"
          processors:
          # Only forward metrics that aren't specific to any node.  Node-specific metrics
          # are processed by the DaemonSet netprobe.
          - type: drop-filter
            matchers:
            - type: dimension
              key: node_name
              value-pattern: .+
        workflow:
          metrics:
            store:
              type: memory
              capacity: 8192
          events:
            store:
              type: memory
          common:
            processors:
            - type: plugin
              class-name: KubernetesEnricher
            - type: enrichment
              dimensions:
                cluster_name: ${env:CLUSTER_NAME}
      logback.xml: |-
        <configuration>
          <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
            <encoder>
              <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n</pattern>
            </encoder>
          </appender>
          <logger name="io.kubernetes.client" level="off" />
          <root level="info">
            <appender-ref ref="stdout" />
          </root>
        </configuration>
    
  3. Apply the manifest:
    (oc|kubectl) apply -n geneos -f kube-metrics-config.yml

Create the Deployments

Deployment for Netprobe

For OpenShift and Kubernetes, you can use this DaemonSet manifest. Then, follow the steps below to configure each environment.

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: netprobe
spec:
  selector:
    matchLabels:
      app: netprobe
  template:
    metadata:
      labels:
        app: netprobe
    spec:
      # Secret required if using the ITRS Docker registry.
      #imagePullSecrets:
      #- name: itrsdocker
      serviceAccount: netprobe
      terminationGracePeriodSeconds: 30
      containers:
      - name: netprobe
        image: docker.itrsgroup.com/netprobe:<latest-version>
        command: 
        - /opt/netprobe/netprobe.linux_64
        - -setup
        - /etc/netprobe/config.xml
        env:
        - name: DISABLE_MEM_PROTECTION
          value: "true"
        resources:
          limits:
            cpu: "1"
            memory: 1Gi
          requests:
            cpu: 500m
            memory: 768Mi
        securityContext:
          runAsUser: 1000
        volumeMounts:
        - mountPath: /etc/netprobe
          name: config
          readOnly: true
        readinessProbe:
          tcpSocket:
            port: 7036
          initialDelaySeconds: 5
          periodSeconds: 5
        livenessProbe:
          tcpSocket:
            port: 7036
          initialDelaySeconds: 10
          periodSeconds: 10
      - name: collection-agent
        image: docker.itrsgroup.com/collection/collection-agent-kubernetes:2.2.2-jre8-r1
        command:
        - java
        - -XX:+UseContainerSupport
        - -XX:InitialRAMPercentage=75.0
        - -XX:MaxRAMPercentage=75.0
        - -Dlogback.configurationFile=/app/config/logback.xml
        - -jar
        - /app/collection-agent.jar
        - /app/config/config.yaml
        # If using OpenShift, uncomment the following in order to use HostPort and write to HostPath.
        #securityContext:
        #  privileged: true
        env:
        - name: CLUSTER_NAME
          # Change for your environment.
          value: my-cluster
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
        - name: NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        - name: CONTAINER_NAME
          value: collection-agent
        ports:
        - containerPort: 8125
          hostPort: 8125
          protocol: UDP
        readinessProbe:
          httpGet:
            path: /healthcheck
            port: 8080
            scheme: HTTP
          periodSeconds: 10
          failureThreshold: 6
        livenessProbe:
          httpGet:
            path: /healthcheck
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 60
          periodSeconds: 10
          failureThreshold: 3
        resources:
          limits:
            cpu: "1"
            memory: 1Gi
          requests:
            cpu: 500m
            memory: 768Mi
        volumeMounts:
        - mountPath: /app/config
          name: config
          readOnly: true
        - mountPath: /var/lib/geneos/collection-agent
          name: persistence
        - mountPath: /var/log/containers
          name: container-logs
          readOnly: true
        - mountPath: /var/log/pods
          name: pod-logs
          readOnly: true
        - mountPath: /var/lib/docker/containers
          name: docker-logs
          readOnly: true
      volumes:
      - name: config
        configMap:
          name: netprobe
      - name: persistence
        hostPath:
          # If multiple netprobe DaemonSets are installed on the same cluster, this directory name
          # must be unique for each installation.
          path: /var/lib/geneos/collection-agent
          type: DirectoryOrCreate
      # The next 3 volumes are the default locations for Kubernetes Docker logs but may be different in your cluster.
      - name: container-logs
        hostPath:
          path: /var/log/containers
      - name: pod-logs
        hostPath:
          path: /var/log/pods
      - name: docker-logs
        hostPath:
          path: /var/lib/docker/containers
For OpenShift
  1. Create the DaemonSet manifest.
  2. Apply the manifest.
    oc apply -n geneos -f netprobe-daemonset.yml
    
For Kubernetes
  1. Create the DaemonSet manifest.
  2. Apply the manifest:
    kubectl apply -n geneos -f netprobe-daemonset.yml

Deployment for Kubernetes metrics collector

  1. Create the Deployment manifest:
  2. apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: netprobe-metrics
    spec:
      selector:
        matchLabels:
          app: netprobe-metrics
      strategy:
        type: Recreate
      template:
        metadata:
          labels:
            app: netprobe-metrics
        spec:
          # Secret required if using the ITRS Docker registry.
          #imagePullSecrets:
          #- name: itrsdocker
          serviceAccount: netprobe
          terminationGracePeriodSeconds: 30
          containers:
          - name: netprobe
            image: docker.itrsgroup.com/netprobe:<latest-version>
            command:
            - /opt/netprobe/netprobe.linux_64
            - -setup
            - /etc/netprobe/config.xml
            env:
            - name: DISABLE_MEM_PROTECTION
              value: "true"
            resources:
              limits:
                cpu: "1"
                memory: 1Gi
              requests:
                cpu: 500m
                memory: 768Mi
            securityContext:
              runAsUser: 1000
            volumeMounts:
            - mountPath: /etc/netprobe
              name: config
              readOnly: true
            readinessProbe:
              tcpSocket:
                port: 7036
              initialDelaySeconds: 5
              periodSeconds: 5
            livenessProbe:
              tcpSocket:
                port: 7036
              initialDelaySeconds: 10
              periodSeconds: 10
          - name: collection-agent
            image: docker.itrsgroup.com/collection/collection-agent-kubernetes:2.2.2-jre8-r1
            command:
            - java
            - -XX:+UseContainerSupport
            - -XX:InitialRAMPercentage=75.0
            - -XX:MaxRAMPercentage=75.0
            - -Dlogback.configurationFile=/app/config/logback.xml
            - -jar
            - /app/collection-agent.jar
            - /app/config/config.yaml
            env:
            - name: CLUSTER_NAME
              # Change for your environment.
              value: my-cluster
            - name: NODE_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: spec.nodeName
            - name: NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
            - name: CONTAINER_NAME
              value: collection-agent
            - name: STATSD_SERVER
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: spec.nodeName
            - name: STATSD_PROTOCOL
              value: UDP
            - name: STATSD_PORT
              value: "8125"
            resources:
              limits:
                cpu: "1"
                memory: 1Gi
              requests:
                cpu: 500m
                memory: 768Mi
            volumeMounts:
            - mountPath: /app/config
              name: config
              readOnly: true
            readinessProbe:
              httpGet:
                path: /healthcheck
                port: 8080
                scheme: HTTP
              periodSeconds: 10
              failureThreshold: 6
            livenessProbe:
              httpGet:
                path: /healthcheck
                port: 8080
                scheme: HTTP
              initialDelaySeconds: 60
              periodSeconds: 10
              failureThreshold: 3 
          volumes:
          - name: config
            configMap:
              name: netprobe-metrics
    
  3. Apply the manifest:
    (oc|kubectl) apply -n geneos -f kube-metrics-deployment.yml

Outcome

When all the steps have been completed, the DaemonSet pods should be running with two containers each. They should immediately begin to read container logs, collect cluster-level metrics, and receive StatsD metrics from applications.

For more details on the Collection Agent configuration, see configuration reference.