Install and Configure Kubernetes Monitoring

You install and configure Kubernetes Monitoring from within your Docker environment. The YML code that is provided in this section contains a Deployment and a Daemon set. Your pod containers must run in privileged mode. Before you proceed, ensure that your Kubernetes administrator gave you the role that is required for running pod containers in privileged mode. For more information, see Kubernetes.
apmdevops106
You install and configure Kubernetes Monitoring from within your Docker environment. The YML code that is provided in this section contains a Deployment and a Daemon set. Your pod containers must run in privileged mode. Before you proceed, ensure that your Kubernetes administrator gave you the role that is required for running pod containers in privileged mode. For more information, see Kubernetes.
Installation and Configuration
Install and configure the Kubernetes Monitoring extension for your environment.
Follow these steps:
  1. Download the image:
    docker pull caapm/kubernetesmonitor:latest
  2. Download the YML file that corresponds to your platform to the location of your choice.
    • For CA Application Performance Management (APM) on premise, use the following
      caagent-kubernetesmonitor.yml
      file:
      250
    • For CA Digital Experience Insights Application Performance Management, use the
      caagent-kubernetesmonitor.yml
      file that is included with the installation instructions on your CA Digital Experience Insights instance.
  3. Replace the following variables with your setup details:
    • (CA APM on premise)
      [AGENTMANAGER_URL]
      Agent or Enterprise Manager connection details - similar to the connection details provided in
      IntroscopeAgent.profile
    • [KUBERNETES_CONNECTION_URL]
      Kubernetes connection details. You can obtain these details by running
      kubectl config view
      .
    • [APITOKEN]
      API Token for the connection URL. You can obtain this token by creating a service account with cluster-reader role in the default workspace. See Obtain the API Token for more information.
  4. (Optional) In addition to the environment variables provided in the YML file, use the properties in the Infrastructure Agent profile to configure your environment. For more information about the Infrastructure Agent properties, see the Infrastructure Agent Properties Reference.
    To pass an Infrastructure Agent property as an environment variable through the
    install.yml
    file, append it to the end of the
    environment
    section. The YML format does not allow you to use the "." separator in property names. You must replace the periods in the property names with underscores. For example, to configure the agent name and a proxy server, you use the
    introscope.agent.agentName
    and
    introscope.agent.enterprisemanager.transport.http.proxy.host
    properties as  follows:
    env:
    - name: agentManager_url_1
    value: [AGENTMANAGER_URL]
    - name: connectionurl
    value: [KUBERNETES_CONNECTION_URL]
    - name: apitoken
    value: [APITOKEN]
    - name: type
    value: Kubernetes
    - name: HostMonitoring
    value: disabled
    - name: introscope_agent_agentName
    value: example_agent_name
    - name: introscope_agent_enterprisemanager_transport_http_proxy_host
    value: example_proxy_server.com
  5. (Optional) When you install the Host Monitor, host-related information in the Component View includes the
    StorageName
    metric. On UNIX/Linux systems, you can set storage filters to configure the mount points that appear associated to this metric. Use the following environment variables to set storage filters:
    • storage_mount_filter
      A variable to specify mount points that you want to remove from consideration for the
      StorageName
      metric. You can specify either one mount point per line, or multiple mount points, which are separated by commas, on one line.
    • storage_outofbox_filter_enabled
      An out-of-the-box filter that, when enabled, filters out the following mount points:
      • devicemapper/mnt
      • docker/containers
      • docker/devicemapper
      • docker/
      • kubelet/pods
      • openshift.local.volumes
      This filter is enabled by default. To disable it, set its value to
      no
      .
    Example
    Hide the
    /host/home
    mount point but include all the mount points listed for the
    storage_outofbox_filter_enabled
    filter and disable the out-of-the-box filter. To do this, add the environment variables to the first environment variables section in the YML file as follows:
    env:
    - name: containerflow
    value: enabled
    - name: agentManager_url_1
    value: [AGENTMANAGER_URL]
    - name: type
    value: Kubernetes
    - name: interval
    value: "120"
    - name: storage_mount_filter
    value: "/host/home"
    - name: storage_outofbox_filter_enabled
    value: "no"
  6. (Optional) You can configure the
    xms
    and
    xmx
    parameters of the JVM in which the Infrastructure Agent runs using the following environment variables:
      • MIN_HEAP_VAL_IN_MB
        Default:
        256
      • MAX_HEAP_VAL_IN_MB
        Default:
        512
    You can use the YML file to update the Java heap values. For example: 
    env:
    - name: containerflow
    value: enabled
    - name: agentManager_url_1
    value: [AGENTMANAGER_URL]
    - name: type
    value: Kubernetes
    - name: interval
    value: "120"
    - name: MIN_HEAP_VAL_IN_MB
    value: "335"
    - name: MAX_HEAP_VAL_IN_MB
    value: "670"
  7. Save the
    caagent-kubernetesmonitor.yml
    file.
  8. Run the file:
    kubectl create -f caagent-kubernetesmonitor.yml
