Install and Configure OpenShift Monitoring

You install and configure OpenShift Monitoring from within your Docker environment. The YML code that is provided in this section contains a Deployment and a Daemon set. When using OpenShift Monitoring in a cluster installation, each node in the cluster has one agent that is deployed with DaemonSet. One node in the cluster has an extra agent that monitors the deployment and health of the entire cluster. You deploy all agents using the same command. Your containers must run in privileged mode. Before you proceed, ensure that your OpenShift administrator gave you the role that is required for running containers in privileged mode. For more information, see the OpenShift documentation.
apmdevops106
You install and configure OpenShift Monitoring from within your Docker environment. The YML code that is provided in this section contains a Deployment and a Daemon set. When using OpenShift Monitoring in a cluster installation, each node in the cluster has one agent that is deployed with DaemonSet. One node in the cluster has an extra agent that monitors the deployment and health of the entire cluster. You deploy all agents using the same command. Your containers must run in privileged mode. Before you proceed, ensure that your OpenShift administrator gave you the role that is required for running containers in privileged mode. For more information, see the OpenShift documentation.
Installation and Configuration
Install and configure OpenShift Monitoring for your environment.
Follow these steps:
  1. Log in as an OpenShift user who has permission to:
    • create Daemonset pods
    • run containers in privileged mode
  2. Create a project called
    caapm:
    oc new-project caapm
  3. Download the image stream:
  4. Download the YML file that corresponds to your platform to the location of your choice.
    • If you use CA Digital Experience Insights Application Performance Management, use the
      caagent-openshiftmonitor.yml
      file. This file comes included with the installation instructions on your CA Digital Experience Insights instance.
  5. 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
    • (CA Digital Experience Insights Application Performance Management)
      [AGENTMANAGER_CREDENTIAL]
      Agent Manager credentials that are needed to connect any SaaS instance
    • [OPENSHIFT_CONNECTION_URL]
      OpenShift connection details. Obtain these details by running
      oc config view
      .
    • [APITOKEN]
      API Token for the connection URL. Obtain this token by creating a service account with cluster-reader role in the default workspace. For more information, see Obtain the APITOKEN.
    • registry_url
      : OpenShift registry URL. For more information, see Obtain the Registry Details.
  6. (Optional) In addition to the environment variables 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.
  7. To pass an Infrastructure Agent property as an environment variable through the
    caagent-install.yml
    file, append the variable to the end of the second
    env
    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: [OPENSHIFT_CONNECTION_URL]
    - name: apitoken
    value: [APITOKEN]
    - name: type
    value: Openshift
    - 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
  8. (Optional) When the Host Monitor is installed, 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: Openshift
    - name: interval
    value: "120"
    - name: storage_mount_filter
    value: "/host/home"
    - name: storage_outofbox_filter_enabled
    value: "no"
  9. (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: Openshift
    - name: interval
    value: "120"
    - name: MIN_HEAP_VAL_IN_MB
    value: "335"
    - name: MAX_HEAP_VAL_IN_MB
    value: "670"
  10. Save the
    caagent-openshiftmonitor.yml
    file.
  11. Run the file:
    oc create -f caagent-openshiftmonitor.yml
    This file deploys all agents in the cluster.
  12. Add a policy so that users can run containers in privileged mode:
    oc adm policy add-scc-to-user privileged -z default
Uninstall
To uninstall the OpenShift Monitoring extension, run the following command:
oc delete -f caagent-openshiftmonitor.yml
Obtain the API Token
An API token is the unique identifier of an application requesting access to a service. In the YML file, include the API token that is generated by OpenShift to authenticate the connection URL. Obtain the API Token that is required for
caagent-openshiftmonitor.yml.
Follow these steps:
  1. Create a Service Account in the
    default
    namespace:
    oc login -u system:admin
    oc project default
    oc create sa caapm
  2. Add the cluster-reader role:
    oc adm policy add-cluster-role-to-user cluster-reader system:serviceaccount:default:caapm
  3. Get the token:
    oc sa get-token -n default caapm
Obtain the Registry Details
To provide the registry URL in the YML file, you must obtain the docker-registry details.
Follow these steps:
  1. Identify the
    docker-registry
    service:
    oc login -u system:admin oc get svc -n default
  2. Here is a sample output:
    NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE docker-registry 172.30.1.1 <none> 5000/TCP 9d
  3. In this example, the registry_url value is
    172.30.1.1:5000
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 properties interchangeably.
Alias Properties
Description
Default Value
docker.interval.seconds
interval
com.ca.apm.openshift.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 OpenShift Monitoring Metrics.