Orchestrating Secure Management Access in InterSystems IRIS with AWS EKS and ALB
Tags: aws, cloud, tutorial, programming
Published: 2024-05-14 16:18:12

<p>As an IT and cloud team manager with 18 years of experience with InterSystems technologies, I recently led our team in the transformation of our traditional on-premises ERP system to a cloud-based solution. We embarked on deploying InterSystems IRIS within a Kubernetes environment on AWS EKS, aiming to achieve a scalable, performant, and secure system. Central to this endeavor was the utilization of the AWS Application Load Balancer (ALB) as our ingress controller.&nbsp;</p>
<p>However, our challenge extended beyond the initial cluster and application deployment; we needed to establish an efficient and secure method to manage the various IRIS instances, particularly when employing mirroring for high availability.</p>
<p>This post will focus on the centralized management solution we implemented to address this challenge. By leveraging the capabilities of AWS EKS and ALB, we developed a robust architecture that allowed us to effectively manage and monitor the IRIS cluster, ensuring seamless accessibility and maintaining the highest levels of security.&nbsp;</p>
<p>In the following sections, we will delve into the technical details of our implementation, sharing the strategies and best practices we employed to overcome the complexities of managing a distributed IRIS environment on AWS EKS. Through this post, we aim to provide valuable insights and guidance to assist others facing similar challenges in their cloud migration journeys with InterSystems technologies.</p>
<p><strong>Configuration Summary</strong> Our configuration capitalized on the scalability of AWS EKS, the automation of the InterSystems Kubernetes Operator (IKO) 3.6, and the routing proficiency of AWS ALB. This combination provided a robust and agile environment for our ERP system's web services.</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hrsq8hghqwf0r5c7cm6v.png)
<p><strong>Mirroring Configuration and Management Access</strong> We deployed mirrored IRIS data servers to ensure high availability. These servers, alongside a single application server, were each equipped with a Web Gateway sidecar pod. Establishing secure access to these management portals was paramount, achieved by meticulous network and service configuration.</p>
<p><strong>Detailed Configuration Steps</strong></p>
<p><strong>Initial Deployment with IKO:</strong></p>
<ul>
<li>We leveraged&nbsp;IKO 3.6, we deployed the IRIS instances, ensuring they adhered to our high-availability requirements.</li>
</ul>
<p><strong>Web Gateway Management Configuration:</strong></p>
<ul>
<li index="0">We create server access profiles within the Web Gateway Management interface. These profiles, named&nbsp;<code>data00</code>&nbsp;and&nbsp;<code>data01</code>, were crucial in establishing direct and secure connectivity to the respective Web Gateway sidecar pods associated with each IRIS data server.</li>
<li index="1">To achieve precise routing of incoming traffic to the appropriate Web Gateway, we utilized the DNS pod names of the IRIS data servers. By configuring the server access profiles with the fully qualified DNS pod names, such as&nbsp;<code>iris-svc.app.data-0.svc.cluster.local</code>&nbsp;and&nbsp;<code>iris-svc.app.data-1.svc.cluster.local</code>, we ensured that requests were accurately directed to the designated Web Gateway sidecar pods.</li>
</ul>
<p>https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GCGI_config_serv</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kr2e2wvnmzwqesz9aasj.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c91wrbt7dn8i3qj48e18.png)
<p><strong>IRIS Terminal Commands:</strong></p>
<ul>
<li>To align the CSP settings with the newly created server profiles, we executed the following commands in the IRIS terminal:
<ul>
<li><code>d $System.CSP.SetConfig("CSPConfigName","data00") # on data00 </code></li>
<li><code>d $System.CSP.SetConfig("CSPConfigName","data01") # on data01 </code></li>
</ul></li>
</ul>
<p>https://docs.intersystems.com/healthconnectlatest/csp/docbook/DocBook.UI.Page.cls?KEY=GCGI_remote_csp</p>
<p><strong>NGINX&nbsp;Configuration:</strong></p>
<ul>
<li>The NGINX configuration was updated to respond to <code>/data00</code> and <code>/data01</code> paths, followed by creating Kubernetes services and ingress resources that interfaced with the AWS ALB, completing our secure and unified access solution.</li>
</ul>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0dfpz7q61qw3lvtj91ma.png)
<p><strong>Creating Kubernetes Services:</strong></p>
<ul>
<li>I initiated the setup by creating Kubernetes services for the IRIS data servers and the SAM:</li>
</ul>
<p>&nbsp;</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ew5jeywcplos2vzfiirv.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ot5z70hlxsy44pylhrma.png)
<p><strong>Ingress Resource Definition:</strong></p>
<ul>
<li>Next, I defined the ingress resources, which route traffic to the appropriate paths using annotations to secure and manage access.</li>
</ul>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9lgbyv96pez8l91xbczn.png)
<p>Explanations for the Annotations in the Ingress YAML Configuration:</p>
<ul depth="0">
<li index="0"><code>alb.ingress.kubernetes.io/scheme: internal</code>
<ul depth="1">
<li index="0">Specifies that the Application Load Balancer should be internal, not accessible from the internet.</li>
<li index="1">This ensures that the ALB is only reachable within the private network and not exposed publicly.</li>
</ul></li>
<li index="1"><code>alb.ingress.kubernetes.io/subnets: subnet-internal, subnet-internal</code>
<ul depth="1">
<li index="0">Specifies the subnets where the Application Load Balancer should be provisioned.</li>
<li index="1">In this case, the ALB will be deployed in the specified internal subnets, ensuring it is not accessible from the public internet.</li>
</ul></li>
<li index="2"><code>alb.ingress.kubernetes.io/target-type: ip</code>
<ul depth="1">
<li index="0">Specifies that the target type for the Application Load Balancer should be IP-based.</li>
<li index="1">This means that the ALB will route traffic directly to the IP addresses of the pods, rather than using instance IDs or other target types.</li>
</ul></li>
<li index="3"><code>alb.ingress.kubernetes.io/target-group-attributes: stickiness.enabled=true</code>
<ul depth="1">
<li index="0">Enables sticky sessions (session affinity) for the target group.</li>
<li index="1">When enabled, the ALB will ensure that requests from the same client are consistently routed to the same target pod, maintaining session persistence.</li>
</ul></li>
<li index="4"><code>alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS": 443}]'</code>
<ul depth="1">
<li index="0">Specifies the ports and protocols that the Application Load Balancer should listen on.</li>
<li index="1">In this case, the ALB is configured to listen for HTTPS traffic on port 443.</li>
</ul></li>
<li index="5"><code>alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:il-</code>
<ul depth="1">
<li index="0">Specifies the Amazon Resource Name (ARN) of the SSL/TLS certificate to use for HTTPS traffic.</li>
<li index="1">The ARN points to a certificate stored in AWS Certificate Manager (ACM), which will be used to terminate SSL/TLS connections at the ALB.</li>
</ul></li>
</ul>
<p>These annotations provide fine-grained control over the behavior and configuration of the AWS Application Load Balancer when used as an ingress controller in a Kubernetes cluster. They allow you to customize the ALB's networking, security, and routing settings to suit your specific requirements.</p>
<p>After configuring the NGINX with location settings to respond to the paths for our data servers, the final step was to extend this setup to include the SAM by defining its service and adding the route in the ingress file.</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eda8nthpx3kg1ch1xydt.png)
<p><strong>Security Considerations:&nbsp;</strong>We meticulously aligned our approach with cloud security best practices, particularly the principle of least privilege, ensuring that only necessary access rights are granted to perform a task.</p>
<p>DATA00:</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0jcwxdsdxqi7ujq9vxpf.png)

<p>DATA01:</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iw32fxcbu2pm3lgt8n6y.png)
<p>SAM:</p>

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xgk6qtue9dzqo7p3rwpp.png)
<p><strong>Conclusion:&nbsp;</strong></p>
<p>This article shared our journey of migrating our application to the cloud using InterSystems IRIS on AWS EKS, focusing on creating a centralized, accessible, and secure management solution for the IRIS cluster. By leveraging security best practices and innovative approaches, we achieved a scalable and highly available architecture.</p>
<p>We hope that the insights and techniques shared in this article prove valuable to those embarking on their own cloud migration projects with InterSystems IRIS. If you apply these concepts to your work, we'd be interested to learn about your experiences and any lessons you discover throughout the process</p>