Deploying Sitecore 10 to AKS (Azure Kubernetes)

11/11/2020 Sitecore-10 AKS Kubernetes

Here is how I successfully deployed Sitecore 10 to AKS, hope it helps someone.

 

couple of things to you need to do before starting up with the deployment to AKS:

  • Create a resource group in Azure
  • Create an AKS service in that resource group
    • It defaults come with Linux node pool which is used by AKS Control plane, Ingress (Nginx)
    • We need windows pool as Sitecore and SQL need it.
  • Install and setup kubectl 
  • Install Azure CLI 
  • Install Helm
  • Download Sitecore Container deployment package
    • you will see K8S root folder
    • External - Includes SQL, Solr and Redis storage containers. These are not PRD ready yet. 
    • Ingress-nginx - Configuration to setup networking on top of AKS, Node and Pods
    • Init - Initialization scripts to insert data into SQL and build Solr indexes
    • Secrets - All the configurations, database passwords, TLS certificates, Telerik encryption keys, ID certificates present here
      • Make sure to fill these values.
      • License file needs to be base 64 encoded and added to the secret. (3.1 installation document has a script to do this)
      • Identity server tokens can be generated using the script in section 3.3 in the installation guide
      • TLS certificates can be created by using the script in section 3.4

Time to run some scripts now:

PS C:\sitecore\k8s> az account set --subscription 57x-xxxx-xxxx-xxxx-xxxxd4
PS C:\sitecore\\k8s> az aks get-credentials --resource-group {ResourceGroupName} --name {Kubernetes ClusterName}
Merged "{Kubernetes ClusterName}" as current context in C:\Users\demoadmin\.kube\config
PS C:\sitecore\k8s> kubectl apply -k .\secrets\
secret/global-cd-tls configured
secret/global-cm-tls configured
secret/global-id-tls configured
secret/sitecore-admin configured
secret/sitecore-database configured
secret/sitecore-identitycertificate configured
secret/sitecore-identity configured
secret/sitecore-license configured
secret/sitecore-reporting created
secret/sitecore-solr-xdb created
secret/sitecore-solr unchanged
secret/sitecore-telerik configured
PS C:\sitecore\k8s> kubectl apply -f .\external\
service/mssql unchanged
deployment.apps/mssql created
service/redis unchanged
deployment.apps/redis created
service/solr unchanged
deployment.apps/solr created

PS C:\sitecore\k8s> kubectl get pods
NAME                                             READY   STATUS    RESTARTS   AGE
mssql-77559ddddb-mb94p                           1/1     Running   0          28s
nginx-ingress-controller-846fcbbd87-m8vcm        1/1     Running   0          9h
nginx-ingress-default-backend-7c6cd67dbb-nkm8j   1/1     Running   0          9h
redis-7cffc5f8bb-8hjt6                           1/1     Running   0          28s
solr-7ddbcd77dc-b5hn8                            1/1     Running   0          27s
PS C:\sitecore\k8s> kubectl apply -f .\init\
job.batch/mssql-init created
job.batch/solr-init created

PS C:\sitecore\k8s> kubectl get pods
NAME                                             READY   STATUS    RESTARTS   AGE
mssql-77559ddddb-mb94p                           1/1     Running   0          2m9s
mssql-init-kw62q                                 1/1     Running   0          65s
nginx-ingress-controller-846fcbbd87-m8vcm        1/1     Running   0          9h
nginx-ingress-default-backend-7c6cd67dbb-nkm8j   1/1     Running   0          9h
redis-7cffc5f8bb-8hjt6                           1/1     Running   0          2m9s
solr-7ddbcd77dc-b5hn8                            1/1     Running   0          2m8s
solr-init-kprcx                                  1/1     Running   0          65s

PS C:\sitecore\k8s> kubectl apply -f .
service/cd created
deployment.apps/cd created
service/cm created
deployment.apps/cm created
service/cortexprocessing created
deployment.apps/cortexprocessing created
service/cortexprocessingworker created
deployment.apps/cortexprocessingworker created
service/cortexreporting created
deployment.apps/cortexreporting created
service/id created
deployment.apps/id created
service/prc created
deployment.apps/prc created
service/rep created
deployment.apps/rep created
service/xdbautomation created
deployment.apps/xdbautomation created
service/xdbautomationrpt created
deployment.apps/xdbautomationrpt created
service/xdbautomationworker created
deployment.apps/xdbautomationworker created
service/xdbcollection created
deployment.apps/xdbcollection created
service/xdbrefdata created
deployment.apps/xdbrefdata created
service/xdbsearch created
deployment.apps/xdbsearch created
service/xdbsearchworker created
deployment.apps/xdbsearchworker created

 

Update you host file entries with public IP cd.globalhost, cm.globalhost and id.globalhost.

Boom!!!!!!!!! Sitecore in AKS

Let me know if you find any issues.