- AKS cluster
- Azure storage account
- Nginx ingress controller
- Deploy Argo CD in your cluster.
-
Connect with your Microsoft AKS cluster.
-
After connecting with your cluster, deploy the latest Nginx ingress controller to your cluster using the following command.
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.41.2/deploy/static/provider/cloud/deploy.yaml
-
Create a File share instance in your storage account and note the File share name to store the shared folders for application usage.
-
Encode the storage account name and storage key in
base64
format.
For encoding the values to base64 please run the following command in powershell
[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("<plain-text>"))
- Edit the
pvclaim.yaml
inside the manifests folder and replace the base64 encoded storage account name, base64 encoded storage account key, and File share name noted in above steps to<base64_azurestorageaccountname>
,<base64_azurestorageaccountkey>
, and<file_share_name>
places in the file respectively. You can also change the storage size in the YAML file.
-
If you have a DNS to map with the application, then you can continue with the following steps, else skip to Step 5.
-
Edit the ingress.yaml file. Uncomment the host value and replace your DNS hostname with
example.com
and save the file. -
If you have the SSL certificate for your DNS and need to configure the site with your SSL certificate, follow the below step or you can skip to Step 5.
-
Run the following command to create a TLS secret with your SSL certificate.
kubectl create secret tls mediawiki-tls -n mediawiki --key <key-path> --cert <certificate-path>
-
Now, uncomment the
tls
section and replace your DNS hostname withexample.com
in ingress spec and save the file. -
Edit the
mediawiki_deployment.yaml
replace your DNS or ingress IP address in<Host domain or IP>
place. -
Create a namespace in your cluster for Mediawiki deployment.
kubectl create namespace mediawiki
- Run the following command to apply the pvclaim.yaml
kubectl apply -f pvclaim_aks.yaml
Note: You can also modify the mariadb and mediawiki credentials in kustomization.yaml in the
secretGenerator
section
- Open Argo CD in your browser and create a new application. You can find the argocd application manifest in the root of this repository.
-
Copy and paste the yaml content from argocd_application.yaml
-
Click on Create to deploy the application.
-
You can now access Mediawiki with your DNS or Ingress IP address.
Note: To update the applications you can edit the
images
section in kustomization.yaml by changing the image tags of both mariadb and mediawiki and then commit the changes to your repository. I have followedGitOps
principle in this demo.