Skip to content

Commit fbd7922

Browse files
authored
feat: knative provider
1 parent 6ab0fdd commit fbd7922

22 files changed

+6996
-10
lines changed

.markdownlint.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"MD033": false,
77
"MD036": false,
88
"MD024": false,
9+
"MD028": false,
910
"MD041": false,
1011
"MD029": false,
1112
"MD034": false,

EXAMPLES.md

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ metrics:
10581058

10591059
## Use kubernetes Gateway API
10601060

1061-
One can use the new stable kubernetes gateway API provider setting the following _values_:
1061+
One can use the new stable kubernetes gateway API provider by setting the following _values_:
10621062

10631063
```yaml
10641064
providers:
@@ -1068,7 +1068,7 @@ providers:
10681068

10691069
<details>
10701070

1071-
<summary>With those values, a whoami service can be exposed with a HTTPRoute</summary>
1071+
<summary>With those values, a whoami service can be exposed with an HTTPRoute</summary>
10721072

10731073
```yaml
10741074
---
@@ -1132,7 +1132,7 @@ Once it's applied, whoami should be accessible on [whoami.docker.localhost](http
11321132

11331133
## Use Kubernetes Gateway API with cert-manager
11341134

1135-
One can use the new stable kubernetes gateway API provider with automatic TLS certificates delivery (with cert-manager) setting the following _values_:
1135+
One can use the new stable kubernetes gateway API provider with automatic TLS certificates delivery (with cert-manager) by setting the following _values_:
11361136

11371137
```yaml
11381138
providers:
@@ -1234,6 +1234,68 @@ Once it's applied, whoami should be accessible on https://whoami.docker.localhos
12341234

12351235
</details>
12361236

1237+
## Use Knative Provider
1238+
1239+
Starting with Traefik Proxy v3.6, one can use the Knative provider (_experimental_) by setting the following _values_:
1240+
1241+
```yaml
1242+
experimental:
1243+
knative: true
1244+
providers:
1245+
knative:
1246+
enabled: true
1247+
```
1248+
1249+
> [!WARNING]
1250+
> You must first have Knative deployed. With Proxy v3.6, v1.19 of Knative is supported.
1251+
> Knative 1.19 requires Kubernetes v1.32+
1252+
1253+
> [!TIP]
1254+
> If you want to test it using k3d, you'll need to set the image accordingly, for instance: `--image rancher/k3s:v1.34.1-k3s1`
1255+
1256+
Finish configuring Knative:
1257+
1258+
```shell
1259+
# 1. Install/update the Knative CRDs
1260+
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.19.0/serving-crds.yaml
1261+
# 2. Install the Knative Serving core components
1262+
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.19.0/serving-core.yaml
1263+
# 3. Update the config-network configuration to use the Traefik ingress class
1264+
kubectl patch configmap/config-network -n knative-serving --type merge \
1265+
-p '{"data":{"ingress.class":"traefik.ingress.networking.knative.dev"}}'
1266+
# Add a custom domain to Knative configuration (in this example, docker.localhost)
1267+
kubectl patch configmap config-domain -n knative-serving --type='merge' \
1268+
-p='{"data":{"docker.localhost":""}}'
1269+
```
1270+
1271+
With that done and the specified values set, a Knative Service can now be deployed:
1272+
1273+
```yaml
1274+
---
1275+
apiVersion: serving.knative.dev/v1
1276+
kind: Service
1277+
metadata:
1278+
name: whoami
1279+
spec:
1280+
template:
1281+
spec:
1282+
containers:
1283+
- name: whoami
1284+
image: traefik/whoami
1285+
ports:
1286+
- containerPort: 80
1287+
```
1288+
1289+
Once it's applied, we can check the URLs:
1290+
1291+
```shell
1292+
# 1. List Knative services
1293+
kubectl get ksvc
1294+
# 2. Test URLs
1295+
curl http://whoami.default.docker.localhost
1296+
curl -k -H "Host: whoami.default.docker.localhost" https://localhost/
1297+
```
1298+
12371299
## Use templating for additionalVolumeMounts
12381300

12391301
This example demonstrates how to use templating for the `additionalVolumeMounts` configuration to dynamically set the `subPath` parameter based on a variable.

traefik-crds/VALUES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Kubernetes: `>=1.22.0-0`
3333
| gatewayAPIExperimental | bool | `false` | Set it to true to install experimental GatewayAPI CRDs. This includes additional experimental features beyond the standard Gateway API Cannot be used together with gatewayAPI |
3434
| global | object | `{}` | Global values This definition is only here as a placeholder such that it is included in the json schema. |
3535
| hub | bool | `false` | Set it to true to install Traefik Hub CRDs. Needed if you set hub.enabled to true in main chart |
36+
| knative | bool | `false` | Set it to true to install Knative CRDs. Needed if you set providers.knative.enabled to true in main chart |
3637
| traefik | bool | `true` | Install Traefik CRDs by default |
3738

3839
----------------------------------------------

0 commit comments

Comments
 (0)