# HTTPS configuration

HTTPS configuration can be set in the Akamas services (UI and Kong) or in the Ingress definition.

## Certificate in the Ingress

Declare the certificate secret by adding a `tls` section to the Ingress definition:

```yaml
ui:
  ingress:
    enabled: true
    className: "<class-name>"    # ingress class name

    hosts:
      - host: "example.company.com"
        paths:
          - path: /
            pathType: Prefix

    tls:
      - secretName: "<secret name>"  # secret name containing the certificate and key data
        hosts:
          - "example.company.com"
```

You can apply the same configuration to the `kong` service to add a certificate to the API Gateway.

For more information regarding the TLS definition refer to the [official documentation](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls).

## Certificate in the Akamas services

To add a certificate to both the UI and API Gateway you need to generate the `akamas.key` and `akamas.pem` files, and create a secret in Akamas' namespace with the following command:

```bash
kubectl create secret generic certificate --from-file=akamas.key --from-file=akamas.pem
```

To complete the update, restart the deployments:

```bash
kubectl rollout restart deployment ui kong
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.akamas.io/akamas-docs/3.2.1-1/installing-akamas/kubernetes/secure-https-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
