This article describes how to add the Sitecore Experience Accelerator (SXA) module to the following environments that use Sitecore Hosted Solr (SHS):
SXA requires customized Content Management, Content Delivery, and Microsoft SQL initialization images. These images must be created, pushed to the appropriate Azure Container Registry (ACR), and configured in the Application repository. The mssql-init-sxa-spe job must then be run to deploy the SXA and Sitecore PowerShell Extensions (SPE) database resources.
Note: Adjust the Sitecore topology and version references as required. The examples in the source procedure use an XM topology with Sitecore version 10.2.0.
Refer to the Sitecore documentation about adding Sitecore modules for information about creating customized SXA module.
To work with SXA, create the following images:
In PowerShell, run the docker push command to push all images to the pre-provisioned Azure Container Registry (ACR):
{infrastructure_id}acr
In the Application repository, find the config/docker-images/docker-images.json file and update it:
{
"sitecore": {
"cm": "<infrastructure_id>acr.azurecr.io/cm-sxa-spe:10.2-ltsc2022",
"cd": "<infrastructure_id>acr.azurecr.io/cd-sxa-spe:10.2-ltsc2022",
"id": "scr.sitecore.com/sxp/sitecore-id6:10.2-ltsc2022",
"mssql_init_sxa_spe": "<infrastructure_id>acr.azurecr.io/mssql-init-sxa-spe:10.2-ltsc2022"
},
"external": {
"windowsservercore": "mcr.microsoft.com/powershell:lts-windowsservercore-ltsc2022"
}
}
To run the mssql-init-sxa-spe container:
---
apiVersion: batch/v1
kind: Job
metadata:
name: sxa-spe-mssql-init
spec:
template:
spec:
nodeSelector:
kubernetes.io/os: windows
imagePullSecrets:
- name: sitecore-docker-registry
containers:
- name: mssql-init
image: "{{ docker_images.sitecore.mssql_init_sxa_spe }}"
env:
- name: sitecore_admin_password
valueFrom:
secretKeyRef:
name: sitecore-admin
key: sitecore-adminpassword.txt
- name: SQL_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: sitecore-database
key: sitecore-databasepassword.txt
- name: SQL_ADMIN_LOGIN
valueFrom:
secretKeyRef:
name: sitecore-database
key: sitecore-databaseusername.txt
- name: SQL_SERVER
valueFrom:
secretKeyRef:
name: sitecore-database
key: sitecore-databaseservername.txt
- name: SQL_ELASTIC_POOL_NAME
valueFrom:
secretKeyRef:
name: sitecore-database
key: sitecore-database-elastic-pool-name.txt
- name: DATABASES_TO_DEPLOY
value: spe,sxa
restartPolicy: Never
backoffLimit: 5
- name: Execute sxa-spe mssql-init jobs
k8s:
apply: true
namespace: "{{ solution_id }}"
state: present
definition: "{{ lookup('template', 'mssql-init-sxa-spe.yaml') }}"
- name: 'Wait - SXA-SPE Mssql-init job'
k8s_info:
kind: Job
name: sxa-spe-mssql-init
namespace: "{{ solution_id }}"
register: sxa_spe_mssql_init_result
until: sxa_spe_mssql_init_result.resources | length > 0 and sxa_spe_mssql_init_result.resources[0].status.conditions is defined and sxa_spe_mssql_init_result.resources[0].status.conditions | selectattr('type', 'equalto', 'Complete') | list | length > 0
retries: 60
delay: 60
- name: Get all SXA-SPE Mssql completed pods
k8s_info:
kind: Pod
namespace: "{{ solution_id }}"
label_selectors:
- job-name = sxa-spe-mssql-init
no_log: true
register: sxa_spe_mssql_pod_list
- name: Remove SXA-SPE Mssql job's pods
k8s:
kind: Pod
name: "{{ item.metadata.name }}"
namespace: "{{ solution_id }}"
state: absent
no_log: true
with_items: "{{ sxa_spe_mssql_pod_list.resources }}"
To run the mssql-init-sxa-spe container:
---
apiVersion: batch/v1
kind: Job
metadata:
name: sxa-spe-mssql-init
spec:
template:
spec:
nodeSelector:
kubernetes.io/os: windows
imagePullSecrets:
- name: sitecore-docker-registry
containers:
- name: mssql-init
image: "{{ docker_images.sitecore.mssql_init_sxa_spe }}"
env:
- name: sitecore_admin_password
valueFrom:
secretKeyRef:
name: sitecore-admin
key: sitecore-adminpassword.txt
- name: SQL_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: sitecore-database
key: sitecore-databasepassword.txt
- name: SQL_ADMIN_LOGIN
valueFrom:
secretKeyRef:
name: sitecore-database
key: sitecore-databaseusername.txt
- name: SQL_SERVER
valueFrom:
secretKeyRef:
name: sitecore-database
key: sitecore-databaseservername.txt
- name: SQL_ELASTIC_POOL_NAME
valueFrom:
secretKeyRef:
name: sitecore-database
key: sitecore-database-elastic-pool-name.txt
- name: DATABASES_TO_DEPLOY
value: spe,sxa
restartPolicy: Never
backoffLimit: 5
---
- name: Execute sxa-spe mssql-init jobs
k8s:
apply: true
namespace: "{{ solution_id }}"
state: present
definition: "{{ lookup('template', 'mssql-init-sxa-spe.yaml') }}"
- name: 'Wait - SXA-SPE Mssql-init job'
k8s_info:
kind: Job
name: sxa-spe-mssql-init
namespace: "{{ solution_id }}"
register: sxa_spe_mssql_init_result
until: sxa_spe_mssql_init_result.resources | length > 0 and sxa_spe_mssql_init_result.resources[0].status.conditions is defined and sxa_spe_mssql_init_result.resources[0].status.conditions | selectattr('type', 'equalto', 'Complete') | list | length > 0
retries: 60
delay: 60
- name: Get all SXA-SPE Mssql completed pods
k8s_info:
kind: Pod
namespace: "{{ solution_id }}"
label_selectors:
- job-name = sxa-spe-mssql-init
no_log: true
register: sxa_spe_mssql_pod_list
- name: Remove SXA-SPE Mssql job's pods
k8s:
kind: Pod
name: "{{ item.metadata.name }}"
namespace: "{{ solution_id }}"
state: absent
no_log: true
with_items: "{{ sxa_spe_mssql_pod_list.resources }}"
- name: Execute custom init jobs include_tasks: custom-init.yaml
Refer to the Sitecore documentation about adding Sitecore modules for information about creating customized SXA module.
To work with SXA, create the following images:
In PowerShell, run the docker push command to push all images to the pre-provisioned Azure Container Registry (ACR):
mcc<agreement_id_without_dashes>acr
{
"sitecore": {
"cm": "mcc<agreement_id_without_dashes>acr.azurecr.io/cm-sxa-spe:10.4-ltsc2022",
"cd": "mcc<agreement_id_without_dashes>acr.azurecr.io/cd-sxa-spe:10.4-ltsc2022",
"id": "scr.sitecore.com/sxp/sitecore-identity:8.0-ltsc2022",
"prc": "scr.sitecore.com/sxp/sitecore-xp1-prc:10.4-ltsc2022",
"cortexprocessing": "scr.sitecore.com/sxp/sitecore-xp1-cortexprocessing:10.4-ltsc2022",
"cortexprocessingworker": "scr.sitecore.com/sxp/sitecore-xp1-cortexprocessingworker:10.4-ltsc2022",
"cortexreporting": "scr.sitecore.com/sxp/sitecore-xp1-cortexreporting:10.4-ltsc2022",
"xdbautomation": "scr.sitecore.com/sxp/sitecore-xp1-xdbautomation:10.4-ltsc2022",
"xdbautomationrpt": "scr.sitecore.com/sxp/sitecore-xp1-xdbautomationrpt:10.4-ltsc2022",
"xdbautomationworker": "scr.sitecore.com/sxp/sitecore-xp1-xdbautomationworker:10.4-ltsc2022",
"xdbcollection": "scr.sitecore.com/sxp/sitecore-xp1-xdbcollection:10.4-ltsc2022",
"xdbrefdata": "scr.sitecore.com/sxp/sitecore-xp1-xdbrefdata:10.4-ltsc2022",
"xdbsearch": "scr.sitecore.com/sxp/sitecore-xp1-xdbsearch:10.4-ltsc2022",
"xdbsearchworker": "scr.sitecore.com/sxp/sitecore-xp1-xdbsearchworker:10.4-ltsc2022",
"mssql_init_sxa_spe": "mcc<agreement_id_without_dashes>acr.azurecr.io/mssql-init-sxa-spe:10.4-ltsc2022"
},
"external": {
"windowsservercore": "mcc<agreement_id_without_dashes>acr.azurecr.io/powershell:lts-windowsservercore-ltsc2022",
"redis": "mcc<agreement_id_without_dashes>acr.azurecr.io/library/redis:8.4.0"
}
}
To run the mssql-init-sxa-spe container:
---
apiVersion: batch/v1
kind: Job
metadata:
name: sxa-spe-mssql-init
spec:
template:
spec:
nodeSelector:
kubernetes.io/os: windows
imagePullSecrets:
- name: sitecore-docker-registry
containers:
- name: mssql-init
image: "{{ docker_images.sitecore.mssql_init_sxa_spe }}"
env:
- name: Sql_Database_Prefix
valueFrom:
secretKeyRef:
name: sitecore-database
key: sitecore-databaseprefix.txt
- name: sitecore_admin_password
valueFrom:
secretKeyRef:
name: sitecore-admin
key: sitecore-adminpassword.txt
- name: SQL_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: sitecore-database
key: sitecore-databasepassword.txt
- name: SQL_ADMIN_LOGIN
valueFrom:
secretKeyRef:
name: sitecore-database
key: sitecore-databaseusername.txt
- name: SQL_SERVER
valueFrom:
secretKeyRef:
name: sitecore-database
key: sitecore-databaseservername.txt
- name: SQL_ELASTIC_POOL_NAME
valueFrom:
secretKeyRef:
name: sitecore-database
key: sitecore-database-elastic-pool-name.txt
- name: DATABASES_TO_DEPLOY
value: spe,sxa
restartPolicy: Never
backoffLimit: 5
- name: Execute sxa-spe mssql-init jobs
k8s:
apply: true
namespace: "{{ solution_id }}"
state: present
definition: "{{ lookup('template', 'mssql-init-sxa-spe.yaml') }}"
- name: 'Wait - SXA-SPE Mssql-init job'
k8s_info:
kind: Job
name: sxa-spe-mssql-init
namespace: "{{ solution_id }}"
register: sxa_spe_mssql_init_result
until: sxa_spe_mssql_init_result.resources | length > 0 and sxa_spe_mssql_init_result.resources[0].status.conditions is defined and sxa_spe_mssql_init_result.resources[0].status.conditions | selectattr('type', 'equalto', 'Complete') | list | length > 0
retries: 60
delay: 60
- name: Get all SXA-SPE Mssql completed pods
k8s_info:
kind: Pod
namespace: "{{ solution_id }}"
label_selectors:
- job-name = sxa-spe-mssql-init
no_log: true
register: sxa_spe_mssql_pod_list
- name: Remove SXA-SPE Mssql job's pods
k8s:
kind: Pod
name: "{{ item.metadata.name }}"
namespace: "{{ solution_id }}"
state: absent
no_log: true
with_items: "{{ sxa_spe_mssql_pod_list.resources }}"