I am using Traefik in Kubernetes and I have everything running but I have no idea if there is a load balancing against the replicas of “mypod”. My Deployment looks as:
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mypod
namespace: kube-system
labels:
app: mypod
spec:
replicas: 3
selector:
matchLabels:
app: mypod
template:
metadata:
labels:
app: mypod
spec:
containers:
- name: php-apache-4-rcweb
image: my.registry.local:5000/image_name:0.0.1 # Or your custom image
env:
- name: TZ
....
ports:
- containerPort: 80
volumeMounts:
....
command: ["/start_apache.sh"]
volumes:
....
---
apiVersion: v1
kind: Service
metadata:
name: mypod-service
namespace: kube-system
annotations:
traefik.ingress.kubernetes.io/service.sticky.cookie: "true"
traefik.ingress.kubernetes.io/service.sticky.cookie.name: mypod-service-cookie
traefik.ingress.kubernetes.io/service.sticky.cookie.secure: "true"
traefik.ingress.kubernetes.io/service.sticky.cookie.maxAge: "3600"
spec:
selector:
app: mypod
ports:
- protocol: TCP
port: 8080 # The port on which the Service listens for incoming traffic.
targetPort: 80 # The port on the Pods to which the Service will forward the traffic.
How can I be sure there is a load balancing? am I having some errors respect of the use of Traefik?
thanks in advance