BookmarkSubscribeRSS Feed

SAS Viya 4: Loading External Path-Based Data, Part 2

Started ‎02-25-2021 by
Modified ‎02-25-2021 by
Views 4,764

In my last article, I introduced some ideas around persistent storage in SAS Viya 4 / Kubernetes. However, I only briefly touched on the actual mechanisms you'd use to find where your CASLibs and libnames actually point outside of the SAS Viya 4 containers. I'm currently tracking down some CASLibs on a test SAS Viya 4 env with Kubectl. Let's take a look at the commands and results I use to see where the physical files actually sit.

. . .

Get the Relevant Namespace and Pod Name

I'm flying blind here. The first thing I need to do is understand what my Kubernetes environment looks like so I can figure out exactly where to look for the storage information. The first command I'll issue is below. This will tell me every single pod in the environment.

.

kubectl get pods --all-namespaces

 

The output contains numerous pods. I narrow down what I'm looking for to the CAS pods until finally I locate the CAS Controller pod.

..

sf_1_pods.png

Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.

 

This not only gives me the CAS Controller pod name, sas-cas-server-default-controller, but also the namespace, gelenv-stable.

 

Describe the Pod

Now that I know the relevant pod and namespace names, I can use them to look at how the pod is structured.

 

kubectl describe pod sas-cas-server-default-controller -n gelenv-stable 

.

The pod contains numerous containers but I want the CAS container and, in particular, its mounts... .

sf_2_mounts-2.png

 

 

Inspect any Ephemeral Volumes

There are two mounts that draw my interest, /cas/data and /gelcontent. Respectively they are bound to the identifiers, cas-default-data-volume and gelcontent-volume. I search for these lower in the output. The identifiers appear in the Volumes section.

 

..

sf_3_ephemeralVolume-1.png

 

 

Inspecting the volumes section, I can see that gelcontent-volume is an ephemeral volume and maps to /data/gel/content on the 10.96.13.223 machine.

 

Therefore, any CASLib or libname that uses the /gelcontent path within the SAS Viya 4 CAS environment maps to the /data/gel/content location on the 10.96.13.223 host. I can drop files there from external applications to use in SAS Viya. I can grab files from there that SAS Viya creates for use in other applications. .

 

Inspect any Persistent Volumes

The cas-default-data-volume identifier points to a persistent volume claim (PVC), named cas-default-data. .

 

sf_4_persistentVolume.png

 

With the claim name, I execute the following command. .

 

kubectl get pvc cas-default-data -n gelenv-stable

.

The command tells me the Kubernetes Persistent Volume (PV) that the PVC claimed.

..

sf_5_pvc.png

 

Now, I need to issue one more command to see where the PV maps.

 

kubectl get pv pvc-7c5f34af-1c64-4332-b8d9-bd03c113048e -o json

.

The mapping information appears under the "spec" element.

..

sf_6_pv.png

 

From this, I can see that the /cas/data path inside SAS Viya environment maps to the /srv/nfs/kubedata/gelenv-stable-cas-default-data-pvc-7c5f34af-1c64-4332-b8d9-bd03c113048e path on the intnode01 machine. So again, external applications can drop data here for SAS Viya to use in the various CASLibs and libnames that use the /cas/data path, and external applications can grab SAS Viya outputs from here.

 

.

Applying This to Your Env

Hopefully this exercise and these command examples will help you to analyze your SAS Viya 4 Kubernetes environment to see where your persistent data lives. .

 

Find more articles from SAS Global Enablement and Learning here.

Version history
Last update:
‎02-25-2021 11:23 AM
Updated by:
Contributors

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Labels
Article Tags