Accessing Akamas

To interact with your Akamas instance you need the UI and API Gateway to be accessible from outside the cluster. This means you need to expose the ui and kong service respectively (although a minimal configuration only requires exposing the ui service, since it can forward requests to the API Gateway through the path /akapi).

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

By default, Akams uses Cluster IPs for its services, which only allow communication 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 the need of exposing the application, or in scenarios where cluster access to the public is not allowed.

To make the Akamas UI accessible on http://localhost:8000, run the following command:

kubectl port-forward service/ui 8000:http

To interact with the Akamas CLI you can use the URL http://localhost:8000/akapi, or expose the kong service in the same way.

Refer to the official kubernetes documentation for more details about port-forwarding.

Load Balancer

Load Balancers expose services outside the cluster. This solution is often used with clusters managed by cloud providers such as Amazon EKS or Google Kubernetes Engine (GKE).

You can expose the Akamas UI through a Load Balancer by adding the snippet below to the akamas.yaml file from the previous section, and re-running the install command to update the configuration.

ui:
  service:
    type: "LoadBalancer"

To get the address of the load balancer run the command:

kubectl get svc ui -o 'custom-columns=NAME:metadata.name,TYPE:spec.type,HOSTNAME:status.loadBalancer.ingress[].hostname'

For more details on Load Balancers refer to the official kubernetes documentation.

Ingress

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

You can expose the Akamas UI through an Ingress by adding the snippet below to the akamas.yaml file from the previous section. After adding to className one of the ingress controllers available on the cluster, re-run the install command to update the configuration.

ui:
  ingress:
    enabled: true
    className: "<class-name>"
    hosts:
      - host: "<dns-name>"
        paths:
          - path: /
            pathType: Prefix

You can also configure a certificate on the Ingress: refer to HTTPS configuration section for instructions.

Refer to the official kubernetes documentation for more details on Ingresses.

NodePort

Node Ports make services accessible on specific ports of any node of the cluster.

You can expose the Akamas UI through a NodePort by adding the snippet below to the akamas.yaml file from the previous section, and re-running the install command to update the configuration.

ui:
  service:
    type: "NodePort"
    http:
      nodePort: "30010"

The Akamas UI will be accessible on any cluster node at http://<cluster-node>:30010. You can also omit the http.nodePort field and let Kubernetes automatically select a random port.

Refer to the official kubernetes documentation for more information on Node Ports.

Last updated