Skip to content

Commit

Permalink
chore: update tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
mloiseleur authored and Traefiker committed Jan 15, 2025
1 parent 06cb203 commit d26df09
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 47 deletions.
8 changes: 4 additions & 4 deletions WALKTHROUGH.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ helm repo add --force-update traefik https://traefik.github.io/charts
kubectl create namespace traefik
# Install the Helm chart
helm install traefik -n traefik --wait \
--version v33.2.1 \
--version v34.1.0 \
--set ingressClass.enabled=false \
--set ingressRoute.dashboard.enabled=true \
--set ingressRoute.dashboard.matchRule='Host(`dashboard.docker.localhost`)' \
Expand Down Expand Up @@ -265,12 +265,12 @@ Then, upgrade Traefik Proxy to Traefik Hub using the same Helm chart:

```shell
helm upgrade traefik -n traefik --wait \
--version v33.2.1 \
--version v34.1.0 \
--reuse-values \
--set hub.token=traefik-hub-license \
--set image.registry=ghcr.io \
--set image.repository=traefik/traefik-hub \
--set image.tag=v3.8.1 \
--set image.tag=v3.10.0 \
traefik/traefik
```

Expand Down Expand Up @@ -395,7 +395,7 @@ First, we enable API Management on Traefik Traefik Hub using the same Helm chart

```shell
helm upgrade traefik -n traefik --wait \
--version v33.2.1 \
--version v34.1.0 \
--reuse-values \
--set hub.apimanagement.enabled=true \
traefik/traefik
Expand Down
8 changes: 4 additions & 4 deletions api-gateway/1-getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,15 @@ Install Traefik Hub API Gateway using Helm:
helm repo add --force-update traefik https://traefik.github.io/charts
# Install the Helm chart
helm install traefik -n traefik --wait \
--version v33.2.1 \
--version v34.1.0 \
--set hub.token=traefik-hub-license \
--set ingressClass.enabled=false \
--set ingressRoute.dashboard.enabled=true \
--set ingressRoute.dashboard.matchRule='Host(`dashboard.docker.localhost`)' \
--set ingressRoute.dashboard.entryPoints={web} \
--set image.registry=ghcr.io \
--set image.repository=traefik/traefik-hub \
--set image.tag=v3.8.1 \
--set image.tag=v3.10.0 \
--set ports.web.nodePort=30000 \
--set ports.websecure.nodePort=30001 \
traefik/traefik
Expand All @@ -112,15 +112,15 @@ kubectl apply --server-side --force-conflicts -k https://github.com/traefik/trae
helm repo update
# Upgrade the Helm chart
helm upgrade traefik -n traefik --wait \
--version v33.2.1 \
--version v34.1.0 \
--set hub.token=traefik-hub-license \
--set ingressClass.enabled=false \
--set ingressRoute.dashboard.enabled=true \
--set ingressRoute.dashboard.matchRule='Host(`dashboard.docker.localhost`)' \
--set ingressRoute.dashboard.entryPoints={web} \
--set image.registry=ghcr.io \
--set image.repository=traefik/traefik-hub \
--set image.tag=v3.8.1 \
--set image.tag=v3.10.0 \
--set ports.web.nodePort=30000 \
--set ports.websecure.nodePort=30001 \
traefik/traefik
Expand Down
4 changes: 2 additions & 2 deletions api-gateway/2-expose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ We can enable it using helm:

```sh
helm upgrade traefik -n traefik --wait \
--version v33.2.1 \
--version v34.1.0 \
--reuse-values \
--set providers.kubernetesCRD.allowExternalNameServices=true \
traefik/traefik
Expand Down Expand Up @@ -820,7 +820,7 @@ And configure Traefik Hub API Gateway to use it, with Kubernetes storage and Peb

