# Accessing Akamas

To interact with your Akamas instance, you need the UI and API Gateway to be accessible from outside the cluster.

Kubernetes offers different options to expose a service outside of the cluster. The following is a list of the supported ones, with examples of how to configure them to work in your chart release:

* [Port Forwarding](#port-forwarding)
* [Ingress](#ingress)

{% hint style="warning" %}
While changing the access mode of your Akamas installation, you must also update the value of the `akamasBaseUrl` option of the Helm Values file to match the new endpoint used.
{% endhint %}

## Port Forwarding

By default, Akams uses Cluster IPs for its services, allowing communication only inside the cluster. Still, you can leverage Kubectl's *port-forward* to create a private connection and expose any internal service on your local machine.

This solution is suggested to perform quick tests without exposing the application or in scenarios where cluster access to the public is not allowed.

Set `akamasBaseUrl` to `http://localhost:9000` in your Helm Values file, and install or update your Akamas deployment using the Helm command. Once the rollout is complete, open a tunnel to the UI with the following command:

```bash
kubectl port-forward service/ui 9000:http
```

As long as the port-forwarding is running, you will be able to interact with the UI through the tunnel; you can also interact through the Akamas CLI by configuring the URL `http://localhost:9000/akapi`.

Refer to the official [kubernetes documentation](https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/) for more details about port-forwarding.

## Ingress

An Ingress is a Kubernetes object that provides service access, load balancing, and SSL termination to Kubernetes services.

To expose the Akamas UI through an *Ingress*, configure the Helm Values file by configuring `akamasBaseUrl` with the host of the *Ingress* (e.g.: `https://akamas.kube.example.com`), and by adding the snippet below:

```yaml
ingress:
  enabled: true
  tls:
    - secretName: "<SECRET_NAME>"  # Secret containing the certificate and key data
  annotations: {}  # Optional
```

Here is a description of the fields:

* `enabled`: set to `true` to enable the *Ingress*
* `tls`: configure `secretName` with the name of the *Secret* containing the TLS certificate for the hostname configured in `akamasBaseUrl`. This secret must be created manually before applying the configuration (see [TLS Secrets](https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets) on the Kubernetes documentation) or managed by a certificate issuer configured in the namespace.
* `annotations`: optional, provide any additional annotation required in your deployment. If your cluster leverages any certificate issuer (such as [cert-manager](https://cert-manager.io/docs/)), you can add here the annotations required to interact with the issuer.

Re-run [the install command](https://docs.akamas.io/akamas-docs/3.6/installing/install-akamas/online#start-the-installation) to update the configuration. Once the rollout is complete, you will be able to access the UI using the URL specified in `akamasBaseUrl` and interact with the CLI using `${akamasBaseUrl}/api`.

Refer to the [official kubernetes documentation](https://kubernetes.io/docs/concepts/services-networking/ingress/) for more details on Ingresses.
