Walkthrough: Adding Tenant Service module to Sitecore in Azure Kubernetes Service
You can add Data Exchange Framework (DEF) Tenant Service (TS) to a container environement in Azure Kubernetes Service (AKS).
For AKS deployments, the preferrred URLs for TS connection strings are:
host=http://cm.default.svc.cluster.local;
auth endpoint=http://id.default.svc.cluster.local/This walkthrough describes how to:
-
Prepare files and folders for deployment.
-
Deploy the AKS containers using kubectl commands..
Prepare files and folders for deployment
To prepare files and folders in your Kubernetes installation for deployment:
-
Download the Sitecore Experience Platform (SXP) container deployment package from the Sitecore download page. Extract the package and save it, with the folder structure intact, in a temporary folder on your local machine.
-
Download the DEF-TS container deployment package from the Sitecore download page. Extract it to your local workstation with the folder structure intact.
-
In the DEF-TS container deployment folder, copy the
def-ts\k8s\ltsc2019\overrides\<topology>folder to the clipboard. -
In the Sitecore Experience Platform (SXP) container deployment package, navigate to the
K8s\<version>\overridesfolder, and paste in thedef-ts\k8s\ltsc2019\overrides\<topology>folder (from the clipboard) asts-<topology>(at the same level as thedef topologyfolder). -
In the SXP container deployment package, in the
overrides\ts-<topology>\ingress-nginxfolder, locate thekustomization.yamlfile. Make sure that parameters in thebases:section are overlays with the Sitecore SXPingress-nginxfolder for your installation, for example,../../../xp1/ingress-nginx. -
In the SXP container deployment package, in each of the
overrides\ts-<topology>andoverrides\ts-<topology>\secretsfolders, locate thekustomization.yamlfile. In each file, make sure that parameters in thebasessection are overlays with the Sitecore DEFoverridesfolder respectively for your installation, for example,../xp1.NoteParameters in the
bases:section contain the placement of the original Sitecore container deployment files or Sitecore DEF deployment files that thekustomization.yamlfiles override. -
In the
overrides\ts-<topology>\kustomization.yamlfile, in theimages:section, make sure thenewNameandnewTagparameters have the appropriate values for the TS images. -
In the
overrides\ts-<topology>\secretsfolder, open thetenant-service-sitecore-connection.txtfile and update the connection string details. The file contains an example of how the connection string should look. -
In the
overrides\ts-<topology>\secrets\tls\global-tsfolder, add the TLS certificatestsl.crtandtls.keyfor thets.globalhosthost. To add HTTP/TLS certificates for the Tenant Service, see the Installation Guide for Production Environment with Kubernetes guide.
Deploy the AKS containers
Before you deploy the containers to Kubernetes, you must prepare the AKS cluster configuration and deploy the ingress controller. For information on how to do this, see the Installation Guide for Production Environment for Kubernetes which is available on the Sitecore download page.
To deploy the container and the necessary Kubernetes components:
-
Open the Windows console, and navigate to the
k8s\<version>folder. -
Deploy the secrets. Use this command:
RequestResponsekubectl apply -k ./overrides/ts-<topology>/secrets/ -
Run the
ingressfolder. Use this command:RequestResponsekubectl apply -k ./overrides/ts-<topology>/ingress-nginx/ -
Run the
externalfolder. Use this command:RequestResponsekubectl apply -k ./<topology>/external/ -
Wait for all containers to have the status Ok/Running. You can check the status with this command:
RequestResponsekubectl get pods -o wide -
Run the
initfolder. Use this command:RequestResponsekubectl apply -k ./<topology>/init/ -
Wait for all containers to have the status Completed. You can check the status with this command:
RequestResponsekubectl get pods -
To create persistent volumes, run this command:
RequestResponsekubectl apply -f ./<topology>/volumes/azurefile -
Run the Sitecore containers with the SFCRM changes. Use this command:
RequestResponsekubectl apply -k ./overrides/ts-<topology>/ -
Wait for all containers to have the status Ok/Running. You can check the status with the
kubectl get podscommand. Obtain the external IP address by using this command:RequestResponsekubectl get service -l app=nginx-ingress -
Update the local host file with the external IP address. For information on how to do this, see the Installation Guide for Production Environment for Kubernetes, which is available on the Sitecore download page.
-
To check that the service is running, open a browser, and browse to
https:\\ts.globalhost.NoteIf you get a Your connection isn't private response, click Advanced, then click Continue to ts.globalhost (unsafe) to continue.