```sh
helm upgrade traefik -n traefik --wait \
--version v33.2.1 \
--version v34.1.0 \
--reuse-values \
--set certificatesResolvers.pebble.distributedAcme.caServer=https://pebble.pebble.svc:14000/dir \
--set certificatesResolvers.pebble.distributedAcme.email=test@example.com \
Expand Down
8 changes: 4 additions & 4 deletions api-management/1-getting-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ Now, install Traefik Hub with Helm:
helm repo add --force-update traefik https://traefik.github.io/charts
# Install the Helm chart
helm install traefik -n traefik --wait \
--version v33.2.1 \
--version v34.1.0 \
--set hub.token=traefik-hub-license \
--set hub.apimanagement.enabled=true \
--set ingressClass.enabled=false \
Expand All @@ -91,7 +91,7 @@ helm install traefik -n traefik --wait \
--set ingressRoute.dashboard.entryPoints={web} \
--set image.registry=ghcr.io \
--set image.repository=traefik/traefik-hub \
--set image.tag=v3.8.1 \
--set image.tag=v3.10.0 \
--set ports.web.nodePort=30000 \
--set ports.websecure.nodePort=30001 \
traefik/traefik
Expand All @@ -106,7 +106,7 @@ kubectl apply --server-side --force-conflicts -k https://github.com/traefik/trae
helm repo add --force-update traefik https://traefik.github.io/charts
# Upgrade the Helm chart
helm upgrade traefik -n traefik --wait \
--version v33.2.1 \
--version v34.1.0 \
--set hub.token=traefik-hub-license \
--set hub.apimanagement.enabled=true \
--set ingressClass.enabled=false \
Expand All @@ -115,7 +115,7 @@ helm upgrade traefik -n traefik --wait \
--set ingressRoute.dashboard.entryPoints={web} \
--set image.registry=ghcr.io \
--set image.repository=traefik/traefik-hub \
--set image.tag=v3.8.1 \
--set image.tag=v3.10.0 \
--set ports.web.nodePort=30000 \
--set ports.websecure.nodePort=30001 \
traefik/traefik
Expand Down
24 changes: 9 additions & 15 deletions api-management/3-api-lifecycle-management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ So, for this second API Version, we'll need to:
```diff :../../hack/diff.sh -r -a "manifests/api-v1.yaml manifests/api-v1.1.yaml"
--- manifests/api-v1.yaml
+++ manifests/api-v1.1.yaml
@@ -2,42 +2,43 @@
@@ -2,42 +2,38 @@
apiVersion: hub.traefik.io/v1alpha1
kind: APIVersion
metadata:
Expand All @@ -158,13 +158,12 @@ So, for this second API Version, we'll need to:
namespace: apps
spec:
- release: v1.0.0
+ release: v1.1.0
openApiSpec:
path: /openapi.yaml
override:
servers:
- openApiSpec:
- path: /openapi.yaml
- override:
- servers:
- - url: http://api.lifecycle.apimanagement.docker.localhost/weather-v1
+ - url: http://api.lifecycle.apimanagement.docker.localhost/weather-multi-versions
+ release: v1.1.0

