Skip to content

Instantly share code, notes, and snippets.

Avatar

Jakub Hajek jakubhajek

View GitHub Profile
@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 README.md
@jakubhajek
jakubhajek / compose-green.yml
Created Jan 13, 2020 — forked from pascalandy/compose-caddy.yml
Traefik V2 / my docker compose files
View compose-green.yml
version: "3.3"
services:
green:
image: containous/whoami:latest
container_name: green
hostname: green
restart: unless-stopped