# iFIX Service Setup

## Introduction

iFIX is a microservices-based distributed cloud-native application. The microservices streamline processes to meet outcomes at scale and speed. Each of the microservices is dockerized and deployed on Kubernetes infrastructure. &#x20;

## Pre-reads <a href="#pre-read" id="pre-read"></a>

It is essential to understand some of the key concepts, benefits and best practices of the Kubernetes platform before we understand the deployment of the iFIX. &#x20;

* Know the basics of Kubernetes: <https://www.youtube.com/watch?v=PH-2FfFD2PU&t=3s>​
* Know the [basics of kubectl](https://www.tutorialspoint.com/kubernetes/kubernetes_kubectl_commands.htm) commands
* Know Kubernetes manifests: <https://www.youtube.com/watch?v=ohSUtEfDefc>​
* Know how to manage environment values and secrets of any service deployed in Kubernetes <https://www.youtube.com/watch?v=OW244LxB4oI>​
* Know how to port forward to a pod running inside the k8s cluster and work locally <https://www.youtube.com/watch?v=TT3nd5n5Yus>​
* Know sops to secure your keys/creds: <https://www.youtube.com/watch?v=DWzJ87KbwxA>​

## 1. Choose Installation Type <a href="#v-1-choose-the-cloud-1" id="v-1-choose-the-cloud-1"></a>

Choose the target infra type and follow the instructions to set up a Kubernetes cluster before moving on to the deployment.

{% content-ref url="infra-setup/quickstart" %}
[quickstart](https://docs.digit.org/public-finance/setup/installation/infra-setup/quickstart)
{% endcontent-ref %}

{% content-ref url="infra-setup/on-aws" %}
[on-aws](https://docs.digit.org/public-finance/setup/installation/infra-setup/on-aws)
{% endcontent-ref %}

{% content-ref url="infra-setup/on-azure" %}
[on-azure](https://docs.digit.org/public-finance/setup/installation/infra-setup/on-azure)
{% endcontent-ref %}

## 2. Deployment <a href="#v-1-choose-the-cloud" id="v-1-choose-the-cloud"></a>

The deployment process ensures scalability, flexibility, and efficiency through:

1. Defining deployment configurations as Helm charts.
2. Storing configurations in Git for version control.
3. Automating deployment pipelines for faster iterations.

With these practices, iFIX can be deployed and managed efficiently on Kubernetes while overcoming challenges like resource optimization, scaling, and infrastructure management.

Before starting the deployment, it’s essential to understand the process from source code to a production-ready environment. Kubernetes provides an efficient way to deploy containers in cloud infrastructure. However, managing Kubernetes at scale can be complex. Challenges include:

* Selecting the right instance type and size.
* Scaling the infrastructure up or down.
* Ensuring containers are properly scheduled and run on optimal instances.
* Addressing cost and resource optimization.

To simplify deployment, manage the configuration as code. Each service’s deployment configuration is defined using **Helm charts** and deployed to the Kubernetes cluster. Managing deployment as code provides benefits like version control, change tracking, and branching.

#### 1. iFIX Installation

{% content-ref url="installation" %}
[installation](https://docs.digit.org/public-finance/setup/installation/installation)
{% endcontent-ref %}

#### 2. iFIX-adapter Installation

{% content-ref url="../integration/ifix-adapter/installation" %}
[installation](https://docs.digit.org/public-finance/setup/integration/ifix-adapter/installation)
{% endcontent-ref %}

#### 3. iFIX Ref Dashboard Installation

{% content-ref url="../integration/ifix-dashboard/installation" %}
[installation](https://docs.digit.org/public-finance/setup/integration/ifix-dashboard/installation)
{% endcontent-ref %}

## 3. Destroy the Setup <a href="#id-5-destroy-the-cluster" id="id-5-destroy-the-cluster"></a>

Clean up the cluster Setup using the command below, if required. This deletes the entire cluster and other cloud resources that were provisioned for the iFIX Infra Setup.

```
cd iFix-DevOps/infra-as-code/terraform/my-iFix-eksterraformdestroy​
```

## Conclusion <a href="#conclusion" id="conclusion"></a>

All done, the infra on local, cloud, and deployment of iFIX into the Kubernetes cluster is completed successfully.
