Run Universal Messaging on Azure using Azure Kubernetes Service - Sample Kubernetes YAML included
Tags: azure, cloud, kubernetes, tutorial
Published: 2021-05-27 08:28:12

---
title: Run Universal Messaging on Azure using Azure Kubernetes Service - Sample Kubernetes YAML included
published: true
date: 2021-05-18 11:26:24 UTC
tags: #azure, #cloud, #kubernetes, #tutorial
canonical_url: https://tech.forums.softwareag.com/t/run-universal-messaging-on-azure-using-azure-kubernetes-service-sample-kubernetes-yaml-included/241448
---

This post provides brief steps, on how to launch a UM 10.5 server as container on Azure cloud env using Azure Kubernetes Services. I have also provided some sample commands / k8s YAML files , which can help you start and get running quickly . This article presumes, that you have some knowledge about Kubernetes, Azure, Docker, Universal Messaging, AZ CLI and Kubectl. This knowledge might help you to understand, behind the scenes operations that is happening.

**Pre-requisites:**

1. You should have kubectl, Azure CLI & Universal Messaging Enterprise Manager installed on your workstation. This is needed for you, to be able to issue commands to Azure K8s using command line and connect to UM via EM, once it is up.
2. Your workstation should have access to Azure portal and you should have an active Azure subscription as well, with the right privileges. This is needed for you , to be able to create/update resources on Azure .
3. You should also have an active docker hub account, to be able to pull UM image from docker hub.

**Important Notes:**

1. This article just gives us the bare minimum kick-start process, of how to do it. For an actual setup, many things needs to considered in terms of : persistent volumes for persisting data, logs, channels etc. Also, it must be looked upon from security perspective. I will try to write more articles / complement this article; on how to add channels, persistent volumes for logs/data directory, creating JMS assets, Connection Factories, setting A/P setup, setting up a DevOps process for this etc.
2. Also, if you are doing this POC on Azure, please remember that azure resources are chargeable and hence this can lead to monetary charges on your azure account . Please ensure to keep track of the consumption of Azure resources, and do the needful to keep the cost in check.
3. The POC I have done is based on my knowledge of the Azure , K8s and UM and doesn’t necessarily say/recommend anything about the best possible way, or the best practices prescribed for doing it.

**STEPS:**

