> ## Documentation Index
> Fetch the complete documentation index at: https://docs.qodo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Encrypt traffic between the ingress controller and Qodo

> Add a TLS proxy to the Qodo workloads behind your Ingress so that a re-encrypting ingress controller, such as VMware NSX, uses TLS on the backend connection.

On-premises

* **Configuration reference**: Qodo Helm chart `7.32.0`.

By default, TLS terminates at the ingress controller, and traffic from the ingress controller to Qodo Services uses HTTP within the cluster.

Enable backend TLS when your ingress controller must establish a new TLS connection to the backend (re-encrypt). This is required by some ingress controllers, such as VMware NSX and ingress-nginx configured to use HTTPS backends.

Backend TLS is optional. Without it, the chart behaves as before.

## How it works

The chart ships an optional values layer, `values-backend-tls.yaml`. The layer
changes only the five workloads that the Ingress routes to:

| Hostname | Service | Existing port | Added port |
| - | - | - | - |
| `app.<baseDomain>` | `qodo-portal` | `8080` (HTTP) | `8443` (HTTPS) |
| `api.<baseDomain>` and `portal-api.<baseDomain>` | `qodo-platform` | `8000` (HTTP) | `8443` (HTTPS) |
| `auth.<baseDomain>` | `qodo-zitadel` | `8083` (HTTP) | `8443` (HTTPS) |
| `sdk.<baseDomain>` | `qodo-agent-runtime-qar` | `8000` (HTTP) | `8443` (HTTPS) |
| `git.<baseDomain>` | `qodo-litegit` | `8000` (HTTP) | `8443` (HTTPS) |

Each of these pods gets a `tls-proxy` container. The proxy serves TLS on port
8443 and forwards each request to the application over HTTP inside the pod. The request leaves the ingress controller encrypted and is
decrypted only inside the destination pod.

* Existing ports: The HTTP ports stay. Traffic between Qodo services does not change.
* Other workloads: No other workload gets a proxy.
* Headers: The proxy forwards the `Host` header unchanged and sets `X-Forwarded-Proto: https`, so sign-on URLs stay correct.

## Before you begin

