Skip to content

Commit 54fec45

Browse files
committed
feat(k8scluster): add external_identity_server
Signed-off-by: Chris Snow <[email protected]>
1 parent 6657275 commit 54fec45

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

hpecp/cli/k8scluster.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def create(
8282
persistent_storage_local=False,
8383
persistent_storage_nimble_csi=False,
8484
addons=[],
85+
external_identity_server={},
8586
):
8687
"""Create a K8s Cluster.
8788
@@ -99,6 +100,19 @@ def create(
99100
:param persistent_storage_nimble_csi: True/False
100101
:param addons: list of required addons. See:
101102
`hpecp k8scluster get-available-addons`
103+
:param external_identity_server: dict
104+
Example {
105+
"bind_pwd":"password",
106+
"user_attribute":"CN",
107+
"bind_type":"search_bind",
108+
"bind_dn":"cn=Administrator,CN=Users,DC=samdom,DC=example,DC=com",
109+
"host":"10.1.0.15",
110+
"group_attribute":"member",
111+
"security_protocol":"ldaps",
112+
"base_dn":"CN=Users,DC=samdom,DC=example,DC=com",
113+
"verify_peer":false,
114+
"type":"Active Directory",
115+
"port":636}
102116
"""
103117
host_config = [
104118
K8sClusterHostConfig.create_from_list(h.split(":"))
@@ -117,6 +131,7 @@ def create(
117131
persistent_storage_nimble_csi=persistent_storage_nimble_csi,
118132
k8shosts_config=host_config,
119133
addons=addons,
134+
external_identity_server=external_identity_server,
120135
)
121136
)
122137

hpecp/k8s_cluster.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ def create(
292292
persistent_storage_nimble_csi=False,
293293
k8shosts_config=[],
294294
addons=[],
295+
external_identity_server={},
295296
):
296297
"""Send an API request to create a K8s Cluster. The cluster creation
297298
will be asynchronous - use the :py:meth:`wait_for_status` method to
@@ -329,6 +330,19 @@ def create(
329330
k8shosts_config: list[K8sClusterHostConfig]
330331
list of :py:class:`K8sClusterHostConfig` objects determining
331332
which hosts to add and their role (master or worker)
333+
external_identity_server: dict
334+
Example {
335+
"bind_pwd":"password",
336+
"user_attribute":"CN",
337+
"bind_type":"search_bind",
338+
"bind_dn":"cn=Administrator,CN=Users,DC=samdom,DC=example,DC=com",
339+
"host":"10.1.0.15",
340+
"group_attribute":"member",
341+
"security_protocol":"ldaps",
342+
"base_dn":"CN=Users,DC=samdom,DC=example,DC=com",
343+
"verify_peer":false,
344+
"type":"Active Directory",
345+
"port":636}
332346
333347
Returns
334348
-------
@@ -393,6 +407,8 @@ def create(
393407
data["label"]["description"] = description
394408
if k8s_version is not None:
395409
data["k8s_version"] = k8s_version
410+
if external_identity_server is not None:
411+
data["external_identity_server"] = external_identity_server
396412

397413
response = self.client._request(
398414
url="/api/v2/k8scluster",

0 commit comments

Comments
 (0)