Skip to content

Commit 17eb244

Browse files
committed
Replace Ingress NGINX with Traefik in full-stack asset transfer guide
1 parent a2c40e6 commit 17eb244

21 files changed

Lines changed: 309 additions & 108 deletions

File tree

full-stack-asset-transfer-guide/applications/rest-api/deployment.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,7 @@ kind: Ingress
5454
metadata:
5555
name: rest-api
5656
annotations:
57-
nginx.ingress.kubernetes.io/proxy-connect-timeout: 60s
58-
# nginx.ingress.kubernetes.io/ssl-passthrough: "true"
57+
# proxy settings handled by Traefik
5958
# labels:
6059
# app: rest-api
6160
# app.kubernetes.io/instance: fabricpeer
@@ -64,7 +63,7 @@ metadata:
6463
# creator: fabric
6564
# orgname: Org1MSP
6665
spec:
67-
ingressClassName: nginx
66+
ingressClassName: traefik
6867
rules:
6968
- host: restapi.localho.st
7069
http:

full-stack-asset-transfer-guide/checks/check-kube.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ function cluster_info() {
1414
kubectl cluster-info &>/dev/null
1515
}
1616

17-
function nginx() {
18-
kubectl -n ingress-nginx get all &>/dev/null
19-
kubectl -n ingress-nginx get deployment.apps/ingress-nginx-controller &>/dev/null
17+
function ingress() {
18+
kubectl -n traefik get all &>/dev/null
19+
kubectl -n traefik get deployment.apps/traefik &>/dev/null
2020
curl http://${WORKSHOP_INGRESS_DOMAIN} &>/dev/null
21-
curl --insecure https://${WORKSHOP_INGRESS_DOMAIN}:443 &>/dev/null
2221
}
2322

2423
function container_registry() {
@@ -30,7 +29,7 @@ must_declare WORKSHOP_INGRESS_DOMAIN
3029
must_declare WORKSHOP_NAMESPACE
3130

3231
check cluster_info "k8s API controller is running"
33-
check nginx "Nginx ingress is running at https://${WORKSHOP_INGRESS_DOMAIN}"
32+
check ingress "Traefik ingress is running at http://${WORKSHOP_INGRESS_DOMAIN}"
3433

3534
if [ x"${WORKSHOP_CLUSTER_RUNTIME}" == x"kind" ]; then
3635
check container_registry "Container registry is running at ${WORKSHOP_INGRESS_DOMAIN}:5000"

full-stack-asset-transfer-guide/contracts/asset-transfer-typescript/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
},
1616
"include": ["src/"]
1717
}
18+

