天道酬勤,学无止境

traefik

Traefik + Docker for Windows: Failed to create a client for docker, error: protocol not available & Provider connection error protocol not available

I'm having troubles getting a basic Traefik routing setup to work. My goal is to get basic routing with two helloworld apps (each different to tell apart), both on port 80, e.g.: demo1.localhost -> helloworld1 demo2.localhost -> helloworld2 Each of the images works fine if I run them via docker run in isolation. Using Powershell from my project dir, /app, when I run docker-compose up I get the following: The Traefik service launches, I can visit the dashboard just fine but the routing table doesn't show my routes. demo1 and demo2 launch just fine, but obviously I can't connect to them because

2021-06-15 15:47:40    分类:问答    docker   traefik

How should I setup Traefik on ECS?

In Short I've managed to run Traefik locally and on AWS ECS but now I'm wondering how should I setup some sort of load balancing to make my two services with random IPs available to the public. My current setup on ECS [Internet] | [Load balancer on port 443 + ALB Security group on 443] | [Target group on port 443 + Security group from *any* port] | [cluster] | [service1 container ports "0:5000"] While this works, I'd now like to add another container, eg. service2 also with random ports eg 0:8000. And that's why I need something like Traefik. What I did Here's Toml file: [api] address = ":8080

2021-06-15 10:36:47    分类:问答    docker   amazon-ecs   traefik   aws-load-balancer

Traefik docker image not working on Windows but working on MacOS?

I have an application that's composed of several Docker images that is being developed on MacOS and I'm trying to get it started on Windows. Most seem to be working, but there's a Traefik load balancer that doesn't. On MacOS it just works, but on Windows, whatever URL I access, it gives me a 404, the actual content which is just "404 page not found". The Traefik configuration looks like this: logLevel = "INFO" defaultEntryPoints = ["http", "https"] [entryPoints] [entryPoints.http] address = ":80" [entryPoints.https] address = ":443" [entryPoints.https.tls] [entryPoints.https.tls

2021-06-13 20:20:17    分类:问答    docker   traefik

How to rewrite paths with Traefik when using path prefix rules?

My Traefik config for WordPress contains the following docker-labels: - "traefik.backend=wordpress" - "traefik.docker.network=web" - "traefik.frontend.rule=Host:MyHostName.net;PathPrefix:/blog" - "traefik.enable=true" - "traefik.port=80" Now requesting the url "https://MyHostName/blog" seems to reach the service which seems to return a redirect to "https://MyHostName/wp-admin...". I cannot use subdomains. How can I solve this? UPDATE 0 First thing to do should be adding the Filter "PathPrefixStrip:/blog" to remove the "/blog" prefix when forwarding the request to the service. Correct? But how

2021-06-05 08:21:43    分类:问答    redirect   url-rewriting   path   traefik

Define host and path frontend rule for Traefik

I am trying to use Traefik to deploy proxy multiple applications in my Docker Swarm mode cluster. I have got it so that it proxies a named Host but I want it to proxy on a named Host and Path, but I cannot work out the labels I need to use. This is the docker service command I am using: docker service create \ \ --label "traefik.port=9000" \ --label "traefik.docker.network=traefik-net" \ --label "traefik.frontend.rule=Host:`hostname -f`" \ --label="traefik.backend=portainer" \ \ --constraint "node.role == manager" \ -p 9000:9000 \ --mount "type=bind,src=/var/run/docker.sock,dst=/var/run/docker

2021-06-04 18:46:22    分类:问答    traefik

Kubernetes 1.20.5 安装traefik在腾讯云下的实践

背景个人使用traefik有差不多1-2年时间,kubernetes ingress controller 代理有很多种方式 例如 ingress-nginx kong istio 等等。个人比较习惯traefik。从19年就开始使用。最早使用traefik 不直接使用腾讯云公有云的slb是因为当时slb不能挂载多个证书,而我kubernetes的自建集群实在不想挂载多个slb.就偷懒用了slb udp绑定运行traefik节点的 80 443端口。证书tls的secret 直接挂载在traefik代理层上面。hsts http跳转https的特性都配置在了traefik代理层上面。应用比较少。qps也没有那么高,这样的简单应用就满足了我的需求了关于traefik的结缘最早接触traefik是Google上面看ingress controller 找到的 然后再阳明大佬的博客看到了traefik的实践https://www.qikqiak.com/post/traefik2-ga/,还有超级小豆丁的博客http://www.mydlq.club/article/41 。两位大佬的博客是kubernetes初学者的宝藏博客值得收藏拜读。 顺便吐个糟,用的traefik2.4版本… 抄的豆丁大佬的…http://www.mydlq.club/article/107/哈哈哈ingress

2021-06-02 08:02:50    分类:博客    kubernetes   traefik

How to serve static content with Nginx and Django Gunicorn when using Traefik

I have a web application (Django based) that is utilising multiple containers: Web Application (Django + Gunicorn) Traefik (acting as the reverse proxy and SSL termination) Database which is used with the Web application Redis which is used with the Web application According to some of the documentation I have read, I should be serving my static content using something like NGINX. But I don't have any idea on how I would do that. Would I install NGINX on my Web Application container or as a seperate NGINX container. How do I pass the request from Traefik? As far as I am aware you cannot server

2021-05-31 18:43:06    分类:问答    django   docker   nginx   gunicorn   traefik

Editing Files inside of a Docker Container

How can I edit the config files that are inside of a docker container that has been downloaded on the host? I am using this tutorial but I am not sure where to find and edit the traefik.toml file

2021-05-26 01:03:32    分类:问答    docker   docker-compose   traefik

Traefik v2: 404 while routing HTTP traffic globally to HTTPS

I have the problem that I can route HTTPS traffic but I can not globally redirect the HTTP traffic to HTTPS. In my case I only want HTTPS traffic, so that I want to redirect all the incoming traffic. Currently I get an 404 error while I try to serve my URLs over HTTP. I already enabled DEBUG logs in Treafik, but I can not see any problems or unnormal stuff in the logs. Additionally I saw a pretty similar topic here on Stackoverflow, but we found out, that his error was not the same to mine: How to redirect http to https with Traefik 2.0 and Docker Compose labels? The following setup is based

2021-05-25 04:02:27    分类:问答    docker   docker-compose   docker-swarm   traefik

How to redirect http to https with Traefik 2.0 and Docker Compose labels?

Please note that it is a Traefik V2 question. I had a solution on V1 but V2 is a total rewamp. This above is supposed to redirect http://whoami.mysite.com to https://whoami.mysite.com. The https is working nicely. The http don't redirect to https and raise an error 404. There is no other file. All is in this Docker-compose.yml for the moment since it is a test to prepare further deployement. version: "3.3" services: traefik: image: "traefik:v2.0" container_name: "traefik" command: - "--log.level=DEBUG" - "--api.insecure=true" - "--providers.docker=true" - "--providers.docker.exposedbydefault

2021-05-17 12:38:34    分类:问答    docker   docker-compose   traefik