9
9
10
10
[ ![ Gitpod Ready-to-Code] ( https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod )] ( https://gitpod.io/#https://github.com/hpe-container-platform-community/hpecp-python-library )
11
11
[ ![ Good first issues open] ( https://img.shields.io/github/issues/hpe-container-platform-community/hpecp-python-library/good%20first%20issue.svg?label=good%20first%20issue )] ( https://github.com/hpe-container-platform-community/hpecp-python-library/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22 )
12
-
12
+
13
13
14
14
----
15
15
@@ -93,6 +93,16 @@ Create k8s cluster:
93
93
hpecp k8scluster create --name myclus1 --k8shosts-config /api/v2/worker/k8shost/1:master --k8s_version=1.17.0
94
94
```
95
95
96
+ Get k8s available addons:
97
+ ``` sh
98
+ hpecp k8scluster get-available-addons --id $CLUSTER_ID
99
+ ```
100
+
101
+ Add k8s cluster addons:
102
+ ``` sh
103
+ hpecp k8scluster add-addons --id $CLUSTER_ID --addons [istio,harbor]
104
+ ```
105
+
96
106
List with columns parameter:
97
107
``` sh
98
108
hpecp k8scluster list --columns [id,description,status]
@@ -108,9 +118,36 @@ List --query examples:
108
118
hpecp tenant examples
109
119
```
110
120
121
+ Tenant create:
122
+ ``` sh
123
+ TENANT_ID=$( hpecp tenant create --name tenant1 --description " dev tenant" --k8s-cluster-id $CLUSTER_ID --tenant-type k8s)
124
+ hpecp tenant wait-for-status --id $TENANT_ID --status [ready] --timeout-secs 600
125
+ ```
126
+
127
+ Add LDAP role to Tenant:
128
+ ``` sh
129
+ ADMIN_GROUP=" CN=DemoTenantAdmins,CN=Users,DC=samdom,DC=example,DC=com"
130
+ ADMIN_ROLE=$( hpecp role list --query " [?label.name == 'Admin'][_links.self.href]" --output text)
131
+ hpecp tenant add-external-user-group --tenant-id $TENANT_ID --group $ADMIN_GROUP --role-id $ADMIN_ROLE
132
+ ```
133
+
134
+ Add internal user to Tenant:
135
+
136
+ ``` sh
137
+ ADMIN_USER_ID=$( hpecp user list --query " [?label.name == 'admin'][_links.self.href]" --output text)
138
+ ADMIN_ROLE=$( hpecp role list --query " [?label.name == 'Admin'][_links.self.href]" --output text)
139
+ hpecp tenant assign-user-to-role --tenant-id $TENANT_ID --role-id $ADMIN_ROLE --user-id $ADMIN_USER_ID
140
+ ```
141
+
111
142
Tenant kube config:
112
143
``` sh
113
144
PROFILE=tenant1 hpecp tenant k8skubeconfig > tenant1_kube.conf
145
+
146
+ # get available Kubedirector apps
147
+ kubectl --kubeconfig tenant1_kube.conf -n t1 get kubedirectorapps
148
+
149
+ # list running applications
150
+ kubectl --kubeconfig tenant1_kube.conf -n t1 describe kubedirectorclusters
114
151
```
115
152
116
153
Http call:
0 commit comments