full-stack-asset-transfer-guide/docs/CloudReady/10-kube-zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
Fabric云原生部署,所有的组件直接在工作站上运行,在这个步骤中,您将会配置:
88
- 一个本地[kind](https://kind.sigs.k8s.io) 集群,来运行k8s.
99

10-
- 一个本地[Ingress controller](https://github.com/kubernetes/ingress-nginx), 将k8s集群的路由设置到 `*.localho.st` 这个虚拟域名上.
10+
- 一个本地[Ingress controller](https://traefik.io/), 将k8s集群的路由设置到 `*.localho.st` 这个虚拟域名上.
1111

1212
- 一个本地[Container Registry](https://docs.docker.com/registry/insecure/), 允许您上传智能合约的docker镜像。
1313

full-stack-asset-transfer-guide/docs/CloudReady/10-kube.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ With cloud-native Fabric, all the components can run directly on your developmen
88

99
- A local [kind](https://kind.sigs.k8s.io) cluster, running Kubernetes in Docker.
1010

11-
- A local [Ingress controller](https://github.com/kubernetes/ingress-nginx), routing traffic into the cluster at the `*.localho.st` virtual DNS domain.
11+
- A local [Ingress controller](https://traefik.io/), routing traffic into the cluster at the `*.localho.st` virtual DNS domain.
1212

1313
- A local [Container Registry](https://docs.docker.com/registry/insecure/), allowing you to upload chaincode Docker images to the cluster.
1414

full-stack-asset-transfer-guide/docs/CloudReady/13-kube-public-cloud.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,23 +87,23 @@ just nginx
8787
### IKS
8888
```shell
8989

90-
export INGRESS_IPADDR=$(kubectl -n ingress-nginx get svc/ingress-nginx-controller -o json | jq -r '.status.loadBalancer.ingress[0].ip')
90+
export INGRESS_IPADDR=$(kubectl -n traefik get svc/traefik -o json | jq -r '.status.loadBalancer.ingress[0].ip')
9191
export WORKSHOP_INGRESS_DOMAIN=$(echo $INGRESS_IPADDR | tr -s '.' '-').nip.io
9292

9393
```
9494

9595
### EKS
9696
```shell
9797

98-
export INGRESS_HOSTNAME=$(kubectl -n ingress-nginx get svc/ingress-nginx-controller -o json | jq -r '.status.loadBalancer.ingress[0].hostname')
98+
export INGRESS_HOSTNAME=$(kubectl -n traefik get svc/traefik -o json | jq -r '.status.loadBalancer.ingress[0].hostname')
9999
export INGRESS_IPADDR=$(dig $INGRESS_HOSTNAME +short)
100100
export WORKSHOP_INGRESS_DOMAIN=$(echo $INGRESS_IPADDR | tr -s '.' '-').nip.io
101101

102102
```
103103
### Digital ocean
104104
```shell
105105

106-
export INGRESS_HOSTNAME=$(kubectl -n ingress-nginx get svc/ingress-nginx-controller -o json | jq -r '.status.loadBalancer.ingress[0].ip')
106+
export INGRESS_HOSTNAME=$(kubectl -n traefik get svc/traefik -o json | jq -r '.status.loadBalancer.ingress[0].ip')
107107
export WORKSHOP_INGRESS_DOMAIN=$(echo $INGRESS_HOSTNAME | tr -s '.' '-').nip.io
108108

109109
```

full-stack-asset-transfer-guide/docs/CloudReady/22-fabric-ansible-collection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Check the Ingress controllers domain
4141

4242
For IKS:
4343
```shell
44-
export INGRESS_IPADDR=$(kubectl -n ingress-nginx get svc/ingress-nginx-controller -o json | jq -r '.status.loadBalancer.ingress[0].ip')
44+
export INGRESS_IPADDR=$(kubectl -n traefik get svc/traefik -o json | jq -r '.status.loadBalancer.ingress[0].ip')
4545
export WORKSHOP_INGRESS_DOMAIN=$(echo $INGRESS_IPADDR | tr -s '.' '-').nip.io
4646
```
4747

full-stack-asset-transfer-guide/infrastructure/kind_console_ingress/90-KIND-ingress.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
register: resultingress
99

1010
- name: Wait for the ingress
11-
command: kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=2m
11+
command: kubectl wait --namespace traefik --for=condition=ready pod --selector=app=traefik --timeout=2m
1212
changed_when: false
1313

1414
# Override the cluster DNS with a local override to refer pods to the HOST interface
@@ -17,8 +17,8 @@
1717
k8s_info:
1818
api_version: v1
1919
kind: service
20-
namespace: ingress-nginx
21-
name: "ingress-nginx-controller"
20+
namespace: traefik
21+
name: "traefik"
2222
register: ingress_info
2323

2424
- name: Applying CoreDNS overrides for ingress domain
@@ -33,5 +33,5 @@
3333
- name: Rollout the CoreDNS
3434
shell: |
3535
kubectl -n kube-system rollout restart deployment/coredns
36-
kubectl wait --namespace ingress-nginx --for=condition=ready pod --selector=app.kubernetes.io/component=controller --timeout=2m
36+
kubectl wait --namespace traefik --for=condition=ready pod --selector=app=traefik --timeout=2m
3737
changed_when: false

full-stack-asset-transfer-guide/infrastructure/kind_console_ingress/templates/ingress/ingress-nginx-controller.yaml

Lines changed: 0 additions & 39 deletions
This file was deleted.

full-stack-asset-transfer-guide/infrastructure/kind_console_ingress/templates/ingress/kustomization.yaml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
1919
kind: Kustomization
2020

2121
resources:
22-
- https://github.com/kubernetes/ingress-nginx.git/deploy/static/provider/cloud?ref=controller-v1.1.2
23-
24-
25-
# Remove the port `appProtocol` attribute as this is not accepted by all cloud providers
26-
patches:
27-
- patch: |-
28-
- op: remove
29-
path: "/spec/ports/0/appProtocol"
30-
- op: remove
31-
path: "/spec/ports/1/appProtocol"
32-
target:
33-
kind: Service
34-
name: ingress-nginx-controller
35-
version: v1
36-
- path: ingress-nginx-controller.yaml
22+
- traefik-controller.yaml

0 commit comments

Comments
 (0)