Skip to content
Category: SQL Server
2019-11-14

☁ Learning to deploy Kubernetes in Azure (2/2)

Hello again!

This post is the continuation of Learning to deploy Kubernetes in Azure (1/2) in which we deploy the necessary resources to use Kubernetes in Azure, if you have not seen this entry which I encourage anybody to read it.

In this post we will learn how to deploy a Kubernetes dashboard to be able to manage it correctly.

The first part will be to open the command console. We open our Azure portal and click on the icon in the upper right.

As it’s not the first time we open it, there is no need to select which subscription will work on, but we will have to take out the credentials of the resource group that we have created previously.

az aks get-credentials –resource-group Kubernetes –name aks-91

Once we have the credentials we go on to create the dashboard:

kubectl create clusterrolebinding kubernetes-dashboard –clusterrole=cluster-admin –serviceaccount=kube-system:kubernetes-dashboard

We create the tunnel that allows us to access the dashboard. In this command we have to configure the name of the resource group, the name of the AKS service and the subscription.

az aks browse –resource-group Kubernetes –name aks-91 –subscription “NombreDeTuSuscripción”

When executing the command, it will open a new window in the browser.

As we have not displayed any images about our service, nothing appears yet. Later we will work with the dashboard.

In the next point we will deploy MySQL and WordPress. For the deployment of the images we must stay in the command console.

We need to create a secret for the MySQL container.

kubectl create secret generic mysql-pass –from-literal=password=”password” -n default

We download the default images from the Kubernetes repository.

curl -LO https://k8s.io/examples/application/wordpress/mysql-deployment.yaml

curl -LO https://k8s.io/examples/application/wordpress/wordpress-deployment.yaml

Now we will deploy the wordpress containers. I have used an official wordpress image, but I have modified it to create 3 persistent volumes and 3 containers linked to them. You have to change the files to link the secret to the files we have created.

nano wordpress-deployment.yaml

We will have to add the name of the secret we created previously.

secretKeyRef:

name: mysql-pass

Now we display the files that are the ones that will create the containers.

kubectl apply -f mysql-deployment.yaml

kubectl apply -f wordpress-deployment.yaml

We must check if what we have done so far is well done, so first we will check the secret we have created.

kubectl get secrets

Now we check the pods.

kubectl get pods

Finally, we check the wordpress service.

kubectl get services wordpress

We will enter the external IP that Azure has given us to install WordPress in our Kubernetes cluster. Now we install the WordPress service.

Once installed we return to the Kubernetes dashboard with the command:

az aks browse –resource-group Kubernetes –name aks-91 –subscription “NombreDeTuSuscripción”

Now we can see the number of containers we have and their names. We already have our service available and with high availability.

Stay tuned to the blog because we will soon publish a proof of concept and new posts about SQL, Azure and Power BI.

Complete este formulario para recibir la guía de Windows Server en Azure
*Obligatorio
Complete este formulario para recibir la guía de Windows Server en Azure
Gracias por rellenar el formulario [name]. ¡Aquí tienes tu eBook Gratis!
Complete este formulario para recibir 4 best practices to implement a comprehensive Zero Trust security approach
*Obligatorio
Complete este formulario para recibir 4 best practices to implement a comprehensive Zero Trust security approach
Gracias por rellenar el formulario [name]. ¡Aquí tienes tu eBook Gratis!
Complete este formulario para recibir Cloud Migration Essentials
*Obligatorio
Complete este formulario para recibir Cloud Migration Essentials
Gracias por rellenar el formulario [name]. ¡Aquí tienes tu eBook Gratis!
Complete este formulario para recibir Cloud security Advice for Nonprofit Leaders
*Obligatorio
Complete este formulario para recibir Cloud security Advice for Nonprofit Leaders
Gracias por rellenar el formulario [name]. ¡Aquí tienes tu eBook Gratis!
Complete este formulario para recibir Prevent data leaks with Microsoft 365 Business Premium
*Obligatorio
Complete este formulario para recibir Prevent data leaks with Microsoft 365 Business Premium
Gracias por rellenar el formulario [name]. ¡Aquí tienes tu eBook Gratis!
Complete this form to recieve the guide of Windows Server on Azure
*Required
Complete this form to recieve the guide of Windows Server on Azure
Thank you for filling out the form [name]. Here's your Free eBook!
Complete this form to recieve 4 best practices to implement a comprehensive Zero Trust security approach
*Required
Complete this form to recieve 4 best practices to implement a comprehensive Zero Trust security approach
Thank you for filling out the form [name]. Here's your Free eBook!
Complete this form to recieve Cloud Migration Essentials
*Required
Complete this form to recieve Cloud Migration Essentials
Thank you for filling out the form [name]. Here's your Free eBook!
Complete this form to recieve Cloud security Advice for Nonprofit Leaders
*Required
Complete este formulario para recibir Cloud security Advice for Nonprofit Leaders
Thank you for filling out the form [name]. Here's your Free eBook!
Complete this form to recieve Prevent data leaks with Microsoft 365 Business Premium
*Obligatorio
Complete this form to recieve Prevent data leaks with Microsoft 365 Business Premium
Thank you for filling out the form [name]. Here's your Free eBook!
Complete this form to recieve Cloud Migration Simplified Ebook.
*Obligatorio
Complete this form to recieve Prevent data leaks with Microsoft 365 Business Premium
Thank you for filling out the form [name]. Here's your Free eBook!