Hello world using persistent storage
Prerequisites
To run this onboarding tutorial, we should first have:
- a k8saas cluster deployed
info
To ask and set up your own cluster, look at the section Getting Started.
And downloaded the following file:
Tutorial
The application is a simple ubuntu container with a persistent volume mounted on path /mnt/dst.
Get your credentials
note
The cluster name and the resource group name are the same within k8saas.
az aks get-credentials --name "$K8SAAS_RESOURCE_NAME" --resource-group "$K8SAAS_RESOURCE_NAME"
kubelogin convert-kubeconfig -l azurecli
Deploy the application
Deploy the application, composed of :
- a kubernetes Deployment object: which spin up the application pod (container) and make sure it's up and running at all time;
- a kubernetes PersistentVolumeClaim object: which bind the mounted path to the kubernetes PersistentVolume object, dynamically created by Azure.
tip
The PersistentVolumeClaim object specify the requested size, and Azure dynamically creates a kubernetes PersistentVolume object and the corresponding Azure Storage Account.
Using the following command:
kubectl apply -f aks-helloworld-pvc.yaml --namespace customer-namespaces
Remove your test
kubectl delete -f aks-helloworld-pvc.yaml --namespace customer-namespaces