Skip to content

SWAT within containerised (Viya4) environments : Referring to the bin and http K8s services #140

Open

Description

@SundareshSankaran

On a Viya 4 environment, I have published the sas-cas-server-default-bin and ..default-http services as NodePorts. A conscious decision has been taken to not deploy them as LoadBalancers in order to reduce entry points and administration overhead.

Accessing a Python editor from within SAS Studio (which is the customer's intended use), I am able to successfully connect to the binary service, through the controller's (internal) IP address - a sequence starting with 10.XX.XX.XX

Services in K8s are commonly accessed through the DNS name of <service_name>.<name_of_name_space>.svc.cluster.local. In this case, however, I am unable to connect through any of the following patterns (including port of 5570).

Within the connection string of

conn=swat.CAS(hostname=, port=, user=, password=)

hostname = any of the following :

sas-cas-server-default-bin.viya.svc.cluster.local
cas-shared-default-bin.viya.svc.cluster.local
sas-cas-server-default-controller.viya.svc.cluster.local

What might be the correct naming convention so that I do not have to have my users explicitly state the IP ?

Activity

  1. bkemper24 commented on Sep 27, 2022

    @bkemper24
    Contributor

    For the namespace 'viya'

    sas-cas-server-default-client.viya.svc.cluster.local

  2. SundareshSankaran commented on Sep 27, 2022

    @SundareshSankaran
    Author

    Thanks, @bkemper24 . I get the following error, though. May I also mention I'm using a self-signed certificate? At the same time, I felt the K8s DNS should take care of the same since this is an internal IP.

    >>>
    ERROR: The TCP/IP negClientSSL support routine failed with status 807ff019, hostname 10.0.191.XXX port 5570
    ERROR: SSL Error: Invalid subject name in partner's certificate. Subject name must match machine name.
    ERROR: Failed to connect to host 'sas-cas-server-default-client.viya.svc.cluster.local', port 5570.
    Traceback (most recent call last):
      File "/opt/sas/viya/home/sas-pyconfig/default_py/lib/python3.10/site-packages/swat/cas/connection.py", line 437, in __init__
        self._sw_connection = clib.SW_CASConnection(*params)
      File "/opt/sas/viya/home/sas-pyconfig/default_py/lib/python3.10/site-packages/swat/clib.py", line 133, in SW_CASConnection
        return _pyswat.SW_CASConnection(*args, **kwargs)
    SystemError: <class 'py310swat.SW_CASConnection'> returned NULL without setting an exception
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "<string>", line 7, in <module>
      File "/opt/sas/viya/home/sas-pyconfig/default_py/lib/python3.10/site-packages/swat/cas/connection.py", line 444, in __init__
        raise SWATError(self._sw_error.getLastErrorMessage())
    swat.exceptions.SWATError: Could not connect to 'sas-cas-server-default-client.viya.svc.cluster.local' on port 5570.
    >>>
    >>> 
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions