Preparing a Reporting Solution on Amazon EKS with Ingress: A Comprehensive Step-by-Step Guide
Tags: ingress, reporting, amazoneks, boldreports
Published: 2023-09-27 12:54:01

In today’s world, as more individuals embrace containerization and Kubernetes, making sure report servers are set up and managed efficiently has become important. Amazon Elastic Kubernetes Service (EKS) is a helpful service from Amazon that makes it easier to put in place and take care of these Kubernetes clusters.

The Bold Reports Report Server is a powerful and versatile reporting solution that can be deployed on a variety of platforms, including Amazon Elastic Kubernetes Service. With its easy-to-use interface and comprehensive feature set, the Report Server makes it simple to create, manage, and share reports without any coding experience. This deployment method not only enables efficient sharing of key metrics within your organization, but it also allows you to embed reporting into your applications.

In this blog, we will show you how to deploy the Bold Reports Report Server on Amazon Elastic Kubernetes Service with Ingress. This will allow you to deploy a highly scalable and secure report server that can be accessed from anywhere. Let’s get started!

## Prerequisites
To deploy the Report Server on Amazon Elastic Kubernetes Service with Ingress, you need to have the following hardware and software requirements for a smooth process.

## Hardware Requirements
Ensure your machine meets the following hardware requirements:

1. A CPU with two or more cores
2. Memory of at least 4GB of RAM

## Software Requirements
You will need the following:

1. A database like Microsoft SQL Server 2012 or newer, PostgreSQL, or MySQL. Ensure the database is accessible outside the machine.
2. The command-line tools: kubectl and AWS CLI.
3. Web browser like Microsoft Edge, Mozilla Firefox, or Chrome.

## Deployment
In this section, we will walk through how to deploy the Report Server on Amazon Elastic Kubernetes Service with Ingress. Let’s get started with the deployment.

