Quickstart
- Kubernetes 1.11+
- CoreDNS installed as Cluster DNS Provider (versions 1.3+ supported)
- Helm v3
Depending on the tool you used to deploy your cluster you might need to tweak RBAC permissions.
kubeadm
If you used kubeadm
to deploy your cluster, a fast way to allow the helm installation to perform all steps it needs is to edit the cluster-admin
ClusterRoleBinding
, adding the following to the subjects
section:
Command
helm repo add traefik-mesh https://helm.traefik.io/mesh
helm repo update
helm install traefik-mesh traefik-mesh/traefik-mesh
Expected output
[...]
NOTES:
Thank you for installing traefik-mesh.
Your release is named traefik-mesh.
To learn more about the release, try:
$ helm status traefik-mesh
$ helm get traefik-mesh
As an example, let’s deploy a server application and a client application under the test
namespace.
server.yaml
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: server
namespace: test
app: server
spec:
replicas: 2
matchLabels:
app: server
template:
metadata:
labels:
app: server
spec:
containers:
- name: server
image: traefik/whoami:v1.6.0
ports:
- containerPort: 80
---
kind: Service
apiVersion: v1
metadata:
name: server
namespace: test
spec:
selector:
app: server
ports:
- name: web
protocol: TCP
port: 80
Create the namespace then deploy those two applications:
kubectl create namespace test
kubectl apply -f server.yaml
kubectl apply -f client.yaml
You should now see the following output:
Command
kubectl get all -n test
Expected output
pod/client-7446fdf848-x96fq 1/1 Running 0 79s
pod/server-7c8fd58db5-rchg8 1/1 Running 0 77s
pod/server-7c8fd58db5-sd4f9 1/1 Running 0 77s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/server ClusterIP 10.43.17.247 <none> 80/TCP 77s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/client 1/1 1 1 79s
deployment.apps/server 2/2 2 2 77s
NAME DESIRED CURRENT READY AGE
replicaset.apps/client-7446fdf848 1 1 1 79s
replicaset.apps/server-7c8fd58db5 2 2 2 77s
Take note of the client app pod name (here it’s client-7446fdf848-x96fq
) and open a new terminal session inside this pod using kubectl exec
.
From inside the client container, make sure your server is reachable using the Kubernetes DNS service discovery.
curl server.test.svc.cluster.local
Expected Output
Hostname: server-7c8fd58db5-sd4f9
IP: 127.0.0.1
IP: ::1
IP: 10.42.2.10
IP: fe80::a4ec:77ff:fe37:1cdd
RemoteAddr: 10.42.2.9:46078
GET / HTTP/1.1
Host: server.test.svc.cluster.local
User-Agent: curl/7.64.0
You can note that all this server application is doing is to respond with the content of the request it receives.
Now replace the svc.cluster.local
suffix by traefik.mesh
, and tada: you are now using Traefik Mesh to reach your server!
Command
curl server.test.traefik.mesh
Expected Output
Note the presence of headers as well as other instrumentation headers like Uber-Trace-Id
, indicating than your request has been processed and instrumented by Traefik Mesh.