Skip to content

Instantly share code, notes, and snippets.

Avatar
👋

Jakub Hajek jakubhajek

👋
View GitHub Profile
@jakubhajek
jakubhajek / questions-answers.md
Last active Aug 11, 2021
Gettting Started with Traefik on Kubernetes, Workshop #1, Q&A
View questions-answers.md

1. I am interested in monitoring traefik with Datadog. Is this workshop with this topic?

There is no dedicated workshop with the monitoring Traefik by using Datadog. I’ve found in Datadog docs how to configure DataDog Agent and tune Traefik configuration to collect the data. However, I’ve not tested that setup.

2. In terms of Capabilities, how would Traefik provide a value add over some in-built services such as Azure LB or App Gateway?

Here are just a few of advantages by using Traefik:

  • easier configuration / service discovery
  • single point TLS termination
@jakubhajek
jakubhajek / ingress.yaml
Last active Feb 21, 2021
Ingress configuration for Harbor running on Traefik
View ingress.yaml
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: harbor-portal
namespace: harbor
spec:
entryPoints:
- webs-int
routes:
@jakubhajek
jakubhajek / configmap.yaml
Created Feb 21, 2021
K8S config: nginx +web dav with pvc, configmap, env
View configmap.yaml
apiVersion: v1
data:
dav.conf: |
location /upload {
alias upload/data;
client_body_temp_path upload/client_tmp;
dav_methods PUT DELETE MKCOL COPY MOVE;
client_max_body_size 1500m;
@jakubhajek
jakubhajek / traefik.yml
Created Mar 16, 2020
The example of Traefik 2.x configuration that is set on startup.
View traefik.yml
log:
level: info
format: json
accessLog:
format: json
bufferingSize: 5
providers:
docker:
@jakubhajek
jakubhajek / canary.yml
Created Mar 16, 2020
The canary deployment approach using Traefik - the definition of weighted service
View canary.yml
http:
services:
canary:
weighted:
services:
# Load balancing between Traefik services
- name: app1_svc@docker
weight: 1
- name: app2_svc@docker
weight: 5
@jakubhajek
jakubhajek / stack-canary.yml
Created Mar 16, 2020
The example of canary deployment using Traefik 2.x
View stack-canary.yml
# docker stack deploy -c stack-canary.yml canary --with-registry-auth --prune
version: "3.7"
services:
app1:
image: jakubhajek/app1-node:v1
healthcheck:
test: wget --quiet --tries=1 --spider http://localhost:3000/ || exit 1
interval: 3s
timeout: 1s
View stack-app.yml
# docker stack deploy -c stack-app.yml app --with-registry-auth --prune
version: "3.7"
services:
backend:
image: jakubhajek/nodejs-backend:latest
healthcheck:
test: wget --quiet --tries=1 --spider http://localhost:3000/ || exit 1
interval: 3s
timeout: 1s
@jakubhajek
jakubhajek / middlewares.toml
Last active Oct 9, 2020
The configuration of Traefik v2 that can be defined dynamically
View middlewares.toml
[http]
[http.middlewares]
[http.middlewares.https-redirect.redirectscheme]
scheme = "https"
permanent = true
[http.middlewares.security-headers.headers]
# CORS
AccessControlAllowMethods = ["GET", "OPTIONS", "PUT"]
AccessControlAllowOrigin = "origin-list-or-null"
View strack-tr-main.yml
# docker stack deploy -c stack-tr-main.yml traefik --prune
version: "3.7"
services:
main:
image: traefik:v2.1.2
healthcheck:
test: wget --quiet --tries=1 --spider https://traefik.labs.cometari.eu/ping || exit 1
interval: 3s
timeout: 1s
View Elasticsearch 7.x on Docker Swarm
# Maintainer: Jakub Hajek, jakub.hajek@cometari.com
#
# docker stack deploy -c stack-elastic.yml elastic
#
# The stack creates Elasticsearch cluster consiting of
# - 3 dedicated master nodes in order to keep quorum
# - 4 dedicated data nodes to manage CRUD,
#
# Docker compose file to easily deploy Elasticsearch cluster 7.x on Docker Swarm cluster.