Skip to content

Commit be471c6

Browse files
committed
merged
2 parents 0b967a8 + 39da82b commit be471c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+5833
-6050
lines changed

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
[![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)
1111
[![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+
1313

1414
----
1515

@@ -93,6 +93,16 @@ Create k8s cluster:
9393
hpecp k8scluster create --name myclus1 --k8shosts-config /api/v2/worker/k8shost/1:master --k8s_version=1.17.0
9494
```
9595

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+
96106
List with columns parameter:
97107
```sh
98108
hpecp k8scluster list --columns [id,description,status]
@@ -108,9 +118,36 @@ List --query examples:
108118
hpecp tenant examples
109119
```
110120

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+
111142
Tenant kube config:
112143
```sh
113144
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
114151
```
115152

116153
Http call:

0 commit comments

Comments
 (0)