* Chart version: Use Qodo Helm chart `7.32.0` or later.
* Kubernetes version: Use Kubernetes 1.30 or later.
* Front door: Use the chart Ingress, or your own Ingress or routes. The switch in step 3 does not change OpenShift Routes or Gateway API HTTPRoutes.
* GKE Ingress: Backend TLS is not supported with the GKE (GCE) ingress controller and the `values-gke.yaml` layer. The chart refuses the switch in step 3 for that combination.
* Ingress controller: Confirm with your platform team which setting makes your controller use TLS to the backend, and which certificate names it checks.
* Chart access: Authenticate to the chart registry, download the matching base values, and set `QODO_CHART_VERSION`. For more information, see [Where the chart comes from](https://docs.qodo.ai/on-prem/qodo-on-prem-helm-chart-overview.md#where-the-chart-comes-from).

## Step 1: Create the certificate Secret

The proxies read their certificate from a TLS Secret named `qodo-backend-tls`
in the Qodo namespace. One certificate serves all five workloads. Include the
names that your ingress controller checks. If your controller verifies the
backend certificate, it must also trust the issuing certificate authority.

**Option 1: Use cert-manager**

With cert-manager, request the certificate from your issuer. Replace the
namespace and the issuer:

```yaml qodo-backend-tls-certificate.yaml theme={null}
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: qodo-backend-tls
  namespace: qodo
spec:
  secretName: qodo-backend-tls
  dnsNames:
    - qodo-portal.qodo.svc
    - qodo-platform.qodo.svc
    - qodo-zitadel.qodo.svc
    - qodo-agent-runtime-qar.qodo.svc
    - qodo-litegit.qodo.svc
  issuerRef:
    kind: Issuer
    name: REPLACE_WITH_YOUR_ISSUER
```

```bash theme={null}
kubectl --context "$KUBE_CONTEXT" apply -f qodo-backend-tls-certificate.yaml
kubectl --context "$KUBE_CONTEXT" -n "$NAMESPACE" \
  wait certificate/qodo-backend-tls --for=condition=Ready --timeout=120s
```

**Option 2: Create the Secret manually**
Without cert-manager, create the Secret from an existing certificate and key:

```bash theme={null}
kubectl --context "$KUBE_CONTEXT" -n "$NAMESPACE" \
  create secret tls qodo-backend-tls --cert=backend.crt --key=backend.key
```

> [!NOTE]
>
> Create the Secret before step 2. If the Secret is missing, the new pods do
> not start. The pods that already run continue to serve.

If you use component namespaces, create the same Secret in every namespace
that runs one of the five workloads.

## Step 2: Add the TLS proxy

**1. Download the layer for your chart version**

```bash theme={null}
curl --fail --location --output values-backend-tls.yaml \
  "https://docs.qodo.ai/examples/on-prem/releases/$QODO_CHART_VERSION/values-backend-tls.yaml"
```

**2. Add the layer after onprem-base.yaml and before your customer values**

```bash theme={null}
helm upgrade --install qodo oci://artifacts-self-hosted.qodo.ai/codium-stack/qodo-onprem/qodo-onprem \
  --version "$QODO_CHART_VERSION" --namespace "$NAMESPACE" \
  -f onprem-base.yaml \
  -f values-backend-tls.yaml \
  -f my-values.yaml
```

The five workloads restart with the proxy. The Ingress still sends traffic to
the HTTP ports, so user traffic is not affected at this step.

**3. Check the result before you continue**

```bash theme={null}
kubectl --context "$KUBE_CONTEXT" -n "$NAMESPACE" get deploy -o wide \
  qodo-portal qodo-platform qodo-zitadel qodo-agent-runtime-qar qodo-litegit
kubectl --context "$KUBE_CONTEXT" -n "$NAMESPACE" get svc \
  qodo-portal qodo-platform qodo-zitadel qodo-agent-runtime-qar qodo-litegit
```

* Deployments: Each Deployment is fully ready and lists a `tls-proxy` container.
* Services: Each Service shows port `8443`.

**4. If a pod does not become ready, read the log of its proxy**

A missing or invalid certificate is reported there:

```bash theme={null}
kubectl --context "$KUBE_CONTEXT" -n "$NAMESPACE" \
  logs deploy/qodo-platform -c tls-proxy
```

## Step 3: Switch the Ingress to the HTTPS ports

**1. Configure the ingress values**

Add the switch and your controller's re-encrypt setting to your customer
values in the same change. The switch alone does not make the controller use
TLS.

Download [`ingress-backend-tls-values.yaml`](https://docs.qodo.ai/examples/on-prem/ingress-backend-tls-values.yaml),
or add its content to `my-values.yaml`:

```yaml ingress-backend-tls-values.yaml theme={null}
# Qodo chart values: send the chart Ingress to the HTTPS ports of the Services.
# Use together with the values-backend-tls.yaml layer of the same chart version.
global:
  ingress:
    backendTLS:
      enabled: true
    annotations:
      # Replace with the re-encrypt settings of your own ingress controller.
      ncp/ssl-mode: reencrypt
      kubernetes.io/ingress.allow-http: "false"
```

The example uses the VMware NSX Container Plugin annotations. NSX requires
`kubernetes.io/ingress.allow-http: "false"` with `reencrypt`. For more
information, see [Ingress](https://techdocs.broadcom.com/us/en/vmware-cis/nsx/event-catalog/4-1/nsx-container-plugin-for-kubernetes-and-tanzu-application-service/load-balancing/ingress.html) in the NSX Container Plugin documentation.

For ingress-nginx, use `nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"`
instead. For more information, see the [ingress-nginx annotations](https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#backend-protocol).
Keep the annotations that your installation already uses.

**2. Apply the Helm configuration**

Run the same `helm upgrade` command again, with this file after your customer
values if you keep it separate. Only the Ingress changes. No pod restarts.

**3. Confirm that every backend of the Ingress now uses port 8443**

```bash theme={null}
kubectl --context "$KUBE_CONTEXT" -n "$NAMESPACE" describe ingress qodo-qodo
```

Then complete the checks in [Render and verify](https://docs.qodo.ai/on-prem/ingress.md#render-and-verify):
sign in from a browser, use the SDK endpoint, and deliver a Git provider
webhook.

The chart refuses the switch in two cases, and the error message states the fix:

* Missing layer: A routed Service has no `https` port, because the layer is not in the command.
* No chart Ingress: `global.ingress.enabled` is `false`. If you manage your own Ingress or routes, do steps 1 and 2 only and point your routes at port `8443` of each Service.

## Renew the certificate

Update the `qodo-backend-tls` Secret with the new certificate and key.
cert-manager does this automatically. The proxies load the new certificate
from the Secret. A pod restart is not necessary.

## Use a different proxy

The chart needs only one thing from the pod: a process that serves TLS on the
`https` port of the Service. The proxy that ships with the layer is Envoy. To
use another proxy, override the `tls-proxy` sidecar (image and arguments) and
its `tls-proxy` ConfigMap for each of the five workloads in your customer
values. Your proxy must do the same as the one that ships:

* Host header: Forward the `Host` header unchanged.
* Forwarded headers: Set `X-Forwarded-Proto: https` and append the caller's address to `X-Forwarded-For`. Requests through the proxy reach the application from inside the pod, as local calls do. The application uses these headers to tell them apart.
* Agent runtime: Allow WebSocket upgrades, set no request timeout, and answer `403` for `/v1/health/drain`.
* Platform: Allow requests of up to one hour.
* Kubernetes: Define startup, liveness, and readiness probes, and resource limits.
* Image registry: The chart applies `global.imageProxyPrefix` to the proxy image, as it does to every image. Make your proxy image available through that registry.

The comment at the top of `values-backend-tls.yaml` lists the same rules and
the per-workload settings.

## Limits

* Readiness: A pod is ready only when its proxy is ready. If the certificate is not valid, the new pods do not become ready and the rollout stops. The pods that already run continue to serve.
* Long requests: When a platform pod stops, requests through the proxy that still run after 60 seconds are cut.
* gRPC: The proxy forwards requests to the application over HTTP/1.1. A native gRPC client cannot call the sign-on API through the proxy.
* Scope: Backend TLS covers the connection from the ingress controller to the five routed workloads. Traffic between Qodo services inside the cluster stays HTTP.

## Roll back

* Ingress only: Remove the values from step 3 and upgrade again. The Ingress returns to the HTTP ports. No pod restarts.
* Everything: Also remove `values-backend-tls.yaml` from the command and upgrade again. The five workloads restart without the proxy.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.