Installation in a Kubernetes or OpenShift environment

Overview

This guide takes you through the Netprobe for Orchestrated Environments installation process in Kubernetes and OpenShift environments.

If you are upgrading a deployment that uses Collection Agent version 1.0.0 you will need to take additional steps. For more information, see Troubleshooting in an orchestrated environment.

Before the installation, make sure all the requirements are met. For more information, see Prerequisites.

Note: We recommend to run both the Netprobe and the Collection Agent in the same pod. This allows communication between the two processes to occur over localhost, eliminating the need to externally expose the TcpReporter port. 

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 Dockerfiles are included in the Netprobe Kubernetes package.

Load an include file

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 plug-in is provided in the downloaded binaries at /include/kubernetes.xml.

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 plug-in 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-2.0.0-exec.jar collection-agent.jar
    COPY statsd-plugin-2.0.0.jar ./plugins
    COPY kubernetes-plugin-2.0.0.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
    

Create the service account, roles, and role bindings

You must configure the Netprobe for Orchestrated Environments to run as a service in your orchestrated environment.

For OpenShift

Follow the steps:

  1. Create a manifest for the service account and roles:
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: netprobe-service-account
      namespace: geneos
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      name: read-only-api
    rules:
      - apiGroups:
          - ""
        resources: ["*"]
        verbs:
          - get
          - list
          - watch
    ---
    kind: ClusterRoleBinding
    apiVersion: rbac.authorization.k8s.io/v1beta1
    metadata:
      name: read-only-api
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: read-only-api
    subjects:
      - kind: ServiceAccount
        name: netprobe-service-account
        namespace: geneos
    
  2. Apply the manifest:
    oc apply -n geneos -f service-account.yml
    
  3. 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

Follow the steps:

  1. Create the geneos namespace:
    kubectl create namespace geneos
  2. Create a manifest for the service account and roles:
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: netprobe-service-account
      namespace: geneos
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
      name: read-only-api
    rules:
      - apiGroups:
          - ""
        resources: ["*"]
        verbs:
          - get
          - list
          - watch
    ---
    kind: ClusterRoleBinding
    apiVersion: rbac.authorization.k8s.io/v1beta1
    metadata:
      name: read-only-api
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: read-only-api
    subjects:
      - kind: ServiceAccount
        name: netprobe-service-account
        namespace: geneos
    
  3. Apply the manifest:
    kubectl apply -n geneos -f service-account.yml
    

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 plug-in — this example includes a managed entity that runs the Dynamic Managed Entities health plug-in. This allows you to monitor if data from the Collection Agent is being processed correctly.

ConfigMap for the DaemonSet

Follow the steps below:

  1. Create the ConfigMap manifest:
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: netprobe-config
      namespace: geneos
    data:
      agent-config: |-
        ---
        plugin-directory: ./plugins
    
        reporters:
          - type: tcp
            name: tcp
    
        collectors:
          - name: statsd
            type: plugin
            class-name: StatsdServer
    
          - name: kube-metrics
            type: plugin
            class-name: KubernetesMetricsCollector
            processors:
              # Only forward metrics for pods on this node.  Metrics that aren't specific to
              # a node are handled by the floating 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:
          events:
          logs:
          common:
            processors:
              - type: plugin
                class-name: KubernetesEnricher
    
      logback-config: |-
        <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="com.itrsgroup.collection" level="info" />
          <logger name="net.openhft" level="error" />
          <logger name="io.kubernetes.client" level="off" />
    
          <root level="info">
            <appender-ref ref="stdout" />
          </root>
        </configuration>
    
      netprobe-config: |-
        <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>
                <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>192.168.1.1</hostname>
                 <port>10000</port>
              </gateway>
            </gateways>
          </selfAnnounce>
        </netprobe>
    
  2. Apply the manifest:
    (oc|kubectl) apply -n geneos -f netprobe-config.yml

ConfigMap for the Kubernetes metrics collector

