Skip to content

SAS Enterprise Session Monitor Administration Guide for Kubernetes

Starting with SAS Enterprise Session Monitor 2022 it is possible to deploy to, and monitor, applications deployed to a Kubernetes cluster.

System Requirements

Supported versions of SAS®

SAS Enterprise Session Monitor is compatible with all released versions of SAS Viya and all release SAS Applications on Kubernetes.

Kubelet Supported Versions

  • 1.24.x
  • 1.23.x
  • 1.22.x
  • 1.21.x

Container Runtime Environment Supported Versions

  • Docker 19.3+
  • Containerd 1.4.x+
  • CRI-O 1.19+

Nginx Ingress

  • v0.41.x
  • v1.x.x

Permissions

For Namespace scoped deployments:

  • List Pods
  • Watch Pods
  • Create Role
  • Create RoleBinding
  • Create DaemonSet

For Cluster wide deployments:

  • List Nodes

  • Create PriorityClass

  • Create ServiceAccount
  • Create ClusterRole
  • Create ClusterRoleBinding
  • Create DaemonSet

SAS Enterprise Session Monitor Server

As with previous versions of Enterprise Session Monitor we recommend running the Server component of Enterprise Session Monitor off the cluster. While the system resources that the Server component requires are relatively light, there are a number of scenarios where your Kubernetes cluster or application might be inaccessible. In this scenario, you would want to be able to get to the Enterprise Session Monitor interface to understand what happened in the hours, minutes, and seconds before an outage. If the Enterprise Session Monitor Server is deployed to the same in-operable cluster, this might not be possible.

The deployment guide and pre-requisites for installing the Server component can be found in the existing documentation.

Installation

Environment variables

The following steps assume that you have the Kubectl command installed on the machine from where you are performing the installation and that your KUBECONFIG environment variable is correctly set for your target Kubernetes cluster.

Kubernetes Namepsaces

Where you see in the below instructions should be replaced with the value of the namespace within which you want to deploy the Enterprise Session Monitor Server. This could be the same namespace as your SAS® Viya deployment, or another namespace.

If you do decide to run your server on the cluster, you'll want to download the esm-secret.yaml and all of the esm-server*.yaml files from the Kubernetes folder on the Enterprise Session Monitor downloads page.

  1. Update line 21 of esm-server.yaml replacing the text YOURESMLICENSE with the contents of the ESM license string provided when you received the software download and license email.

  2. Update line 9 on esm-server-ingress.yaml replacing the text ESM_SERVICE_HOST with the Fully Qualified Domain Name of your deployment, for example: sas.viya.example.com

  3. Deploy the Enterprise Session Monitor secret. This is required to authenticate to the image repository:

kubectl apply -f esm-secret.yaml -n <NAMESPACE>
  1. Deploy the Enterprise Session Monitor Server pod:
kubectl apply -f esm-server.yaml -n <NAMESPACE>
  1. Deploy the Enterprise Session Monitor Server Cluster IP service:
kubectl apply -f esm-server-clusterip.yaml -n <NAMESPACE>
  1. Deploy the Enterprise Session Monitor Server Ingress:
kubectl apply -f esm-server-ingress.yaml -n <NAMESPACE>

The initial deployment and starting of the Enterprise Session Monitor Server will take a number of minutes. Once the deployment is complete, you should be able to access the user interface of the application at: http:///esm/

If you are deploying the Enterprise Session Monitor Agent to the same cluster as the Server then you will need to get the Cluster IP address for the Agent installation process. This can be retrieved by running the following command:

kubectl get svc sas-enterprise-session-monitor-server -n <NAMESPACE> | grep sas-enterprise-session-monitor-server | cut -d' ' -f7

Removal

If you wish to remove the Enterprise Session Monitor Server from your cluster you should remove the components in the following order:

  1. Ingress
  2. Service
  3. Pod

The components can be deleted using a Kubernetes IDE such as Lens or by using the following commands:

  1. Removing the Enterprise Session Monitor Ingres:
kubectl delete ingress sas-enterprise-session-monitor
  1. Removing the Enterprise Session Monitor Service:
kubectl delete svc sas-enterprise-session-monitor
  1. Removing the Enterprise Session Monitor Pod:
kubectl delete pod sas-enterprise-session-monitor

SAS Enterprise Session Monitor Agent

Installation

The following steps assume that you have the Kubectl command installed on the machine from where you are performing the installation, that your KUBECONFIG environment variable is correctly set for your target Kubernetes cluster, and that the configuration file being used has Cluster wide permissions. If the configuration file that you are using is scoped to a single Namespace, please see the Namspace Scoped deployment instructions section.

Where you see in the below instructions should be replaced with the value of the namespace within which you want to deploy the Enterprise Session Monitor Server.

In order to deploy the Enterprise Session Monitor Agent to your cluster you'll need to download the esm-secret.yaml and esm-agents.yaml files from the Kubernetes folder on the Enterprise Session Monitor downloads page and complete the following steps:

  1. Update line 91 of esm-agents.yaml replacing YOURESMSERVER with the IP address or fully qualified domain name of your Enterprise Session Monitor Server instance

  2. [OPTIONAL] Update all instances of namespace: default to the namespace into which you want to deploy the Agent

  3. Deploy the Enterprise Session Monitor secret. This is required to authenticate to the image repository:

kubectl apply -f esm-secret.yaml -n <NAMESPACE>
  1. Deploy the Enterprise Session Monitor Agent(s):
kubectl apply -f esm-agents.yaml

Namespace Scoped Deployments

In certain deployment scenarios a user might only have permissions to working within a single namespace. In this case, modifications need to be made to the esm-agents.yaml deployment YAML in addition to the steps detailed above. The following steps should be completed before Step 3 in the above Agent installation instructions

  1. Remove the PriorityClass configuration block (lines 4 through 12)
  2. Update ClusterRole to Role on (line 20)
  3. Update ClusterRoleBinding to RoleBinding (line 30)
  4. Update ClusterRole to Role (line 40)
  5. Remove the priorityClassName block from the Agent container specification block (line 69)
  6. Within the env section of sas-enterprise-session-monitor-viya4 container, add the following environment variables:
  7. NAMESPACE - The Namespace that the Agent will look for pods within.
  8. CONTAINER_RUNTIME_TYPE - Sets the container runtime environment technology choice. This is used by the agent to find containers and pods. Valid values are docker, and containerd.
  9. CONTAINER_RUNTIME_VERSION This is the version of the CONTAINER_RUNTIME_TYPE. For example, for docker this might be "19.3.33" or for containerd 1.4.9.

Administration

Starting and stopping the Agents on Kubernetes is as simple as either deleting or applying the Agent configuration.

For instructions on how to stop and remove the Agent configuration from your cluster, see the Removal instructions below for details.

For instructions on how to add and start the Agent configuration on your cluster, see the installation instructions above for details

Removal

If you wish to remove the Enterprise Session Monitor Agent from your cluster you should remove the Agent's components in the following order:

  1. Daemon Set
  2. Cluster Role Binding
  3. Cluster Role
  4. Service Account
  5. Priority Class

The components can be deleted using a Kubernetes IDE such as Lens or by using the following command:

kubectl delete -f esm-agents.yaml