In a previous blog post I outlined the steps to run Micro Focus Enterprise Server 4.0 in a Docker Container. As a follow up to that, I’d like to show you how to take it one step further and deploy that Docker image you created to Azure Kubernetes Service (AKS).
Azure Kubernetes service is a managed orchestration service based on Kubernetes. It allows you to deploy, scale and managed Docker Containers (and other container-based applications) across a cluster of container host.
This will be a 3-step process. You will need to:
This will allow you to scale-out (and scale-down) your Mainframe Modernization workloads in Azure taking true advantage of the Cloud platform.
Ready, let’s get started.
Create the Azure Container Registry
From the Azure Portal, select Create a Resource in the top left corner. From the Marketplace Dashboard, select Containers then Container Registry. This will take you to the Create container registry pane where you will need to fill in the Registry Name, Azure Subscription, Resource Group and Azure Region. The Registry Name needs resolve so it should be unique. Select the Resource Group you used from the previous blog and the same corresponding Region. Select Enable for Admin User and Basic for the SKU. Once you have everything filled in click the Create button the bottom.
After the Registry has been deployed, click the Go to Resource button. This will take you to the main blade for the Container Registry. A nice feature here is the Quick Start menu option. Select it and you will see instructions for what needs to be done to Push and Pull images to and from the Registry. Let’s go though these:
Before we leave the portal, we need to get the credentials for the registry so we can log in. Exit out of the Quick Start blade and select Access Keys from the Registry Menu. Copy the Username and one of the Passwords (there are 2) to the clipboard or notepad. You will need them later to login.
Now that you know what needs to be done, log into the VM.
RDP to the Virtual Machine you used to create the Docker image.
Since you already created the Docker image on a Windows 2016 Server, we need to log into that VM. From this VM, we will push the image to the Container Registry we just created. Navigate to the VM in the Azure Portal then select Overview and then Connect. This will allow you to connect to the VM via RDP. You will need to use the credentials from when you created the VM.
Login and push the image to the registry
Once you have logged in, open a Command Prompt and initiate the following Docker commands:
Now go back to the Azure Portal , specifically to the Repository. In the menu for the Repository select Repositories and you should see es-acctdemo listed. Now we need to create the AKS Cluster.
Create the Azure Kubernetes (AKS) Cluster
From the Portal, select Create a resource and then Containers / Kubernetes Service from the Marketplace menu. Next, you will need to fill out the Create Kubernetes cluster blade. Be sure to keep the cluster in the same region and Resource Group we have been using. You can accept the rest of the defaults, except for the Node count which only needs to be 1. When you are done click the Review + Create button.
When complete, the deploy will place the Kubernetes Service artifacts in the Resource Group you selected on the blade. However, the actual Cluster will have its own resource group created during the deployment. If you select Resource groups from the menu on the left, you will be able to find it based on the naming convention. Here’s an image of mine – it’s the last one in the list.
Run the Image
Now it’s time to pull the image and run it in AKS. The easiest way to do this from the Azure Portal is to use the Cloud Shell. You will find the icon at the top right of the Portal. Note for this walkthrough, I will be using the Bash shell.
Once the shell has loaded. Type the following command
kubectl run es-acctdemo --image acrmf40.azurecr.io/es-acctdemo --port=9040
This pulls the image from the acrmf40.azurecr.io Repository and loads it into AKS. It then runs it with port 9040 open. You may recall that that was the port we had open for our Docker image. We will need that to access Enterprise Server.
Kubernetes should respond with the message that the deployment was created.
To see if the Container is actually running , type in.
kubectl get pods
You should see es-acctdemo as a running pod as in the image below.
Congratulations, you are now running Enterprise Server in Azure Kubernetes Service. In the next blog we will look at how to access the Enterprise Server Administrative Console and also how to we can leverage Kubernetes to scale out your deployment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.