> For the complete documentation index, see [llms.txt](https://academy.cegedim.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://academy.cegedim.cloud/compute/containers-k8s/k8s-features/gateway-api/gateway-api-traefik.md).

# Traefik

Getting started with Traefik on cegedim.cloud — deploying workloads with IngressRoute

Traefik v3 supports the Kubernetes Gateway API natively. It also provides its own `IngressRoute` CRD for teams who prefer Traefik-native routing. This guide uses `IngressRoute` as a practical entry point.

{% embed url="<https://doc.traefik.io/traefik/routing/providers/kubernetes-crd/>" %}

## What the platform provides

You do not need to install or configure Traefik. The following are deployed and managed by the platform team:

| Component          | Role                                                          |
| ------------------ | ------------------------------------------------------------- |
| Traefik controller | Watches IngressRoute/HTTPRoute resources cluster-wide         |
| `web` entry point  | HTTP entry point — receives traffic forwarded by the F5 BigIP |

Each cegedim.cloud cluster is fronted by an **F5 BigIP** load balancer that handles wildcard DNS (`*.{{ cluster-name }}.ccs.cegedim.cloud`), TLS termination, and L4 forwarding to the Traefik pods. Replace `{{ cluster-name }}` with your actual cluster name (e.g. `prod-paris`, `staging-lyon`) in all examples below.

## Deploying your application

### Prerequisites

* Traefik is installed on your cluster (available from the platform team via ITCare)

### Step 1 — Deploy your workload

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-web
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx-web
  template:
    metadata:
      labels:
        app: nginx-web
    spec:
      containers:
      - name: nginx
        image: nginx:stable
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: nginx-web
spec:
  selector:
    app: nginx-web
  ports:
  - port: 80
    targetPort: 80
```

### Step 2 — Create the IngressRoute

```yaml
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: nginx-web
spec:
  entryPoints:
    - web
  routes:
    - match: Host(`nginx-web.{{ cluster-name }}.ccs.cegedim.cloud`)
      kind: Rule
      services:
        - name: nginx-web
          port: 80
```

### Step 3 — Verify

```bash
# Check the IngressRoute status
kubectl get ingressroute nginx-web

# Test the endpoint
curl https://nginx-web.{{ cluster-name }}.ccs.cegedim.cloud/
```

## Alternative: Gateway API HTTPRoute

If you prefer to use the standard Kubernetes Gateway API instead of the Traefik-native `IngressRoute`, Traefik v3 supports `HTTPRoute` natively. The platform provides a `traefik-int` Gateway for internal traffic.

```yaml
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: nginx-web
spec:
  parentRefs:
  - name: traefik-int
  hostnames:
  - "nginx-web.{{ cluster-name }}.ccs.cegedim.cloud"
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /
    backendRefs:
    - name: nginx-web
      port: 80
```

```bash
# Check the HTTPRoute status
kubectl get httproute nginx-web

# Test the endpoint
curl https://nginx-web.{{ cluster-name }}.ccs.cegedim.cloud/
```

## Clean up

If you used IngressRoute:

```bash
kubectl delete ingressroute nginx-web
kubectl delete service nginx-web
kubectl delete deployment nginx-web
```

If you used HTTPRoute:

```bash
kubectl delete httproute nginx-web
kubectl delete service nginx-web
kubectl delete deployment nginx-web
```

## Further Reading

{% embed url="<https://doc.traefik.io/traefik/routing/providers/kubernetes-crd/>" %}

{% embed url="<https://gateway-api.sigs.k8s.io/>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://academy.cegedim.cloud/compute/containers-k8s/k8s-features/gateway-api/gateway-api-traefik.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