Deinstallation
To uninstall the Kubernetes Monitoring extension, run the following command:
kubectl delete -f caagent-kubernetesmonitor.yml
Obtain the API Token
An API token is the unique identifier of an application requesting access to a service. In the YML file, you must include the API token that is generated by Kubernetes to authenticate the connection URL. Obtain the API token that is required for
caagent-kubernetesmonitor.yml.
Follow these steps:
  1. Create a Service Account in the
    default
    namespace:
    kubectl create sa caapm
  2. Add the cluster-reader role:
    kubectl create clusterrolebinding cluster-read --serviceaccount=default:caapm --clusterrole=cluster-admin
  3. Get the token:
    kubectl get secrets|grep caapm-token| cut -f1 -d " "|xargs kubectl describe secret | grep token
Use Agent Properties
Some agent properties have aliases that you can use to configure the agent. The functions of the properties that are listed in the same row of the following table are the same. You can use these propertiescan interchangeably.
Alias Properties
Description
Default Value
docker.interval.seconds
interval
com.ca.apm.kubernetes.monitor.polling.interval
Sets the Data Collection report interval.
120 seconds
type
monitoring.type
com.ca.apm.docker.monitor.type
Sets the monitoring type.
DockerMonitor
containerflow
com.ca.apm.docker.monitor.containerflow
Indicates whether Containerflow module is enabled or disabled.
enabled
connectionurl
KUBERNETES_CONNECTION_URL
com.ca.apm.kubernetes.monitor.connection.url
Shows the connection URL for Kubernetes Client.
empty string value
apitoken
com.ca.apm.kubernetes.monitor.api.token
Shows the API Token need for connecting the Kubernetes cluster.
empty string value
k8s_username
com.ca.apm.kubernetes.monitor.username
Shows the Kubernetes username for cluster access.
empty string value
SHOW_METRICS_LEVEL
com.ca.apm.show.metrics.level
Shows the metric level for Kubernetes monitoring.
Possible values:
full
or
minimum
minimum
DEFAULT_MAX_POD_INSTANCE
Sets the maximum number of Instances that show in the Metric Tree. Any Instances over the set maximum appear under the InstanceDefault node in the Metrics Tree.
Default: 5
  • If the SHOW_METRICS_LEVEL is set to
    full
    or the
    ReadyState
    to
    1
    , the following metrics display:
    ClusterMonitor
    ,
    Container State
    ,
    Containers Per Pod
    , and
    Total Containers Ready
    .
  • If the SHOW_METRICS_LEVEL is set to full or
    Deployment Health
    is set to
    1
    , the following metrics display:
    ReadyState
    ,
    Available Replicas
    ,
    Desired Replicas
    , and
    UptoDate Replicas
    .For more information about these metrics, see Kubernetes Monitoring Metrics.