---
apiVersion: hub.traefik.io/v1alpha1
Expand Down Expand Up @@ -200,7 +199,7 @@ So, for this second API Version, we'll need to:
namespace: apps
annotations:
hub.traefik.io/api-version: api-lifecycle-apimanagement-weather-api-v1
@@ -45,10 +46,30 @@
@@ -45,10 +41,30 @@
entryPoints:
- web
routes:
Expand Down Expand Up @@ -280,7 +279,7 @@ Since the last step, the diff is looking like this:
```diff :../../hack/diff.sh -r -a "manifests/api-v1.1.yaml manifests/api-v1.1-weighted.yaml"
--- manifests/api-v1.1.yaml
+++ manifests/api-v1.1-weighted.yaml
@@ -1,64 +1,24 @@
@@ -1,59 +1,24 @@
---
-apiVersion: hub.traefik.io/v1alpha1
-kind: APIVersion
Expand All @@ -289,11 +288,6 @@ Since the last step, the diff is looking like this:
- namespace: apps
-spec:
- release: v1.1.0
- openApiSpec:
- path: /openapi.yaml
- override:
- servers:
- - url: http://api.lifecycle.apimanagement.docker.localhost/weather-multi-versions
-
----
-apiVersion: hub.traefik.io/v1alpha1
Expand Down Expand Up @@ -355,7 +349,7 @@ Since the last step, the diff is looking like this:
namespace: apps
annotations:
hub.traefik.io/api-version: api-lifecycle-apimanagement-weather-api-v1-1
@@ -66,10 +26,11 @@
@@ -61,10 +26,11 @@
entryPoints:
- web
routes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ metadata:
namespace: apps
spec:
release: v1.1.0
openApiSpec:
path: /openapi.yaml
override:
servers:
- url: http://api.lifecycle.apimanagement.docker.localhost/weather-multi-versions

---
apiVersion: hub.traefik.io/v1alpha1
Expand Down
2 changes: 1 addition & 1 deletion src/manifests/admin-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec:
spec:
containers:
- name: api
image: ghcr.io/traefik/api-server:v1.1.0
image: ghcr.io/traefik/api-server:v1.2.0
args: ["-data", "/api/api.json", "-errorrate", "2"]
imagePullPolicy: IfNotPresent
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion src/manifests/weather-app-forecast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
spec:
containers:
- name: api
image: ghcr.io/traefik/api-server:v1.1.0
image: ghcr.io/traefik/api-server:v1.2.0
args: ["-data", "/api/api.json", "-errorrate", "2"]
imagePullPolicy: IfNotPresent
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion src/manifests/weather-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
spec:
containers:
- name: api
image: ghcr.io/traefik/api-server:v1.1.0
image: ghcr.io/traefik/api-server:v1.2.0
args: ["-data", "/api/api.json", "-openapi", "/public/openapi.yaml", "-errorrate", "2"]
imagePullPolicy: IfNotPresent
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion src/manifests/weather-appv2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
spec:
containers:
- name: api
image: ghcr.io/traefik/api-server:v1.1.0
image: ghcr.io/traefik/api-server:v1.2.0
args: ["-data", "/api/api.json", "-openapi", "/public/openapi.yaml", "-errorrate", "2"]
imagePullPolicy: IfNotPresent
volumeMounts:
Expand Down
12 changes: 6 additions & 6 deletions tests/testhelpers/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func LaunchHelmCommand(t *testing.T, arg ...string) {

// LaunchHelmUpgradeCommand execute `helm` CLI with arg and display stdout+stder with testcontainer logger
func LaunchHelmUpgradeCommand(t *testing.T, arg ...string) {
upgradeArgs := []string{"upgrade", "traefik", "-n", traefikNamespace, "--wait", "--version", "v33.2.1", "--reuse-values", "traefik/traefik"}
upgradeArgs := []string{"upgrade", "traefik", "-n", traefikNamespace, "--wait", "--version", "v34.1.0", "--reuse-values", "traefik/traefik"}
upgradeArgs = append(upgradeArgs, arg...)
LaunchHelmCommand(t, upgradeArgs...)
}
Expand All @@ -101,7 +101,7 @@ func InstallTraefikProxy(ctx context.Context, t *testing.T, k8s client.Client) (
assert.NoError(t, err)

LaunchHelmCommand(t, "install", "traefik", "-n", traefikNamespace, "--wait",
"--version", "v33.2.1",
"--version", "v34.1.0",
"--set", "ingressClass.enabled=false",
"--set", "ingressRoute.dashboard.enabled=true",
"--set", "ingressRoute.dashboard.matchRule='Host(`dashboard.docker.localhost`)'",
Expand All @@ -125,15 +125,15 @@ func InstallTraefikHubAPIGW(ctx context.Context, t *testing.T, k8s client.Client

CreateSecretForTraefikHub(ctx, t, k8s)
LaunchHelmCommand(t, "install", "traefik", "-n", traefikNamespace, "--wait",
"--version", "v33.2.1",
"--version", "v34.1.0",
"--set", "hub.token=traefik-hub-license",
"--set", "ingressClass.enabled=false",
"--set", "ingressRoute.dashboard.enabled=true",
"--set", "ingressRoute.dashboard.matchRule='Host(`dashboard.docker.localhost`)'",
"--set", "ingressRoute.dashboard.entryPoints={web}",
"--set", "image.registry=ghcr.io",
"--set", "image.repository=traefik/traefik-hub",
"--set", "image.tag=v3.8.1",
"--set", "image.tag=v3.10.0",
"--set", "ports.web.nodePort=30000",
"--set", "ports.websecure.nodePort=30001",
"traefik/traefik")
Expand All @@ -153,7 +153,7 @@ func InstallTraefikHubAPIM(ctx context.Context, t *testing.T, k8s client.Client)

CreateSecretForTraefikHub(ctx, t, k8s)
LaunchHelmCommand(t, "install", "traefik", "-n", traefikNamespace, "--wait",
"--version", "v33.2.1",
"--version", "v34.1.0",
"--set", "hub.token=traefik-hub-license",
"--set", "hub.apimanagement.enabled=true",
"--set", "ingressClass.enabled=false",
Expand All @@ -162,7 +162,7 @@ func InstallTraefikHubAPIM(ctx context.Context, t *testing.T, k8s client.Client)
"--set", "ingressRoute.dashboard.entryPoints={web}",
"--set", "image.registry=ghcr.io",
"--set", "image.repository=traefik/traefik-hub",
"--set", "image.tag=v3.8.1",
"--set", "image.tag=v3.10.0",
"--set", "ports.web.nodePort=30000",
"--set", "ports.websecure.nodePort=30001",
"traefik/traefik")
Expand Down
6 changes: 3 additions & 3 deletions tests/walkthrough/walkthrough_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ func (s *WalkthroughTestSuite) TestWalkthrough() {
// STEP 2
testhelpers.CreateSecretForTraefikHub(s.ctx, s.T(), s.k8s)
testhelpers.LaunchHelmCommand(s.T(), "upgrade", "traefik", "-n", "traefik", "--wait",
"--version", "v33.2.1",
"--version", "v34.1.0",
"--reuse-values",
"--set", "hub.token=traefik-hub-license",
"--set", "image.registry=ghcr.io",
"--set", "image.repository=traefik/traefik-hub",
"--set", "image.tag=v3.8.1",
"--set", "image.tag=v3.10.0",
"traefik/traefik")

req, err = http.NewRequest(http.MethodGet, "http://walkthrough.docker.localhost/basic-auth/weather", nil)
Expand All @@ -150,7 +150,7 @@ func (s *WalkthroughTestSuite) TestWalkthrough() {

// STEP 3
testhelpers.LaunchHelmCommand(s.T(), "upgrade", "traefik", "-n", "traefik", "--wait",
"--version", "v33.2.1",
"--version", "v34.1.0",
"--reuse-values",
"--set", "hub.apimanagement.enabled=true",
"traefik/traefik")
Expand Down

0 comments on commit d26df09

Please sign in to comment.