This configuration is 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:
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: kube-metrics-config
      namespace: geneos
    data:
      agent-config: |-
        ---
        plugin-directory: ./plugins
    
        reporters:
          - name: tcp
            type: tcp
    
        collectors:
          - name: kube-metrics
            type: plugin
            class-name: KubernetesMetricsCollector
            metrics:
              enabled: false
            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
          events:
            store:
              type: memory
          common:
            processors:
              - type: plugin
                class-name: KubernetesEnricher
    
      logback-config: |-
        <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="com.itrsgroup.collection" level="info" />
          <logger name="net.openhft" level="error" />
          <logger name="io.kubernetes.client" level="off" />
    
          <root level="info">
            <appender-ref ref="stdout" />
          </root>
        </configuration>
    
      netprobe-config: |-
        <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>
                <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>192.168.1.1</hostname>
                <port>10000</port>
              </gateway>
            </gateways>
          </selfAnnounce>
        </netprobe>
  2. Apply the manifest:
    (oc|kubectl) apply -n geneos -f kube-metrics-config.yml

Create the DaemonSet

For OpenShift

Follow the steps below:

  1. Create the DaemonSet manifest:
    apiVersion: apps/v1
    kind: DaemonSet
    metadata:
      name: netprobe
      namespace: geneos
    spec:
      selector:
        matchLabels:
          name: netprobe
      updateStrategy:
        type: RollingUpdate
      template:
        metadata:
          labels:
            name: netprobe
        spec:
          serviceAccount: netprobe-service-account
          terminationGracePeriodSeconds: 30
          containers:
            - name: netprobe
    
              # Change image URL as needed
              image: docker-registry.default.svc:5000/geneos/netprobe:5.1.0
              imagePullPolicy: Always
    
              volumeMounts:
                - name: config-volume
                  mountPath: /etc/netprobe
                  readOnly: true
    
              command: [ "/netprobe/netprobe.linux_64", "-setup", "/etc/netprobe/config.xml" ]
    
              # Run as non-privileged user.
              securityContext:
                runAsUser: 1000
    
              env:
                - name: DISABLE_MEM_PROTECTION
                  value: "true"
    
              # Probes for confirming the container is operational.
              # We recommend enabling the probes once you have verified your installation is successful.
              #
              #readinessProbe:
              #  tcpSocket:
              #    port: 7036
              #  initialDelaySeconds: 5
              #  periodSeconds: 5
              #livenessProbe:
              #  tcpSocket:
              #    port: 7036
              #  initialDelaySeconds: 10
              #  periodSeconds: 10
    
            - name: collection-agent
    
              # Change image URL as needed
              image: docker-registry.default.svc:5000/geneos/collection-agent:2.0.0
              imagePullPolicy: Always
    
              command: [
                "java",
                "-Xms512M",
                "-Xmx512M",
                "-Dlogback.configurationFile=/app/config/logback.xml",
                "-jar",
                "/app/collection-agent.jar",
                "/app/config/config.yml"
              ]
    
              volumeMounts:
                - name: config-volume
                  mountPath: /app/config
                  readOnly: true
                - name: container-logs
                  mountPath: /var/log/containers
                  readOnly: true
                - name: pod-logs
                  mountPath: /var/log/pods
                  readOnly: true
                - name: docker-logs
                  mountPath: /var/lib/docker/containers
                  readOnly: true
                - name: persistence
                  mountPath: /var/lib/geneos/collection-agent
                  readOnly: false
    
              ports:
                # Required when using statsd.
                - containerPort: 8125
                  hostPort: 8125
                  protocol: UDP
    
              # Probes for confirming the container is operational.
              # We recommend enabling the probes once you have verified your installation is successful.
              #
              #readinessProbe:
              #  httpGet:
              #    port: 8080
              #    path: /healthcheck
              #  initialDelaySeconds: 5
              #  periodSeconds: 5
              #livenessProbe:
              #  httpGet:
              #    port: 8080
              #    path: /healthcheck
              #  initialDelaySeconds: 10
              #  periodSeconds: 10
    
              env:
                - name: NODE_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: spec.nodeName
                - name: NAMESPACE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                - name: POD_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.name
                - name: CONTAINER_NAME
                  value: "collection-agent"
    
              # Required in order to use HostPort and write to HostPath.
              securityContext:
                privileged: true
    
          volumes:
            - name: config-volume
              configMap:
                name: netprobe-config
                items:
                  - key: netprobe-config
                    path: config.xml
                  - key: agent-config
                    path: config.yml
                  - key: logback-config
                    path: logback.xml
    
            # Required when the Collection Agent is configured for persistence (enabled by default)
            - name: persistence
              hostPath:
                path: /var/lib/geneos/collection-agent
                type: DirectoryOrCreate
    
            # These volumes are required when collecting logs.  These are the default directories
            # used by Kubernetes and Docker but they 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
    
  2. Apply the manifest.
    oc apply -n geneos -f netprobe-daemonset.yml
    

