- Docker Engine
- docker-compose
With the docker-compose.yml
file provided in this gist,
version: '3' | |
services: | |
webapp: | |
image: containous/whoami | |
# Move this directive under the "deploy:" if you are deploying to swarm instead of standalone Docker Engine | |
labels: | |
# Traefik v1 | |
- "traefik.frontend.rule=Host:whoami.localhost" | |
# Traefik v2 |
provider "aws" { | |
region = "eu-west-2" | |
version = "~> 2.0" | |
} | |
variable "base_domain" { | |
type = "string" | |
description = "Base domain used for this experimentation" | |
default = "damienduportal.org" | |
} |
version: '3.7' | |
services: | |
reverse-proxy: | |
image: traefik:${TRAEFIK_LATEST_STABLE} | |
command: | |
- "--docker" | |
- "--api" | |
ports: | |
- "80:80" |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: traefik-ingress-controller | |
namespace: kube-system | |
--- | |
kind: Deployment | |
apiVersion: extensions/v1beta1 | |
metadata: |
version: '3.4' | |
networks: | |
front: | |
docker-sock: | |
services: | |
lb: | |
image: traefik:1.7.11 | |
command: |
version: '2.4' | |
services: | |
lb: | |
image: traefik:1.7.10 | |
command: | |
- "--docker.domain=localhost" | |
- "--api" | |
ports: | |
- "80:80" |
Question: Will the slides be available after the webinar?
Answer: Yes, a link will be provided on our blog at https://blog.containo.us/back-to-traefik-2-0-the-online-meet-up-4e4b6411fbfa
Question: Doesn’t the web container need to use dynamic ports, and not port 80?
Answer: A container doesn’t need to publish/forward to any port on the outside. It listens on a port, for example, port 80, from its own private IP address, inside the Docker private network. The value of Traefik is to route requests from the outside on a chosen port, for example, port 80 or 443, of the public address, to the private IP address of the web server. Traefik watches for Docker’s API to get this private IP, and for any change of this private IP (e.g. on a container reboot). Also, you can have as many containers as you want, listening on their own port 80 without any conflict: useful for blue/green deployments, for example. You can find more information here: https://docs.Traefik.io/v1.7/basics/#concepts.
Question: Could you create the Jenkins link also with a Host:jenkins.demo.containous.cloud
, and no other option (i.e. no tweak on Jenkins, no
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: tiller | |
namespace: kube-system | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: tiller |