## Step 1: Download the deployment files.
Get the deployment files from the Bold Reports Kubernetes [GitHub repository](https://github.com/boldreports/bold-reports-kubernetes).

![Amazon EKS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c65ozruqqecn9a2q7snt.png)

Now let’s explore the configuration in the deployment files.

**Deployment** contains the configuration for creating and managing pods. It uses a replica set to ensure that the desired number of pods are always running.

**Configuration in HPA** automatically scales the number of pods in a deployment based on the workload’s CPU or memory consumption.

**Ingress** contains the configuration on how external traffic is routed to your applications. It can be used to expose HTTP and HTTPS routes from outside the cluster to services within the cluster making it easier for users to access your applications.

**Log4net_config** contains configuration settings that are used to view the application logs in your Kubernetes console or store the needed logs in a file.

**Namespaces** organizes your applications and resources in Kubernetes, making it easier to manage large clusters and isolate different teams or projects.

**Pvclaim_eks** contains the configuration requesting a persistent volume from the Kubernetes cluster. This can be helpful for storing data that needs to be persisted across pod restarts or node failures.

Ensure that you create the Kubernetes cluster and node group in Amazon EKS to deploy Bold Report.

![Kubernetes cluster and node group in Amazon EKS](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ubhousfal4kcr0y0onjq.png)

## Step 2: Connect with EKS cluster.
<ol start="1"><li>Configure the AWS by running this command:
```
aws configure
```</ol></li>
<ol start="2"><li>Enter the AWS Access key ID, the AWS Secret Access Key, and the AWS region code.

![Enter the AWS details.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kt4xdyhcejviou4qo2wu.png)</ol></li>
<ol start="3"><li>Get the region code from the AWS website.

![Get the region code from the AWS website.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ari1j1ogam0n99gxq28n.png)</ol></li>
<ol start="4"><li>Enter the default output as JSON.

![Enter the default output as JSON.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/67cvkfa2gtv4xsrgbce9.png)</ol></li>

<ol start="5"><li>Next, update the Kubeconfig by running this command:

```
aws eks --region <region-name> update-kubeconfig --name <cluster-name>
```
</ol></li>

Here, &lt;region-name&gt; stands for region in which the cluster is created and &lt;cluster-name&gt; stands for the cluster name.

Next, run this command to deploy the CSI Driver that will create all the necessary CSI drivers:
```
kubectl apply -k "github.com/kubernetes-sigs/aws-efs-csi-driver/deploy/kubernetes/overlays/stable/?ref=release-1.3"
```
## Step 3: Deploy the NGINX Ingress Controller.
To deploy the Nginx Controller, run the following command:

```
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.2.0/deploy/static/provider/cloud/deploy.yaml
```

## Step 4: Configure file storage for pods.
To achieve this, create an EFS file system to store the shared folders for application usage, and then map the subnets and security groups to the file system.

![Map the subnets and security groups.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5py9pfo07md8dpo7lvs4.png)

Take notice of the file system ID to be used on the next step.

Open the **pvclaim_eks.yaml** file and enter the volume handle ID value with the File System ID and save it.

![Enter the volume handle ID value with the File System ID.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n70m5qylv25eqsprk673.png)

## Step 5: Deploy the Kubernetes metric server.
Use this to enable the horizontal pod autoscaler:

```
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
```

Run this command to confirm if the metric server deployment is running:

```
kubectl get deployment metrics-server -n kube-system
```

![The metric server deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e6whqqoyv6461u02767y.png)

## Step 6: Apply namespace.
Run this command to create a namespace for Bold Reports:

```
kubectl apply -f namespace.yaml
```

## Step 7: Create log configuration.
Then, run this command to create the log configuration:

```
kubectl apply -f log4net_config.yaml
```

## Step 8: SSL configuration (Optional).
By default, the application will be hosted in non-SSL mode. If you wish to configure SSL, add the domain and SSL configuration in the **ingress.yaml** file.

![SSL configuration.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0bjqsvn7ohzoyq3fufa.png)

First, create the TLS secret with the SSL certificate by running this command:

```
kubectl create secret tls boldreports-tls -n bold-services –key <key-path> –cert <certificate-path>
```

For this case, **boldreports-tls** is the secret name. **<key-path>** indicates the path for the **.pem** file and **<certificate-path>** for the **.crt** file path. Use the domain SSL certificate.

## Apply Ingress configuration
Apply Bold Reports Ingress and get the IP address of the Nginx Ingress by running the following command:

```
kubectl apply -f ingress.yaml
```
To get the ingress IP address, run the following command repeatedly until an IP address is displayed:

```
kubectl get ingress -n bold-services -w
```

![Apply Ingress configuration.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/04vthxswjhiupznl7iq4.png)

## Step 9: Configure IP address.
Open the **deployment.yaml** file, and then change the DNS or Ingress IP address within the application’s base URL.

![Change the DNS or Ingress IP address.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ec4oc5tq4x3skelcmbym.png)

## Step 10: Optional client libraries.
If you want to use client libraries from third-party sources like MySQL, Oracle, or PostgreSQL, install them during Report Server deployment. If you want to install more than one client library, then separate their names with commas, like in the following, where we specify MySQL, Oracle, and PostgreSQL databases.

![Specify MySQL, Oracle, and PostgreSQL databases.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ro6beozruso8kzuhc4y.png)

## Step 11: Apply configuration in PVClaim_EKS.
Apply the configuration from **pvclaim_eks** to create a required persistent volume (PV) and persistent volume claim (PVC).

```
kubectl apply -f pvclaim_eks.yaml
```

## Step 12: Apply configuration in deployment file.
Next, apply the configuration in the deployment file to the Kubernetes cluster by running the following command:

```
kubectl apply -f deployment.yaml
```

This command will create pods in your cluster according to the configuration in the deployment file.

## Step 13: Apply Configuration in hpa_eks.
Now, apply the configuration in hpa by running this command for setting up autoscaling for the Kubernetes Horizontal Pod Autoscaler (HPA):

```
kubectl apply -f hpa.yaml
```

## Step 14: Create services.
Create all the services by running this command:
```
kubectl apply -f service.yaml
```

## Step 15: Check pod status.
Now that the deployment files are applied, check the pod status by running this command:

```
kubectl get pods -n bold-services -w
```
Wait until all pods are running, and then run then command again.

![All Pods are running.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gp8tqmrl1wryqrxuuo3g.png)

## Step 16: Application startup
Once the report server is up and ready for startup, open a browser and navigate to the domain or ingress IP address provided in the application base URL to configure the report server.

Now, to activate your Bold Reports account, you will need to provide your online credentials or upload your offline unlock key. You can download the unlock key from your [Bold Reports Accounts](https://www.boldreports.com/account/?utm_source=dev&utm_dev=partner_blog&utm_campaign=dev_reportingsolutioninamazonekswithingress_cy23) page.

<ol start="1"><li>To use the online credentials, click on, “Log in to activate account.” Enter your Bold Reports credentials. Since we have only one portal license, the portal license selection will be skipped in this setup. If you have more than one portal license, you will be required to select one.</ol></li>
<ol start="2"><li>Configure the Administrator user by entering the user information and password. Click the **Next** button.

![Configure the Administrator user.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zaft6aivf8fkkfr47m52.png)</ol></li>

<ol start="3"><li>Configure the database to store the report server data. The data can be stored in SQL Server, PostgreSQL, or MySQL databases.
For this setup, we use PostgreSQL, and the field will be reloaded based on the selected database. Provide the necessary information in the required fields and click the **Next** button.

Finally, the report tenant deployment will start and run in the background.

![Report Tenant Deployment.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7tl1kaouea7n6jr89oso.png)</ol></li>

<ol start="4"><li>Now, click on Go to Reports, where you will be redirected to view all pages.

![Go to Reports](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/861mkqghd8gz7w5chzek.png)</ol></li>

In the Report Sample pop-up, you can add the sample reports that are already available with the Report Server by clicking Explore.

![Report Sample pop-up.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j88vnjsrr353gxvty23t.png)

The sample reports are already available and will be displayed.

![Sample Reports](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/21ub63asorl9np74ksez.png)

<ol start="5"><li>Clicking the Add Report button will upload the reports to the Report Server, and if you click on the report, it will subsequently open within the Report Server.</ol></li>

## Step 17: Export data visualization items.
The Bold Reports Report Server does not support exporting data visualization report items by default while scheduling. To enable this feature, you need to install the PhantomJS client library. PhantomJS is a JavaScript library that can be used to render web pages without a graphical user interface.

## Installing PhatomJS
To install the PhantomJS client library, first we need to Bash the container.

Run this command to get the available container:

```
kubectl get pods -n bold-services -w
```

Next, run this command to open the shell running in the reports-web-deployment container:
```
kubectl exec -it <pod-name> -n <namespace> -- bash
```

In the above command, &lt;pod-name&gt; indicates the pod name where we are going to install PhantomJS, and &lt;namespace&gt; indicates the namespace which we have created when deploying the Report Server.

Now, we are inside our container.

<ol start="1"><li>Change the current directory to **/application/app_data/optional-libs** by running this command.

```
cd /application/app_data/optional-libs
```
</ol></li>
<ol start="2"><li>Install the sudo and wget

```
apt-get install sudo
apt-get install wget
```
</ol></li>
Now that the installation of **sudo** and **wget** is complete, proceed to install some packages that are essential by running this command:

```
sudo apt-get install build-essential chrpath libssl-dev libxft-dev libfreetype6-dev libfreetype6 libfontconfig1-dev libfontconfig1 -y
```
<ol start="3"><li>Download PhantomJS.
Download the latest stable version of PhantomJS from the official website by running this command:

```
sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
```
</ol></li>
<ol start="4"><li>Extract the downloaded archive file.
Now that the download is complete, extract the downloaded archive file to the desired system location by running this command:

```
sudo tar xvjf phantomjs-2.1.1-linux-x86_64.tar.bz2 -C /usr/local/share/
```

It will extract the file and move it to the **/usr/local/share** directory.</ol></li>

<ol start="5"><li>Create a **symlink** of the **PhantomJS** binary file to the system’s bin directory by running this command:
```
sudo ln -s /usr/local/share/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/local/bin/
```
Verify whether PhantomJS is installed properly by running this command:
```
phantomjs –version
```
If it shows the version number, then PhantomJS is installed properly.</ol></li>

To check whether the charts are exported, reload the browser and export the report that has the charts.

## Report embedding
Bold Reports allows you to embed reporting functionalities directly within your applications. Our embeddable reporting tools can be integrated with popular applications such as ASP.NET Core, Blazor, Angular, and React. The usage of the embedded reporting tools will change depending on the deployment platform. You can find more detailed information about these differences in [our documentation](https://help.boldreports.com/enterprise-reporting/developer-guide/embed-in-application/view-report-through-report-viewer/?utm_source=dev&utm_dev=partner_blog&utm_campaign=dev_reportingsolutioninamazonekswithingress_cy23).

![Report Embedding](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xrbyevbi1pmh0638pzwl.png)

## Conclusion
This blog post covered the step-by-step process of deploying the Bold Reports Report Server on Amazon Elastic Kubernetes Service including adding optional client libraries and installing PhantomJS for exporting data visualization report items. We hope you found this guide helpful.

If you have any questions, please post them in the comments section. You can also contact us through our [contact page](https://www.boldreports.com/contact/?utm_source=dev&utm_dev=partner_blog&utm_campaign=dev_reportingsolutioninamazonekswithingress_cy23), or if you already have an account, you can [log in](https://www.boldreports.com/account/?utm_source=dev&utm_dev=partner_blog&utm_campaign=dev_reportingsolutioninamazonekswithingress_cy23) to ask your support question.

Bold Reports offers a 15-day free trial without any required credit card information. We welcome you to start a free trial and experience Bold Reports. Try it and let us know what you think!

Catch us on our official [Twitter](https://twitter.com/boldreportsoffl), [Facebook](https://www.facebook.com/boldreportsofficial/), and [LinkedIn](https://www.linkedin.com/showcase/boldreportsofficial) pages for info about upcoming releases.