Nestor Abad
ServiceNow Employee
ServiceNow Employee

This guide describes the process for creating ECR repository and EKS cluster for the deployment of a containerized MID Server in AWS.

 

For the process, we use the following tools:

We will need an AWS IAM user with the right permissions to manage all the resources that are required for the deployment of the MID Server in AWS 

 

Open a terminal and type: 

 

 

 

aws configure 

 

 

 

This will let you configure your terminal credentials and region. We will define as region the region where we plan to deploy our resources (eu-central-1 in our case) 

 

NestorAbad_0-1682951452217.png

 

To check that you have successfully added the credentials test them with command: 

 

 

 

 

aws sts get-caller-identity 

 

 

 

 

 

MID Server configurations in ServiceNow instance 

We need to create an account in the ServiceNow instance to allow the MID Server to communicate with the instance securely.  

 

In our ServiceNow instance, we navigate to ITOM Guided Setup -->MID Server -->Create MID User-->Configure 

NestorAbad_1-1682951526460.png

 

Take a note of the credentials, since they will later be required. 

 

Creation of Elastic Container Registry (ECR) in AWS

In our case, we will use AWS ECR to create a private repository where we will be able to push our MID Server image. 

 

Inside AWS, navigate to Elastic Container Registry and click on Create Repository. 

Set the Visibility Setting to Private and give it a name. 

 

NestorAbad_2-1682951590611.png

 

 

Creation of an Elastic Kubernetes Service (EKS) cluster  

In order to run our image, we need a host to deploy it. We are going to use AWS Elastic Kubernetes Service for that purpose.

 

In order to deploy our image, we will need a cluster, that will have some nodes which will execute the workloads that we deploy. There are many ways of creating and configuring EKS clusters.  

 

Note in this guide we use a simple example, but depending on the requirements, it is also possible to customize the cluster and nodes further. 

 

We are going to create a EKS cluster using yaml files from the terminal. We first need to create a new file with yaml extension. 

 

Open the file with a text or code editor.  

 

 

 

apiVersion: eksctl.io/v1alpha5 
kind: ClusterConfig 
metadata: 
  name: containerized-mid-server-cluster 
  region: eu-central-1 
nodeGroups: 
  - name: containerized-mid-server-cluster-public-workers 
    instanceType: t2.medium 
    desiredCapacity: 2 

 

 

From the code above, the parameters are as follows: 

  • KindClusterConfig, states our file will create a cluster 
  • Metadata – name : is the name we will give to our cluster 
  • Metadata – region: the region where we will create our cluster.
  • nodeGroups: This section is used to define the managed node groups that will be part of the cluster. Nodegroups can be widely customized, in our exercise we will use a single nodegroup with 2 t2.medium nodes.  
  • nodeGroups – name: is the name we will give to our node group. 
  • nodeGroups  - instanceType: defines the type of AWS EC2 instances we will use for our nodes. We will use t2.medium, to ensure we have enough resources, but you can always change this value, as long as the instances have the required resources available to run the MID Server. 
  • nodeGroups  - desiredCapacity : defines the desired amount of nodes in the node group. 

 

Populate your cluster creation file, save it, then open a terminal and run the following command (pointing to the newly created file):

 

 

 

 eksctl create cluster -f cluster_creation_file.yaml --kubeconfig=~/.kube/config 

 

 

The command execution takes around 10-15 minutes. 

We can run the following command to validate the correct creation and status of the nodes in the cluster. 

 

 

 

kubectl get nodes -o wide

 

 

 

NestorAbad_9-1682952214247.png

 

By executing the steps above, you should have already an ECR Repository and an EKS Cluster ready for the deployment of the containerized mid server.

 

 

 

 

See the Containerized MID Server series:

 

 

References

ServiceNow documentation: Containerized MID Server 

Docker CLI

EKSCTL CLI

AWS Cloudformation 

Version history
Last update:
‎06-05-2023 01:37 AM
Updated by:
Contributors