Create Tenant for Kubernetes Deployment

This section describes how to create a API Portal tenant in a Kubernetes cluster through Google Kubernetes Engine (GKE) or OpenShift Enterprise/OpenShift Container Platform (OCP).
To create a tenant record:
Create and Generate JSON Payload
Create and generate JSON payload for the Tenant Creation API call using the tenant parameters defined next. 
 Tenant Parameters 
Tenant Parameters 
Standard
Notes
adminEmail
*
The Admin email of the tenant
noReplyEmail
*
The tenant no-reply-email
portalName
*
Name of the portal.
Restrictions:
  • Lowercase letters (a-z) and numbers (0-9) only
  • 255 characters maximum
subdomain
The portal subdomain
tenantId
*
The Tenant ID you create
Restrictions:
  • Lowercase letters (a-z) and numbers (0-9) only
  • 255 characters maximum
auditLogLevel
One of the following values:
  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR
multiclusterEnabled
Either 
true
 or 
false
.
Set to 
true
 for a tenant with an API Portal integrated with on-premise API proxy clusters.
Set to 
false
 for a SAAS Portal.
performanceLogLevel
One of the following values:
  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR
portalLogLevel
One of the following values:
  • TRACE
  • DEBUG
  • INFO
  • WARN
  • ERROR
tenantType
One of the following values:
  • SAAS
  • ON-PREM
termOfUse
*
Your tenant term of use. 
One of the following:
  • A string, such as "EULA"
  •  
    null
     
Save the file as
payload.json
. A sample payload is shown next:
{ "adminEmail": "YOUR-ADMIN-EMAIL", "auditLogLevel": "TRACE", "multiclusterEnabled": true, "noReplyEmail":"[email protected]_DOMAIN", "performanceLogLevel": "ERROR", "portalLogLevel": "ERROR", "portalName": "YOUR-PORTAL-NAME", "subdomain": "YOUR-DOMAIN", "tenantId": "YOUR-TENANT-NAME", "tenantType": "ON-PREM", "termOfUse": "eula" }
Post Payload to Tenant Creation API
To request tenant creation, run the following POST request using the API 
https://<portal-ssg host>:<portal-ssg port>/provision/tenants:
curl -X POST -k https://<portal-ssg host>:<portal-ssg port>/provision/tenants --cert apim-tps.crt --key apim-tps.key -H "Accept: application/json" -H "Content-Type: application/json" -d "@./payload.json"
Notes:
  • For GKE:
    Assuming that Portal has been deployed on GKE after generating certificates and for tenant creation, the default apim-tps.cert and apim-tps.key are used. These should be available in your /
    files
     directory.
  • For OCP:
     Assuming that Portal has been deployed on OpenShift after generating certificates which was packaged to the preferred Artifactory and for tenant creation, the default apim-tps.cert and apim-tps.key are used. These should be available in your /
    files
     directory.
Sample output:
{"uuid":"5f2b152e-4272-41d1-a6b3-cc07ce6eb8ce","tenantId":"tenant2","portalName":"myportal","auditLogLevel":"TRACE", "performanceLogLevel":"ERROR","portalLogLevel":"ERROR","adminEmail":"[email protected]","noReplyEmail":"[email protected]", "tenantType":"ON-PREM","termOfUse":"EUlA","subdomain":"example.com","cqAuthorHost":null,"portalAppTenantI18NUri":"/admin/dict.json", "portalAppLoginUri":"/admin/login","portalAppHomeUri":"/admin/app/home","portalAppNavigationPrimaryUri":"/admin/navigation", "portalAppExtUserDashboardUri":"/admin/app/dashboard","portalAppLogoutDefaultTargetUri":"/homeRedirect", "portalAppMobileCSSUri":"","portalAppDesktopCSSUri":"","cqAuthorAuthUri":null,"status":"ACTIVE","hybridState":1, "portalHost":"tenantdemo.example.com"}
Route New Hostname
Route the new API Portal homepage hostname through ingress-controller and portal-ingress.
To route new hostname in GKE:
Expose the newly created tenant in ingress controller as follows:
- host: tenantdemo.example.com http: paths: - backend: serviceName: dispatcher servicePort: portal-https
Add the route to the new tenant in your 
/etc/hosts
:
portalIP tenantdemo.example.com
To route new hostname in OCP:
Create an OpenShift route to expose the newly created tenant to Dispatcher port 8443.
 
Log In to New Tenant
Log in to Portal using the newly created tenant. Default username is 
admin
 and password is 
7layer
.