Skip to content

Instantly share code, notes, and snippets.

@lfache
lfache / CustomResourceDefinition.yaml
Created May 26, 2020 12:59
CustomResourceDefinition for Traefik 2.2 on Kubernetes
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ingressroutes.traefik.containo.us
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: IngressRoute
@lfache
lfache / gist:fca258bfde73066fea66f3888eb45622
Created May 26, 2020 13:15
Deployment.yaml for Traefik 2.2 on Kubernetes
apiVersion: v1
kind: Service
metadata:
name: traefik
spec:
ports:
- protocol: TCP
name: web
port: 80
- protocol: TCP
@lfache
lfache / whoami.yaml
Last active May 27, 2020 08:31
deployment for whoami only HTTP
kind: Deployment
apiVersion: apps/v1
metadata:
name: whoami-app
spec:
replicas: 1
selector:
matchLabels:
app: whoami-app
template:
@lfache
lfache / whoami.yaml
Created May 26, 2020 20:36
Whoami for Traefik example with HTTPS
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: ingressroutetls
spec:
entryPoints:
- websecure
routes:
- match: Host(`mydomain.com`)
kind: Rule
@lfache
lfache / gist:c57fb826e1fa236d5f99f3894969281a
Created May 26, 2020 21:03
Modify Traefik container for HTTP to HTTPS redirect
containers:
- name: traefik
image: traefik:v2.2
args:
- --api.insecure
- --accesslog
- --entrypoints.web.Address=:80
- --entrypoints.websecure.Address=:443
- --providers.kubernetescrd
- --entrypoints.web.http.redirections.entryPoint.to=:443
@lfache
lfache / deploy_on_aci.sh
Created May 30, 2020 12:07
Deploy container on ACI
az container create \
--resource-group myResourceGroup \
--name mycontainer \
--image mcr.microsoft.com/azuredocs/aci-helloworld \
--dns-name-label aci-demo \
--ports 80
@lfache
lfache / docker-compose.yaml
Created June 3, 2020 16:47
Matomo : docker-compose.yaml
version: "3.7"
services:
database:
image: mariadb:10
command: --max-allowed-packet=64MB
restart: unless-stopped
volumes:
- db:/var/lib/mysql
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
@lfache
lfache / docker-compose.yaml
Last active June 3, 2020 18:10
Matomo + Traefik : docker-compose.yaml
labels:
traefik.enable: true
traefik.docker.network: traefik_web
traefik.http.services.matomo.loadbalancer.server.port: 80
traefik.http.routers.matomo.rule: Host(`${MATOMO_URL}`)
traefik.http.routers.matomo.entrypoints: websecure
@lfache
lfache / cloud-config.yaml
Created June 5, 2020 22:06
Cloud Config : Ubuntu 20.04/Podman v2 compile
#cloud-config
package_update: true
packages:
- btrfs-progs
- conmon
- git
- golang-go
- go-md2man
- iptables
labels:
traefik.enable: true
traefik.docker.network: traefik_web
traefik.http.routers.nextcloud.entrypoints: websecure
traefik.http.routers.nextcloud.rule: 'Host(`${NEXTCLOUD_URL}`)'
traefik.http.services.nextcloud.loadbalancer.server.port: 80
traefik.http.middlewares.nextcloud-headers.headers.referrerpolicy: "same-origin"
traefik.http.routers.nextcloud.middlewares: 'nextcloud-headers'