Step 2: Set up the primary and replica clusters on AKS
The second step of the disaster recovery setup for the Data Center Edition (DCE) on Kubernetes consists in setting up the primary and replica clusters.
The setup instructions are based on a Disaster recovery architecture example with Azure resources.
Requirements on AKS clusters
The only requirement for the AKS clusters creation step is to create the primary and replica clusters in different geographical regions.
Default networking (Azure CNI Overlay) and storage settings are supported and capable of hosting a SonarQube DCE instance using the Helm chart provided by Sonar.
Sizing of the clusters is outside the scope of this section.
Step 1: Deploy your DCE on AKS
You must set in the Helm chart the access to the PostgreSQL Virtual Writer endpoint as follows:
1. Modify the Helm chart for each cluster to add the JDBC URL with the Database Virtual Writer Endpoint as follows (see Customizing the DCE Helm chart):
jdbcOverwrite:
enabled: true
jdbcPassword: <somepassword>
jdbcUrl: jdbc:postgresql://yourVirtualWriterEndpoint:5432/yourDB
jdbcUsername: <dbUserName>
Deploy the two clusters following the instructions on the Installing the DCE Helm chart page.
Once the clusters are deployed, keep only the primary cluster up and stop the replica cluster as it could create conflicts.
Step 2: Set up the Azure managed NGINX ingress controllers
You must create an ingress for each one of your clusters, primary and replica. These ingresses will be configured as origins for the Azure Front Door’s origin group.
For each cluster:
1. Enable Application Routing using Azure CLI on your AKS cluster as follows.
az aks approuting enable --resource-group <ResourceGroupName> --name <ClusterName>
Configure Kubectl to connect to your AKS cluster as follows.
az aks get-credentials --resource-group <ResourceGroupName> --name <ClusterName>
Create the Ingress object. Copy the following YAML file into a new file named
ingress.yaml
and save it to your computer. If you used a namespace when deploying your SonarQube Server, it should be added to the metadata section.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sonarqube-dce
namespace: sonarqube-dce
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 120m
spec:
ingressClassName: webapprouting.kubernetes.azure.com
rules:
- http:
paths:
- backend:
service:
name: sonarqube-dce-sonarqube-dce
port:
number: 9000
path: /
pathType: Prefix
Create the ingress with the
kubectl
apply command (using a namespace is optional) as follows.
kubectl apply -f ingress.yaml -n <yourNameSpace>
Verify the Ingress was created as follows.
kubectl get ingress -n <yourNameSpace>
Related pages
Last updated
Was this helpful?