Difference between revisions of "UCS/Current/UCSPEGuide/Provision"
(Published) |
(Published) |
||
Line 11: | Line 11: | ||
}}{{Section | }}{{Section | ||
|sectionHeading=Tenant provisioning | |sectionHeading=Tenant provisioning | ||
+ | |anchor=tenant | ||
|alignment=Vertical | |alignment=Vertical | ||
− | |structuredtext={{ | + | |structuredtext=1. Create and configure a '''values-override.yaml''' file: |
− | |Status= | + | <source lang="yaml"> |
+ | # * Images | ||
+ | # Replace for your values: registry and secret | ||
+ | image: | ||
+ | pullPolicy: IfNotPresent | ||
+ | pullSecrets: [name: <docker-registry-secret-name>] | ||
+ | registry: <docker-registry> | ||
+ | repository: deploy_ucsx | ||
+ | |||
+ | # * Command | ||
+ | # "register_ucsx_tenant" or "unregister_ucsx_tenant" | ||
+ | command: "register_ucsx_tenant" | ||
+ | |||
+ | # * Tenant info | ||
+ | tenant: | ||
+ | id: "<tenant-sid>" | ||
+ | ccid: "<tenant-uuid>" | ||
+ | |||
+ | # * UCSX configuration | ||
+ | ucsx: | ||
+ | addr: "<ucsx-host-internal>:8500" | ||
+ | restaddr: "http://<ucsx-host-internal>:8080" | ||
+ | |||
+ | # * K8s secret and configmap | ||
+ | configNameBase: ucsx-config | ||
+ | secretNameBase: ucsx-secret | ||
+ | |||
+ | # * Authentication | ||
+ | # Set your values. | ||
+ | gauth: | ||
+ | auth: | ||
+ | url: "http://<gauth-auth-url-internal>" | ||
+ | # regions: | ||
+ | clientId: "<gauth-client-id>" | ||
+ | clientSecret: "<gauth-client-secret>" | ||
+ | env: | ||
+ | url: "http://<gauth-env-url-internal>" | ||
+ | |||
+ | # * DB Parameters | ||
+ | # Set your values. | ||
+ | db: | ||
+ | ssl: "<db-ssl-mode>" | ||
+ | name: "<db-name>" | ||
+ | host: "<db-host>" | ||
+ | port: "<db-port>" | ||
+ | user: "<db-user>" | ||
+ | password: "<db-password>" | ||
+ | |||
+ | # * WWE | ||
+ | # wwe: {} | ||
+ | wwe: | ||
+ | skipRegistration: 'true' | ||
+ | |||
+ | # * Pod configuration | ||
+ | podSecurityContext: {} | ||
+ | |||
+ | securityContext: {} | ||
+ | |||
+ | nodeSelector: {} | ||
+ | priorityClassName: '' | ||
+ | keepPod: true | ||
+ | </source> | ||
+ | 2. Install the UCSX client using the <tt>ucs-xaddtenant</tt> Helm chart: | ||
+ | <source lang="bash"> | ||
+ | helm install ucsx-addtenant-<tenant-sid> ucsxhelmrepo/ucsx-addtenant --version=<chart-version> --namespace=ucsx --wait --timeout 300s -f values-override.yaml</source> | ||
+ | |Status=No | ||
+ | }}{{Section | ||
+ | |sectionHeading=Configure WWE (Workspace API) to consume UCSX service | ||
+ | |anchor=configure-workspace | ||
+ | |alignment=Vertical | ||
+ | |structuredtext=If the <tt>wwe: skipRegistration</tt> values is set as ''true'' in the Helm chart, | ||
+ | |||
+ | 1. Get a bearer token from the GAUTH service: | ||
+ | <source> | ||
+ | curl -X POST "https://<gauth-auth-url-external>/auth/v3/oauth/token?grant_type=client_credentials&client_id=<gauth-client-id>&client_secret=<gauth-client-secret>" | ||
+ | </source> | ||
+ | 2. Get the current settings of Workspace API. | ||
+ | <source> | ||
+ | curl -X GET "https://<gauth-auth-url-external>/environment/v3/contact-centers/<tenant-uuid>/settings" -H "Authorization: Bearer <access-token>" -H "Content-Type: application/json" | ||
+ | </source> | ||
+ | 3. Configure the Workspace API to consume UCSX service. | ||
+ | <source> | ||
+ | curl -X POST "https://<gauth-auth-url-external>/environment/v3/contact-centers/<tenant-uuid>/settings" | ||
+ | -H "Authorization: Bearer <access-token>" | ||
+ | -H "Content-Type: application/json" | ||
+ | --data-raw '{ | ||
+ | "data": | ||
+ | {"name":"workspace-service.ucsservice-uri", | ||
+ | "location":"/", | ||
+ | "value":"http://<ucsx-host>", | ||
+ | "shared":false } | ||
+ | }'</source> | ||
+ | 4. Configure CORS. | ||
+ | <source> | ||
+ | curl -X POST "https://<gauth-auth-url-external>/environment/v3/cors" | ||
+ | -H "Authorization: Bearer <access-token>" | ||
+ | -H "Content-Type: application/json" | ||
+ | --data-raw '{ | ||
+ | "data": | ||
+ | { | ||
+ | "origin": "https://<ucsx-host>", | ||
+ | "contactCenterId": "<tenant-uuid>" | ||
+ | } | ||
+ | }' | ||
+ | </source> | ||
+ | |Status=No | ||
+ | }}{{Section | ||
+ | |sectionHeading=Validate the provisioning | ||
+ | |alignment=Vertical | ||
+ | |structuredtext=To check the logs: | ||
+ | <source> | ||
+ | kubectl get pods ucsx | ||
+ | kubectl logs <ucsx-addtenant-<tenant-sid>-pod-id> | ||
+ | </source> | ||
+ | |||
+ | ====curl requests==== | ||
+ | To get a bearer token: | ||
+ | <source> | ||
+ | curl -X POST "https://<gauth-auth-url-external>/auth/v3/oauth/token?grant_type=client_credentials&client_id=<gauth-client-id>&client_secret=<gauth-client-secret>" | ||
+ | </source> | ||
+ | |||
+ | To get a cluster version: | ||
+ | <source> | ||
+ | curl --request POST http://<ucsx-host>/ucs/v3/rest/request/get-version -H "Authorization: Bearer <access-token>" -H "Content-Type: application/json" | ||
+ | </source> | ||
+ | |||
+ | To get the tenant information: | ||
+ | <source> | ||
+ | curl -X GET http://<ucsx-host>/ucs/v3/config/tenants -H "Authorization: Bearer <access-token>" -H 'Content-Type: application/json' | ||
+ | </source> | ||
+ | |||
+ | To show the tenant information using the <tt>cmxctl</tt> command from the ucsx pod: | ||
+ | <source> | ||
+ | cmxctrl -g <access-token> info <tenant-uuid> | ||
+ | </source> | ||
+ | |Status=No | ||
+ | }}{{Section | ||
+ | |sectionHeading=Managing Tenants | ||
+ | |alignment=Vertical | ||
+ | |structuredtext=To unregister a tenant: | ||
+ | |||
+ | <source>helm install ucsx-addtenant-<tenant-sid> ucsxhelmrepo/ucsx-addtenant --version=<chart-version> --namespace=ucsx --wait --timeout 300s --set command=unregister_ucsx_tenant -f values-override.yaml | ||
+ | </source> | ||
+ | |||
+ | To uninstall a Helm chart: | ||
+ | |||
+ | <source>helm uninstall ucsx-addtenant-<tenant-sid> --namespace=ucsx</source> | ||
+ | |||
+ | To delete a tenant usingthe <tt>cmxctl</tt> command from the ucsx pod: | ||
+ | <source>cmxctrl rm -g <access-token> <tenant-uuid></source> | ||
+ | <br /> | ||
+ | |Status=No | ||
}} | }} | ||
|PEPageType=55cef4ff-9306-4313-8fd8-377282a38478 | |PEPageType=55cef4ff-9306-4313-8fd8-377282a38478 | ||
}} | }} |
Revision as of 03:35, December 23, 2021
Contents
Learn how to provision Universal Contact Service (UCS).
UCS provisioning is executed automatically during deployment procedure.
Tenant provisioning
1. Create and configure a values-override.yaml file:
# * Images
# Replace for your values: registry and secret
image:
pullPolicy: IfNotPresent
pullSecrets: [name: <docker-registry-secret-name>]
registry: <docker-registry>
repository: deploy_ucsx
# * Command
# "register_ucsx_tenant" or "unregister_ucsx_tenant"
command: "register_ucsx_tenant"
# * Tenant info
tenant:
id: "<tenant-sid>"
ccid: "<tenant-uuid>"
# * UCSX configuration
ucsx:
addr: "<ucsx-host-internal>:8500"
restaddr: "http://<ucsx-host-internal>:8080"
# * K8s secret and configmap
configNameBase: ucsx-config
secretNameBase: ucsx-secret
# * Authentication
# Set your values.
gauth:
auth:
url: "http://<gauth-auth-url-internal>"
# regions:
clientId: "<gauth-client-id>"
clientSecret: "<gauth-client-secret>"
env:
url: "http://<gauth-env-url-internal>"
# * DB Parameters
# Set your values.
db:
ssl: "<db-ssl-mode>"
name: "<db-name>"
host: "<db-host>"
port: "<db-port>"
user: "<db-user>"
password: "<db-password>"
# * WWE
# wwe: {}
wwe:
skipRegistration: 'true'
# * Pod configuration
podSecurityContext: {}
securityContext: {}
nodeSelector: {}
priorityClassName: ''
keepPod: true
2. Install the UCSX client using the ucs-xaddtenant Helm chart:
helm install ucsx-addtenant-<tenant-sid> ucsxhelmrepo/ucsx-addtenant --version=<chart-version> --namespace=ucsx --wait --timeout 300s -f values-override.yaml
Configure WWE (Workspace API) to consume UCSX service
If the wwe: skipRegistration values is set as true in the Helm chart,
1. Get a bearer token from the GAUTH service:
curl -X POST "https://<gauth-auth-url-external>/auth/v3/oauth/token?grant_type=client_credentials&client_id=<gauth-client-id>&client_secret=<gauth-client-secret>"
2. Get the current settings of Workspace API.
curl -X GET "https://<gauth-auth-url-external>/environment/v3/contact-centers/<tenant-uuid>/settings" -H "Authorization: Bearer <access-token>" -H "Content-Type: application/json"
3. Configure the Workspace API to consume UCSX service.
curl -X POST "https://<gauth-auth-url-external>/environment/v3/contact-centers/<tenant-uuid>/settings"
-H "Authorization: Bearer <access-token>"
-H "Content-Type: application/json"
--data-raw '{
"data":
{"name":"workspace-service.ucsservice-uri",
"location":"/",
"value":"http://<ucsx-host>",
"shared":false }
}'
4. Configure CORS.
curl -X POST "https://<gauth-auth-url-external>/environment/v3/cors"
-H "Authorization: Bearer <access-token>"
-H "Content-Type: application/json"
--data-raw '{
"data":
{
"origin": "https://<ucsx-host>",
"contactCenterId": "<tenant-uuid>"
}
}'
Validate the provisioning
To check the logs:
kubectl get pods ucsx
kubectl logs <ucsx-addtenant-<tenant-sid>-pod-id>
curl requests
To get a bearer token:
curl -X POST "https://<gauth-auth-url-external>/auth/v3/oauth/token?grant_type=client_credentials&client_id=<gauth-client-id>&client_secret=<gauth-client-secret>"
To get a cluster version:
curl --request POST http://<ucsx-host>/ucs/v3/rest/request/get-version -H "Authorization: Bearer <access-token>" -H "Content-Type: application/json"
To get the tenant information:
curl -X GET http://<ucsx-host>/ucs/v3/config/tenants -H "Authorization: Bearer <access-token>" -H 'Content-Type: application/json'
To show the tenant information using the cmxctl command from the ucsx pod:
cmxctrl -g <access-token> info <tenant-uuid>
Managing Tenants
To unregister a tenant:
helm install ucsx-addtenant-<tenant-sid> ucsxhelmrepo/ucsx-addtenant --version=<chart-version> --namespace=ucsx --wait --timeout 300s --set command=unregister_ucsx_tenant -f values-override.yaml
To uninstall a Helm chart:
helm uninstall ucsx-addtenant-<tenant-sid> --namespace=ucsx
To delete a tenant usingthe cmxctl command from the ucsx pod:
cmxctrl rm -g <access-token> <tenant-uuid>