IBM / lmctl

Cloud Pak for Network Automation (CP4NA) (previously ALM/TNCO) command line tool
Apache License 2.0
4 stars 19 forks source link

issue using lmctl with a non default brent service name #105

Closed johnnally closed 3 years ago

johnnally commented 3 years ago

Describe the bug For an amazon eks deployment of cp4na helm charts we have a requirement to use a specific format of object names. For example for the bent svc is defined as 'ib-orch001-brent-017':

[ec2-user@ip-172-31-8-141 ~]$ kubectl get svc -n john | grep -i brent
ib-orch001-brent-017                               ClusterIP      10.100.113.114   <none>            

Our CP4NA UI is up and the brent RM was added successfully using the lm post configurator:

image

We are coming across a problem now when trying to add the kubedriver to the environment using lmctl:

lmctl resourcedriver add --type kubernetes --url https://ib-orch001-kubedriver-028:8294 --certificate kubedriver-tls.pem dev --config ~/lmctl-config.yaml
TNCO error occurred: Request returned unexpected error: status_code=400, message={'url': 'https://a4c5a0a2616084258a7d11b9e15d29dd-857507759.us-east-2.elb.amazonaws.com/api/resource-manager/resource-drivers', 'localizedMessage': "Resource Driver LifecycleDriverDescriptor{id='null', type='kubernetes', baseUri='https://ib-orch001-kubedriver-028:8294', certificate='-----BEGIN CERTIFICATE-----\\nMIIC8zCCAdugAwIBAgIQesKfUTWubY6gcAjc26rx3TANBgkqhkiG9w0BAQsFADAV\\nMRMwEQYDVQQDEwprdWJlZHJpdmVyMB4XDTIxMDcwODEwMzUxNVoXDTMxMDcwNjEw\\nMzUxNVowFTETMBEGA1UEAxMKa3ViZWRyaXZlcjCCASIwDQYJKoZIhvcNAQEBBQAD\\nggEPADCCAQoCggEBAMt3rHcYU3M9s+DjuofluPUHeloYSxUOzIcTgOs3e7frBbN3\\nRF6wUOGw0GyuhrzYz74L+qIEQKwdl9eZKLQqEqkYqiJzJIb0M7it8mp6DYYh4l/d\\nObezHs7bH9jj/ZC5jT1UYEPCHd/HwS8SrD8AQeEGI7qjw4dXKSo65qb/SvJZWHmp\\nK91oKBdHKTrr18pbD0Tbhbfvrtshfumm7fwUDH1B1ME0S571NkJb3Sa+ef+MOTbo\\ne+IJkIBMcIXmqMa7A4jP62VnsOeCQsUin9weBUc/AAk6M4wZWmEcdah7KcLCmQqG\\nNT6omDaUob5V/MEQGnnjNPqWxQCK1Fe1yqk0kkECAwEAAaM/MD0wDgYDVR0PAQH/\\nBAQDAgWgMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAMBgNVHRMBAf8E\\nAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQAtLTBObhYlS4B7UeZvAJm1iycZLm48fxsB\\n+Vbf30l8nFCVNeG7h0jf1vt55LyKS67aqOsHHoInlgXIfSFW6abmK59CpwAiZRnk\\n0aehbUO42PQHSUbTa37iNr6NCKWz+zKTBJJR8ErEdP3gurnvkCzxJYc913G6qD+z\\nAq3A7zVEge+wdUgiJFut9kBV3AyFDBx09ISRMn8ATXnDfT0bR6zRecKTNqEq4FEp\\n8IgWr37agkyjzkKLS0CHuQT2jfX1HXrruHtXy+eN1586btIdQd9A1tLE5+vJP/om\\nSZbxslvI227ZD6qE4c2zPIr37/61ZW5KDgQyvZ8DPTxAMjtMaBnH\\n-----END CERTIFICATE-----\\n'} onboarding failed", 'details': {'rootCause': 'A RETRYABLE ALM Driver error has occurred: I/O error on POST request for "https://brent:8291/api/resource-manager/resource-drivers": brent; nested exception is java.net.UnknownHostException: brent'}}

So lmctl is defaulting to use 'brent' as the service name, so our service of 'ib-orch001-brent-017' is not contacted.

Is there any to overwrite the default brent service name in the lmctl config or via the cli tool, so the resource driver add request from lmctl will go to https://ib-orch001-brent-017:8291/api/resource-manager/resource-drivers instead We've had a look at the lmctl code and cannot see anything obvious.

To Reproduce

  1. Install brent driver via helm with cp4na, but change the brent service name prior to installation, will need to change also the host key alias for brent to new svc name (not the default 'brent' svc)
  2. Try and onboard a driver (for example kubedriver) using lmctl
  3. See resulting error

Expected behaviour Either via lmctl cli or the lmctl config we should be able to specify the new brent svc name, so lmctl communicates with this and not the default 'svc name of 'brent'

johnnally commented 3 years ago

closing issue

tonyob commented 3 years ago

This error is actually originating from the CP4NA software itself and not due to any client-side configuration.

Please close and open an issue against the CP4NA product itself.