For Kubernetes

Follow the steps below:

  1. Create the DaemonSet manifest:
    apiVersion: apps/v1
    kind: DaemonSet
    metadata:
      name: netprobe
      namespace: geneos
    spec:
      selector:
        matchLabels:
          name: netprobe
      updateStrategy:
        type: RollingUpdate
      template:
        metadata:
          labels:
            name: netprobe
        spec:
          serviceAccount: netprobe-service-account
          terminationGracePeriodSeconds: 30
          containers:
            - name: netprobe
    
              # Change image URL as needed
              image: docker-registry.default.svc:5000/geneos/netprobe:5.1.0
              imagePullPolicy: Always
    
              volumeMounts:
                - name: config-volume
                  mountPath: /etc/netprobe
                  readOnly: true
    
              command: [ "/netprobe/netprobe.linux_64", "-setup", "/etc/netprobe/config.xml" ]
    
              # Run as non-privileged user.
              securityContext:
                runAsUser: 1000
    
              env:
                - name: DISABLE_MEM_PROTECTION
                  value: "true"
    
              # Probes for confirming the container is operational.
              # We recommend enabling the probes once you have verified your installation is successful.
              #
              #readinessProbe:
              #  tcpSocket:
              #    port: 7036
              #  initialDelaySeconds: 5
              #  periodSeconds: 5
              #livenessProbe:
              #  tcpSocket:
              #    port: 7036
              #  initialDelaySeconds: 10
              #  periodSeconds: 10
    
            - name: collection-agent
    
              # Change image URL as needed
              image: docker-registry.default.svc:5000/geneos/collection-agent:2.0.0
              imagePullPolicy: Always
    
              command: [
                "java",
                "-Xms512M",
                "-Xmx512M",
                "-Dlogback.configurationFile=/app/config/logback.xml",
                "-jar",
                "/app/collection-agent.jar",
                "/app/config/config.yml"
              ]
    
              volumeMounts:
                - name: config-volume
                  mountPath: /app/config
                  readOnly: true
                - name: container-logs
                  mountPath: /var/log/containers
                  readOnly: true
                - name: pod-logs
                  mountPath: /var/log/pods
                  readOnly: true
                - name: docker-logs
                  mountPath: /var/lib/docker/containers
                  readOnly: true
                - name: persistence
                  mountPath: /var/lib/geneos/collection-agent
                  readOnly: false
    
              ports:
                # Required when using statsd.
                - containerPort: 8125
                  hostPort: 8125
                  protocol: UDP
    
              # Probes for confirming the container is operational.
              # We recommend enabling the probes once you have verified your installation is successful.
              #
              #readinessProbe:
              #  httpGet:
              #    port: 8080
              #    path: /healthcheck
              #  initialDelaySeconds: 5
              #  periodSeconds: 5
              #livenessProbe:
              #  httpGet:
              #    port: 8080
              #    path: /healthcheck
              #  initialDelaySeconds: 10
              #  periodSeconds: 10
    
              env:
                - name: NODE_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: spec.nodeName
                - name: NAMESPACE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                - name: POD_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.name
                - name: CONTAINER_NAME
                  value: "collection-agent"
    
          volumes:
            - name: config-volume
              configMap:
                name: netprobe-config
                items:
                  - key: netprobe-config
                    path: config.xml
                  - key: agent-config
                    path: config.yml
                  - key: logback-config
                    path: logback.xml
    
            # Required when the Collection Agent is configured for persistence (enabled by default)
            - name: persistence
              hostPath:
                path: /var/lib/geneos/collection-agent
                type: DirectoryOrCreate
    
            # These volumes are required when collecting logs.  These are the default directories
            # used by Kubernetes and Docker but they 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
    
  2. Apply the manifest:
    kubectl apply -n geneos -f netprobe-daemonset.yml

Create the Kubernetes metrics deployment

  1. Create the deployment manifest:
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: kube-metrics
      namespace: geneos
    spec:
      selector:
        matchLabels:
          name: kube-metrics
    
      # There should never be more than one instance in the cluster.
      replicas: 1
    
      strategy:
        type: Recreate
      template:
        metadata:
          labels:
            name: kube-metrics
        spec:
          serviceAccount: netprobe-service-account
          terminationGracePeriodSeconds: 30
          containers:
            - name: netprobe
    
              # Change image URL as needed
              image: docker-registry.default.svc:5000/geneos/netprobe:5.1.0
              imagePullPolicy: Always
    
              volumeMounts:
                - name: config-volume
                  mountPath: /etc/netprobe
                  readOnly: true
    
              command: [ "/netprobe/netprobe.linux_64", "-setup", "/etc/netprobe/config.xml" ]
    
              env:
                - name: DISABLE_MEM_PROTECTION
                  value: "true"
    
              # Probes for confirming the container is operational.
              # We recommend enabling the probes once you have verified your installation is successful.
              #
              #readinessProbe:
              #  tcpSocket:
              #    port: 7036
              #  initialDelaySeconds: 5
              #  periodSeconds: 5
              #livenessProbe:
              #  tcpSocket:
              #    port: 7036
              #  initialDelaySeconds: 10
              #  periodSeconds: 10
    
            - name: collection-agent
    
              # Change image URL as needed
              image: docker-registry.default.svc:5000/geneos/collection-agent:2.0.0
              imagePullPolicy: Always
    
              command: [
                "java",
                "-Xms512M",
                "-Xmx512M",
                "-Dlogback.configurationFile=/app/config/logback.xml",
                "-jar",
                "/app/collection-agent.jar",
                "/app/config/config.yml"
              ]
    
              volumeMounts:
                - name: config-volume
                  mountPath: /app/config
                  readOnly: true
    
    
              # Probes for confirming the container is operational.
              # We recommend enabling the probes once you have verified your installation is successful.
              #
              #readinessProbe:
              #  httpGet:
              #    port: 8080
              #    path: /healthcheck
              #  initialDelaySeconds: 5
              #  periodSeconds: 5
              #livenessProbe:
              #  httpGet:
              #    port: 8080
              #    path: /healthcheck
              #  initialDelaySeconds: 10
              #  periodSeconds: 10
    
              env:
                - name: NODE_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: spec.nodeName
                - name: NAMESPACE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                - name: POD_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.name
                - name: CONTAINER_NAME
                  value: "collection-agent"
    
          volumes:
            - name: config-volume
              configMap:
                name: kube-metrics-config
                items:
                  - key: agent-config
                    path: config.yml
                  - key:  netprobe-config
                    path: config.xml
                  - key: logback-config
                    path: logback.xml
    
  2. 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 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 Collection Agent configuration reference.