1. Create a Kubernetes cluster on MS Azure. I have created a single node cluster in this example. Please see below. You can use azure portal on browser to do this activity. You can see this link for guidance on setting up a K8s cluster in Azure : [Quickstart: Deploy an AKS cluster by using the Azure portal - Azure Kubernetes Service | Microsoft Docs](https://docs.microsoft.com/en-us/azure/aks/kubernetes-walkthrough-portal).
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/7/0/704049ab9d0c589932e6300a117491c326d370f1_2_690x295.png)
1. Login to your azure account using below command from command prompt. I have used a windows workstation. Normally the command would open a browser window, and will ask you to enter your azure account credentials and then you should get logged in. But, If you get below message, it’s probably because you have MFA enabled for your azure account. If you see this , use step 3 & 4 to login . But if you don’t get below message and then you will get screen as shown in step 4 below, and you can directly move on to step 5.
**Command** : az login
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/5/7/57fa87dc363b057bee8303af0e14e72d3f9e419f_2_690x81.png)
1. Get your azure AD tenant ID mentioned in the above screenshot from your Azure portal account. It can be found at below place.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/6/b/6b0eefd2c458d2501d35de15ee1df96b006589c6_2_690x335.png)
1. Use below command if you saw the message for using tenant ID in step 3 . This will open the Azure login page on your default browser; and then you will be prompted to enter username, password and the MFA option (text message , approve on authenticator app etc.) to complete the sign in process. Once you get below output, it means you have successfully logged in.  
**Command**  **:** az login – tenant 
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/7/e/7e719a7588fd4d77551777760bb8e1fb56eece80_2_690x261.png)
1. Connect to your Azure K8s instance from command prompt. Please see below to see instructions on how to connect. Run the two commands shown below. az account set and az aks get credentials. These two commands should be run one after the another, in the order mentioned in screenshot. This step will connect you, to your AKS cluster running on azure.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/9/2/92fe447b618bee074ce46c95900c62954cdc992f_2_690x309.jpeg)
**For eg:**
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/5/7/57993a06aadbc42843d45fb63d7306da86315ec7.png)
1. Create a secret, for you to be able to use later, in pulling the UM docker image from docker hub registry.
**Command :** kubectl create secret docker-registry regcred --docker-server= --docker-username= --docker-password= --docker-email=
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/0/e/0e6bfd7de98779e1acecc5e10198133187b25a29_2_690x34.png)
1. Verify that secret has been created successfully using below command.
**Command :** kubectl get secret
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/3/7/370b77d61f77b70a4c4edb6fae6adb9dbc6aaa79_2_690x96.png)
1. Create the static public IP that will be used to expose the UM server to external clients. This IP will be assigned to the Load Balancer service, that we will create in later steps. Sample command given below.
**Command:** az network public-ip create --resource-group POC-C --region centralindia --name myAKSPublicIP --sku Standard --allocation-method static
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/f/2/f2be8772206326c84fa47c8c579e856f383045d6_2_690x260.png)
1. Get the IP address created in step 8 using below command. Note down this IP. This will be used in later steps.
**Command :** az network public-ip show --resource-group POC-C --name myAKSPublicIP --query ipAddress --output tsv .
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/6/0/60480b3bd7b5a30a842f923bcc679829a50a4527_2_690x46.png)
1. Before creating a Load Balancer service, we need to ensure, that the cluster identity used by the AKS cluster, has the needed permissions to the resource group; so that it can perform the relevant operations related to networking. Follow below command to provide that access to the AKS cluster.
**Sample command format:** az role assignment create --assignee --role “Network Contributor” --scope /subscriptions//resourceGroups/
**Sample command:** az role assignment create --assignee c3d83af8-0f94-4af4-8702-9abcbd3ae0f6 --role “Network Contributor” --scope /subscriptions/1af1b6a2-5fa0-45fd-816c-959db4e487bd/resourceGroups/POC-C
Here Client ID is of the AKS cluster and POC-C is my resource group name. 1af1b6a2-5fa0-45fd-816c-959db4e487bd is my subscription ID.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/f/f/ff00456e15fe0b9bb9b029c514982b407bda3518_2_690x127.png)
1. Create the sample deployment YAML file , um-server.yml. This will be used to launch the UM POD (container). Keep it in the location , where kubectl.exe is present, so that you can refer to this file easily, when using kubectl command.
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/6/2/62ef071955c5f6b776b175a38076d3ab39ccad99.png)
1. Create the sample Load Balancer YAML file, um-server-LB-port.yml. This will be used to create the Load Balancer service. Please ensure to put the same IP below, that you got in above steps 8 & 9. Keep this file in the location where kubectl.exe is present, so that you can refer to this file easily when using kubectl command.
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/f/f/ffdfd9992273ab9def84de7f19e57a7cb20a1f13.png)
1. Use kubectl apply -f command to launch the UM pods. Here um-server.yml file is the YAML file we created in step 11. Use kubectl get pods commands to see, whether the UM is finally up and running. You can notice the READY column and STATUS column to determine.
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/5/7/577542e197381049e7741c984efbe8a038041db8.png)
1. Use the kubectl apply -f command the launch the Load Balancer svc. Here um-server-LB-port.yml is the YAML file we created in step 12 for the Load Balancer service. Use kubectl describe svc command, to see if the LB svc has been created successfully. If it is successfully created, then you will be able to see the EXTERNAL IP assigned to the svc.
![image](https://aws1.discourse-cdn.com/techcommunity/original/3X/0/5/05c59212ec14b772df7f74f7caf722b7f9ef440a.png)
1. Use the external IP to connect to the UM via Enterprise Manager.
![image](https://aws1.discourse-cdn.com/techcommunity/optimized/3X/7/2/7269bd2d860580c93ba96ef899f09938c2aecd63_2_690x256.png)

**Conclusion:**

So we saw in above steps, how to quickly spin up a UM container on Microsoft Azure using Azure Kubernetes Services. We were also able to connect to the UM using our EM. Hope this articles helps you to quickly get started, and provide you the very first steps on how to do it.

I will keep adding more to this topic in future. Thanks for reading.

**Glossary:**

1. K8s : Kubernetes
2. LB : Load Balancer
3. Azure : Microsoft Azure Public Cloud
4. Env : environment
5. UM : Universal Messaging
6. Svc : Service
7. EM : Enterprise Manager
8. AZ CLI : Azure Command Line Interface
9. A/P : Active Passive

[Read full topic](https://tech.forums.softwareag.com/t/run-universal-messaging-on-azure-using-azure-kubernetes-service-sample-kubernetes-yaml-included/241448)