Compare commits

...
Sign in to create a new pull request.

90 commits
WIP ... master

Author SHA1 Message Date
8e5db64b48
Update traefik to version 3.3.6 & helm chart to version 35.0.1 2025-04-19 11:14:34 +02:00
72c1cb7d9f
Update sablier to version 1.9.0 2025-04-12 14:33:13 +02:00
5c42a3ee27
Update traefik helm chart to version 35.0.0 2025-04-12 14:32:07 +02:00
fc93823122
Update versions, traefik: 3.3.5; traefik crds: 1.6.0; traefik helm chart: 34.5.0 2025-04-02 08:27:32 +02:00
cd264348ae
Update sablier to version 1.8.6 2025-03-05 08:07:16 +01:00
3b63848dcc
Update traefik helm chart to version 34.4.1, traefik crds helm chart to 1.5.0 2025-03-05 08:06:58 +01:00
a6846e75ab
Update traefik to version 3.3.4 2025-02-26 08:23:46 +01:00
51c4037041
Update traefik helm chart to version 34.4.0 2025-02-21 23:00:02 +01:00
d234920f99
Update crds chart to version 1.4.0 2025-02-21 22:59:16 +01:00
d54083e105
Update sablier to version 1.8.5 2025-02-21 22:56:39 +01:00
2e723a2e48
Update sablier to version 1.8.3 2025-02-08 13:37:26 +01:00
27f57467e5
Update traefik to version 3.3.3 2025-02-08 13:09:33 +01:00
3072bf1b85
Update traefik helm charts 2025-02-08 13:05:46 +01:00
8e722e7bbd
Update traefik helm charts 2025-01-18 13:21:01 +01:00
7b1dc133bc
Update sablier to version 1.8.2 2025-01-17 08:07:22 +01:00
bfbf42d6ea
Update traefik to version 3.3.1 2025-01-11 09:03:01 +01:00
fdac47a999
Update traefik to version 3.2.3 2024-12-17 06:48:23 +01:00
c6e526a873
Update traefik helm chart to version 33.2.1 2024-12-14 11:01:45 +01:00
c44b244662
Update traefik helm chart to version 33.2.0 2024-12-11 14:56:31 +01:00
8997b36ac9
Update traefik helm chart to version 33.1.0 & traefik to version 3.2.2 2024-12-11 10:38:34 +01:00
d720b16395
Update traefik to version 3.2.1 2024-11-20 22:28:14 +01:00
e55c12a65a
Fix sablier config 2024-11-16 23:57:46 +01:00
b8c2999185
Move external-dns annotation 2024-11-16 13:31:36 +01:00
2fd697e6af
Add comment to enable prometheus rules 2024-11-02 11:47:54 +01:00
d99b5686b5
Update traefik helm chart to version 33.0.0 2024-11-01 15:24:24 +01:00
793b10fbaf
Update traefik to version 3.2.0 2024-10-29 09:31:43 +01:00
c99b0c58ad
Reduce sablier RBAC permission 2024-10-25 09:56:21 +02:00
77a7accd51
Update Sablier to version 1.8.1 2024-10-25 01:20:38 +02:00
474c54804c
Update Sabllier to version 1.8.1 2024-10-21 09:34:25 +02:00
f83fd94ddf
Fix Sablier 2024-10-16 00:39:51 +02:00
ccf7bef5eb
Update traefik helm chart to version 32.1.1 2024-10-11 21:37:49 +02:00
3e53d8fb91
Update traefik to version 3.1.6 2024-10-10 14:53:52 +02:00
dd782d4e32
Update traefik helm chart to version 32.1.0 & traefik to version 3.1.5 2024-10-08 07:18:15 +02:00
0dcdedf829
Update min_security middleware 2024-10-02 09:08:01 +02:00
24d977621b
Add forgotten file 2024-09-28 18:55:56 +02:00
232cd4de5d
Update traefik role 2024-09-28 18:55:34 +02:00
8db2742da0
fix yaml template 2024-09-13 14:16:59 +02:00
62961f7e06
Switch plugin traefik-on-demand by sablier 2024-09-09 00:07:23 +02:00
48c523ec9a
Add servers transport file 2024-09-08 13:47:46 +02:00
6b03163f05
Update traefik to version 3.0.4 2024-07-07 11:19:43 +02:00
f14a292a35
Update ServiceMonitor configuration 2024-06-28 11:28:53 +02:00
8d4a335e40
Enable ServiceMonitor 2024-06-26 23:40:57 +02:00
c5ef11e9e0
Add grafana dashboard 2024-06-26 23:34:24 +02:00
5eaa1c24af
Add link for traefik helm chart 2024-05-04 13:49:52 +02:00
0ff12a846f
Update to traefik v3 2024-05-04 13:39:47 +02:00
a4d8db4653
Add wip for dashboard 2023-11-18 10:13:54 +01:00
dda4c70a95
Fix another lint errors
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-24 12:13:45 +02:00
1be87b3bb4
Fix lint error
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-07-24 12:07:32 +02:00
8a6b74906e
Enable http/3
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2023-07-20 13:15:16 +02:00
37c90c3c42
WIP Switchboard 2023-07-20 13:14:31 +02:00
c96e8274a9
Update traefik to version 2.10.3 2023-07-20 13:14:09 +02:00
23e0c8a91e
Fix hostport deployment
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-23 17:09:22 +02:00
2a2161a25d
Update traefik deployment
All checks were successful
continuous-integration/drone/push Build is passing
2022-12-07 11:24:40 +01:00
4e55bc09af
Update traefik & crowdsec traefik bouncer
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-18 00:18:20 +02:00
382cc69b2c
Update traefik deployment
All checks were successful
continuous-integration/drone/push Build is passing
2022-10-05 11:16:48 +02:00
a102ba09a7
Fix lint errors
All checks were successful
continuous-integration/drone/push Build is passing
2022-07-23 01:07:41 +02:00
44b97e681c
Fix lint errors
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2022-07-23 01:03:23 +02:00
daaed8df51
Fix collections names
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2022-07-16 23:33:49 +02:00
ba1319aeef
Add ondemand plugin
Some checks reported errors
continuous-integration/drone/push Build encountered an error
2022-07-16 23:31:42 +02:00
e76a31ffeb
Traefik-hub deployment
All checks were successful
continuous-integration/drone/push Build is passing
2022-06-24 02:25:41 +02:00
7ced7add47
Update traefik to version 2.7.1 2022-06-24 02:24:02 +02:00
ebc0f4bdfc
Enable plugins
All checks were successful
continuous-integration/drone/push Build is passing
2022-06-15 19:56:54 +02:00
6def4562ad
Update traefik deployment + add crowdsec bouncer
All checks were successful
continuous-integration/drone/push Build is passing
2022-06-05 11:27:24 +02:00
736ac64ff0
Add test with nodeports
All checks were successful
continuous-integration/drone/push Build is passing
2022-05-10 00:35:31 +02:00
eb0b205efb
Update traefik conf
All checks were successful
continuous-integration/drone/push Build is passing
2022-05-04 00:04:09 +02:00
1fccb6896e
Add chain middleware exemple
All checks were successful
continuous-integration/drone/push Build is passing
2022-04-02 11:15:52 +02:00
5456ce68ef
Fix authelia middleware
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-26 00:04:37 +01:00
49f9f0be08
Prepare default backend 2022-03-26 00:04:05 +01:00
34a9cc12e5
Add comment
All checks were successful
continuous-integration/drone/push Build is passing
2022-03-16 18:11:29 +01:00
c0bfc09c8c
Update role
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-26 00:46:31 +01:00
a5a52b15c8
Fix template
All checks were successful
continuous-integration/drone/push Build is passing
2022-02-25 00:39:05 +01:00
a722a1d783
Use helm template values file 2022-02-25 00:38:43 +01:00
b3df6499f3
Update API 2022-02-25 00:38:10 +01:00
ee4e749cd3
Update traefik deployment
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-31 21:15:56 +01:00
0735682969
Deploy without hostport
All checks were successful
continuous-integration/drone/push Build is passing
2021-12-25 01:56:25 +01:00
288a4454da
Add defaults middleware in comments for future use 2021-12-25 01:55:56 +01:00
917c6bdc26
Update port name 2021-12-25 01:55:08 +01:00
771371672f
Update files provider 2021-12-25 01:54:48 +01:00
50d1adfe4e
Update meta 2021-12-25 01:53:07 +01:00
6e87290774
Update traefik version to 2.4.1
All checks were successful
continuous-integration/drone/push Build is passing
2021-02-01 23:32:03 +01:00
0f90bb8c99
Simplify traefik version management
All checks were successful
continuous-integration/drone/push Build is passing
2021-01-30 11:05:59 +01:00
23413944f5
Fix another lint
All checks were successful
continuous-integration/drone/push Build is passing
2021-01-23 17:36:30 +01:00
f67680e0a0
Fix lint
Some checks failed
continuous-integration/drone/push Build is failing
2021-01-23 17:35:21 +01:00
25e17131ec
fix context
Some checks failed
continuous-integration/drone/push Build is failing
2021-01-23 01:49:17 +01:00
2bb4b4e4a6 Merge pull request 'Use helm, don't manage traefik manifest any more' (#2) from WIP2 into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #2
2021-01-18 23:05:54 +00:00
88bdd20377
Use helm to deploy traefik
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-01-19 00:00:47 +01:00
bdbf908070
Update traefik to version 2.3.7
All checks were successful
continuous-integration/drone/push Build is passing
2021-01-11 22:48:28 +01:00
0e6f763db5 Use helm and local provider
All checks were successful
continuous-integration/drone/push Build is passing
2020-12-19 13:20:57 +01:00
d44bea3d66 Update traefik version
All checks were successful
continuous-integration/drone/push Build is passing
2020-11-26 22:09:21 +01:00
353cce9599 Merge pull request 'Traefik 2.3 et PSP fonctionnent' (#1) from WIP into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #1
2020-11-03 23:33:04 +00:00
62 changed files with 2509 additions and 1621 deletions

View file

@ -1,7 +1,7 @@
---
kind: pipeline
type: kubernetes
#type: docker
# type: docker
name: default
steps:

View file

@ -1,19 +1,29 @@
my_context: kubernetes
traefik_version: "2.3"
traefik_domain: "local"
traefik_version: "3.3.6"
traefik_helm_chart_version: "35.0.1"
traefikcrds_helm_chart_version: "1.6.0"
cluster_domain: "local"
traefik_namespace: "traefik"
#ingress_whitelist:
# - 10.96.0.0/12
# - 10.244.0.0/16
# - 192.168.0.0/24
#traefik_node_selector:
# - localhost
traefik_service_type: LoadBalancer
# ingress_whitelist:
# - 10.96.0.0/12
# - 10.244.0.0/16
# - 192.168.0.0/24
# traefik_node_selector:
# - localhost
traefik_cpu_limit: 500m
traefik_memory_limit: 300Mi
traefik_entrypoints:
- { name: "http", port: 8000, proto: "TCP", hostport: 80 }
- { name: "https", port: 4443, proto: "TCP", hostport: 443, tls: true }
- { name: "traefik", port: 8080, proto: "TCP" }
traefik_entrypoints: []
# - { name: "http", port: 8000, proto: "TCP", hostport: 80 middlewares: ["{{ traefik_namespace }}-crowdsec-traefik-bouncer@kubernetescrd"] }
# - { name: "https", port: 4443, proto: "TCP", hostport: 443, tls: true middlewares: ["{{ traefik_namespace }}-crowdsec-traefik-bouncer@kubernetescrd"] }
# - { name: "traefik", port: 8080, proto: "TCP" }
# traefik_external_ips: []
# - 1.2.3.4
basic_auth: false
#traefik_dashboard_certificate: wildcard-cluster
# traefik_dashboard_certificate: wildcard-cluster
crowdsec_namespace: "crowdsec"
crowdsec_traefik_bouncer_chart_version: "0.1.3"
traefik_sabblier_version: "1.9.0"

1523
files/grafana-dashboard.yml Normal file

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,9 @@ galaxy_info:
min_ansible_version: 2.6
galaxy_tags: []
license: GPL2
collections:
- kubernetes.core
platforms:
- name: kubernetes
version:
- all
- name: kubernetes
version:
- all

View file

@ -1,120 +1,257 @@
- name: traefik setup
block:
- name: namespace
k8s:
state: present
context: "{{ my_context }}"
merge_type: merge
definition:
api_version: v1
kind: Namespace
metadata:
name: traefik
labels:
namespace: '{{ traefik_namespace }}'
# - name: Deploy Traefik CRDs
# kubernetes.core.k8s:
# state: present
# context: "{{ my_context }}"
# apply: true
# definition: "{{ lookup('url', item , split_lines=False) | from_yaml_all }}"
# with_items:
## - "https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.2.0/standard-install.yaml"
# - "https://raw.githubusercontent.com/traefik/traefik/v3.2/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml"
## - "https://raw.githubusercontent.com/traefik/traefik/v3.2/docs/content/reference/dynamic-configuration/kubernetes-crd-rbac.yml"
## ansible.builtin.command: >
## kubectl --context "{{ my_context }}" apply --server-side --force-conflicts -k
## https://github.com/traefik/traefik-helm-chart/tree/v{{ traefik_helm_chart_version }}/traefik/crds/
- name: namespace
kubernetes.core.k8s:
state: present
context: "{{ my_context }}"
merge_type: merge
definition:
api_version: v1
kind: Namespace
metadata:
name: '{{ traefik_namespace }}'
labels:
namespace: '{{ traefik_namespace }}'
- name: Create a Secret object for basic authentification
k8s:
state: present
context: "{{ my_context }}"
definition:
apiVersion: v1
kind: Secret
metadata:
name: basic-auth
namespace: '{{ traefik_namespace }}'
type: Opaque
data:
basic_auth: "{{ basic_auth_data | b64encode }}"
when:
- basic_auth|bool
- name: Create a Secret object for basic authentification
kubernetes.core.k8s:
state: present
context: "{{ my_context }}"
namespace: '{{ traefik_namespace }}'
definition:
apiVersion: v1
kind: Secret
metadata:
name: basic-auth
type: Opaque
data:
basic_auth: "{{ basic_auth_data | b64encode }}"
when:
- basic_auth|bool
- name: Add host label for traefik deployment
k8s:
state: present
context: "{{ my_context }}"
definition:
apiVersion: v1
kind: Node
metadata:
name: "{{ item }}"
labels:
entrypoint: traefik
with_items:
- '{{ traefik_node_selector }}'
when:
- traefik_node_selector is defined
- name: Add host label for traefik deployment
kubernetes.core.k8s:
state: present
context: "{{ my_context }}"
definition:
apiVersion: v1
kind: Node
metadata:
name: "{{ item }}"
labels:
entrypoint: traefik
with_items:
- '{{ traefik_node_selector }}'
when:
- traefik_node_selector is defined
- name: Get Deployment information object
k8s_info:
context: "{{ my_context }}"
api_version: v1
kind: DaemonSet
name: traefik
namespace: '{{ traefik_namespace }}'
field_selectors:
- spec.template.spec.containers.image
register: traefik_actual_resources
- name: Deploy latest version of CrowdSec Traefik bouncer
kubernetes.core.helm:
context: "{{ my_context }}"
name: crowdsec-traefik-bouncer
release_namespace: "{{ traefik_namespace }}"
create_namespace: true
chart_ref: crowdsec/crowdsec-traefik-bouncer
chart_version: "{{ crowdsec_traefik_bouncer_chart_version }}"
values:
image:
tag: "0.5.0"
bouncer:
crowdsec_bouncer_api_key: "{{ traefik_crowdsec_bouncer_apikey }}"
crowdsec_agent_host: "crowdsec-service.{{ crowdsec_namespace }}.svc.cluster.local:8080"
crowdsec_bouncer_gin_mode: "release"
replicaCount: 1
podSecurityContext:
fsGroup: 2000
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
when:
- traefik_crowdsec_bouncer_apikey is defined
- name: Retreive actual traefik version
shell: echo "{{ traefik_actual_resources.resources }}" | sed "s/.*traefik:\([0-9]\.[0-9]*\).*/\1/" | uniq
register: traefik_actual_version
# - name: Get Deployment information object
# kubernetes.core.k8s_info:
# context: "{{ my_context }}"
# api_version: v1
# kind: DaemonSet
# name: traefik
# namespace: '{{ traefik_namespace }}'
# field_selectors:
# - spec.template.spec.containers.image
# register: traefik_actual_resources
#
# - name: Retreive actual traefik version
# ansible.builtin.shell: echo "{{ traefik_actual_resources.resources }}" | sed "s/.*traefik:\([0-9]\.[0-9]*\).*/\1/" | uniq
# register: traefik_actual_version
#
# - name: Remove old traefik version {{ traefik_actual_version.stdout }}
# kubernetes.core.k8s:
# state: "absent"
# context: "{{ my_context }}"
# resource_definition: "{{ lookup('template', item) | from_yaml }}"
# with_items:
# - "{{ lookup('vars', 'traefik_' + traefik_actual_version.stdout | regex_replace('[.]','_') + '_list') | reverse | list }}"
## - hostvars[inventory_hostname]['traefik_' + traefik_actual_version.stdout + '_list'] | reverse
# when:
# - not traefik_actual_version.stdout == "[]"
# - not traefik_version == traefik_actual_version.stdout
# - traefik_actual_version.stdout is version(traefik_version, '>')
- name: Remove old traefik version {{ traefik_actual_version.stdout }}
k8s:
state: "absent"
context: "{{ my_context }}"
resource_definition: "{{ lookup('template', item) | from_yaml }}"
with_items:
- "{{ lookup('vars', 'traefik_' + traefik_actual_version.stdout | regex_replace('[.]','_') + '_list') | reverse | list }}"
# - hostvars[inventory_hostname]['traefik_' + traefik_actual_version.stdout + '_list'] | reverse
when:
- not traefik_actual_version.stdout == "[]"
- not traefik_version == traefik_actual_version.stdout
- traefik_actual_version.stdout is version(traefik_version, '>')
# https://github.com/traefik/traefik-helm-chart
- name: Defined traefik repository
kubernetes.core.helm_repository:
name: traefik
repo_url: "https://helm.traefik.io/traefik"
- name: Deploy Traefik CRDs
kubernetes.core.helm:
context: "{{ my_context }}"
name: traefik-crds
chart_ref: traefik/traefik-crds
chart_version: "{{ traefikcrds_helm_chart_version }}"
release_namespace: "{{ traefik_namespace }}"
create_namespace: true
# - name: show templating results
# ansible.builtin.debug:
# msg: "{{ lookup('ansible.builtin.template', 'traefik-helm-value.yaml.j2') }}"
- name: Deploy latest version of Traefik
kubernetes.core.helm:
context: "{{ my_context }}"
name: traefik
chart_ref: traefik/traefik
chart_version: "{{ traefik_helm_chart_version }}"
release_namespace: "{{ traefik_namespace }}"
create_namespace: true
skip_crds: true
values: "{{ lookup('template', 'traefik-helm-value.yaml.j2') | from_yaml }}"
- name: Install traefik version {{ traefik_version }}
k8s:
state: "present"
context: "{{ my_context }}"
namespace: '{{ traefik_namespace }}'
merge_type: merge
resource_definition: "{{ lookup('template', item) | from_yaml }}"
with_items:
- "{{ lookup('vars', 'traefik_' + traefik_version | regex_replace('[.]','_') + '_list') }}"
- traefik-psp.yml.j2
- traefik-cm.yml.j2
- traefik-sa.yml.j2
- traefik-dp.yml.j2
# - traefik-svc.yml.j2
# - traefik-dashboard-svc.yml.j2
- traefik-middleware-httpsredirect.yml.j2
- traefik-middleware-basicauth.yml.j2
- traefik-middleware-headers.yml.j2
- traefik-tls-options.yml.j2
- traefik-ingressroute.yml.j2
- traefik-dashboard-insecure.yml.j2
# - traefik-ping.yml.j2
- name: Install traefik configuration
kubernetes.core.k8s:
state: "present"
context: "{{ my_context }}"
namespace: '{{ traefik_namespace }}'
# merge_type: merge
apply: true
resource_definition: "{{ lookup('template', item) | from_yaml_all }}"
with_items:
- default-network-dns-policy.yaml.j2
# - "{{ lookup('vars', 'traefik_' + traefik_version | regex_replace('[.]','_') + '_list') }}"
- traefik-certificate.yml.j2
- traefik-cm.yml.j2
- traefik-files.yml.j2
# - traefik-sa.yml.j2
- traefik-ingressroute.yml.j2
# - traefik-svc.yml.j2
# - traefik-defaultbackend.yml.j2
- name: Install traefik plugin's
kubernetes.core.k8s:
state: "present"
context: "{{ my_context }}"
namespace: '{{ traefik_namespace }}'
# merge_type: merge
apply: true
resource_definition: "{{ lookup('template', item) | from_yaml_all }}"
with_items:
- traefik-ondemand-plugin.yml.j2
when:
- traefik_ondemand is defined
- name: Define state of ipwhitelist middleware to present
set_fact:
traefik_ipwhitelist_state: present
when:
- traefik_version | regex_search('(^2.)')
- ingress_whitelist is defined
- name: Define state of ipwhitelist middleware to absent
set_fact:
traefik_ipwhitelist_state: absent
when:
- not ingress_whitelist is defined or traefik_ipwhitelist_state is not defined
- name: IP white list need to be {{ traefik_ipwhitelist_state }}
k8s:
state: "{{ traefik_ipwhitelist_state }}"
context: "{{ my_context }}"
merge_type: merge
resource_definition: "{{ lookup('template', item) | from_yaml }}"
with_items:
- traefik-middleware-ipwhitelist.yml.j2
- name: ReInstall traefik-hub certificate if already know
kubernetes.core.k8s:
state: "present"
context: "{{ my_context }}"
namespace: '{{ traefik_namespace }}'
# merge_type: merge
# apply: true
resource_definition: "{{ lookup('template', item) | from_yaml_all }}"
with_items:
- traefik-hub-certificate.yml.j2
when:
- traefik_hub_tlscrt is defined
- traefik_hub_tlskey is defined
- name: Defined traefik-hub repository
kubernetes.core.helm_repository:
name: traefik-hub
repo_url: "https://helm.traefik.io/hub"
when:
- traefik_hub_token is defined
- name: Deploy latest version of Traefik-hub
kubernetes.core.helm:
context: "{{ my_context }}"
name: hub-agent
chart_ref: traefik-hub/hub-agent
release_namespace: "{{ traefik_namespace }}"
values:
token: "{{ traefik_hub_token }}"
when:
- traefik_hub_token is defined
# echo 'apiVersion: v1
# kind: Service
# metadata:
# annotations:
# # external-dns.alpha.kubernetes.io/endpoints-type: HostIP
# external-dns.alpha.kubernetes.io/hostname: traefik.ibm.reslinger.net
# external-dns.alpha.kubernetes.io/endpoints-type: NodeExternalIP
# # external-dns.alpha.kubernetes.io/target: "1.2.3.4"
# name: traefik-dns
# namespace: traefik
# spec:
# clusterIP: None
# ports:
# - name: web
# port: 80
# protocol: TCP
# targetPort: web
# - name: websecure
# port: 443
# protocol: TCP
# targetPort: websecure
# selector:
# app.kubernetes.io/instance: traefik-traefik
# app.kubernetes.io/name: traefik' | kubectl --context kubeibm -n traefik apply -f -
# - name: Deploy latest version of Switchboard
# kubernetes.core.helm:
# context: "{{ my_context }}"
# name: switchboard
# chart_ref: oci://ghcr.io/borchero/charts/switchboard
# release_namespace: "{{ traefik_namespace }}"
# # values: "{{ lookup('template', 'traefik-helm-value.yaml.j2') | from_yaml }}"
# values:
# integrations:
# # certManager:
# # enabled: true
# # issuer: "letsencrypt-prod"
# externalDNS:
# enabled: true
# targetIPs: [10.144.217.172]
- name: Install traefik grafana dashboard
kubernetes.core.k8s:
state: "present"
context: "{{ my_context }}"
namespace: 'traefik'
apply: yes
resource_definition: "{{ lookup('file', item) | from_yaml_all }}"
with_items:
- grafana-dashboard.yml
tags: traefik

View file

@ -1,62 +0,0 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: traefik-ingress-controller
rules:
- apiGroups:
- ""
resources:
- services
- endpoints
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- ingresses
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- ingresses/status
verbs:
- update
- apiGroups:
- traefik.containo.us
resources:
- middlewares
verbs:
- get
- list
- watch
- apiGroups:
- traefik.containo.us
resources:
- ingressroutes
verbs:
- get
- list
- watch
- apiGroups:
- traefik.containo.us
resources:
- ingressroutetcps
verbs:
- get
- list
- watch
- apiGroups:
- traefik.containo.us
resources:
- tlsoptions
verbs:
- get
- list
- watch

View file

@ -1,13 +0,0 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: traefik-ingress-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: traefik-ingress-controller
subjects:
- kind: ServiceAccount
name: traefik-ingress-controller
namespace: traefik

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ingressroutes.traefik.containo.us
namespace: traefik
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: IngressRoute
plural: ingressroutes
singular: ingressroute
scope: Namespaced

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ingressroutetcps.traefik.containo.us
namespace: traefik
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: IngressRouteTCP
plural: ingressroutetcps
singular: ingressroutetcp
scope: Namespaced

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: middlewares.traefik.containo.us
namespace: traefik
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: Middleware
plural: middlewares
singular: middleware
scope: Namespaced

View file

@ -1,13 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: tlsoptions.traefik.containo.us
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: TLSOption
plural: tlsoptions
singular: tlsoption
scope: Namespaced

View file

@ -1,157 +0,0 @@
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: wrr2
namespace: {{ traefik_namespace }}
spec:
weighted:
services:
- name: s1
weight: 1
port: 80
# Optional, as it is the default value
kind: Service
- name: s3
weight: 1
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: wrr1
namespace: {{ traefik_namespace }}
spec:
weighted:
services:
- name: wrr2
kind: TraefikService
weight: 1
- name: s3
weight: 1
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: mirror1
namespace: {{ traefik_namespace }}
spec:
mirroring:
name: s1
port: 80
mirrors:
- name: s3
percent: 20
port: 80
- name: mirror2
kind: TraefikService
percent: 20
---
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: mirror2
namespace: {{ traefik_namespace }}
spec:
mirroring:
name: wrr2
kind: TraefikService
mirrors:
- name: s2
# Optional, as it is the default value
kind: Service
percent: 20
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: ingressroute
spec:
entryPoints:
- web
- websecure
routes:
- match: Host(`foo.com`) && PathPrefix(`/bar`)
kind: Rule
priority: 12
# defining several services is possible and allowed, but for now the servers of
# all the services (for a given route) get merged altogether under the same
# load-balancing strategy.
services:
- name: s1
port: 80
healthCheck:
path: /health
host: baz.com
intervalSeconds: 7
timeoutSeconds: 60
# strategy defines the load balancing strategy between the servers. It defaults
# to Round Robin, and for now only Round Robin is supported anyway.
strategy: RoundRobin
- name: s2
port: 433
healthCheck:
path: /health
host: baz.com
intervalSeconds: 7
timeoutSeconds: 60
- match: PathPrefix(`/misc`)
services:
- name: s3
port: 80
middlewares:
- name: stripprefix
- name: addprefix
- match: PathPrefix(`/misc`)
services:
- name: s3
# Optional, as it is the default value
kind: Service
port: 8443
# scheme allow to override the scheme for the service. (ex: https or h2c)
scheme: https
- match: PathPrefix(`/lb`)
services:
- name: wrr1
kind: TraefikService
- match: PathPrefix(`/mirrored`)
services:
- name: mirror1
kind: TraefikService
# use an empty tls object for TLS with Let's Encrypt
tls:
secretName: supersecret
options:
name: myTLSOption
namespace: default
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
name: ingressroutetcp.crd
namespace: default
spec:
entryPoints:
- footcp
routes:
- match: HostSNI(`bar.com`)
services:
- name: whoamitcp
port: 8080
tls:
secretName: foosecret
passthrough: false
options:
name: myTLSOption
namespace: default

View file

@ -1,42 +0,0 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: traefik-ingress-controller
rules:
- apiGroups:
- ""
resources:
- services
- endpoints
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- ingresses
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- ingresses/status
verbs:
- update
- apiGroups:
- traefik.containo.us
resources:
- middlewares
- ingressroutes
- traefikservices
- ingressroutetcps
- tlsoptions
verbs:
- get
- list
- watch

View file

@ -1,13 +0,0 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: traefik-ingress-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: traefik-ingress-controller
subjects:
- kind: ServiceAccount
name: traefik-ingress-controller
namespace: {{ traefik_namespace }}

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ingressroutes.traefik.containo.us
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: IngressRoute
plural: ingressroutes
singular: ingressroute
scope: Namespaced

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ingressroutetcps.traefik.containo.us
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: IngressRouteTCP
plural: ingressroutetcps
singular: ingressroutetcp
scope: Namespaced

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: middlewares.traefik.containo.us
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: Middleware
plural: middlewares
singular: middleware
scope: Namespaced

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: tlsoptions.traefik.containo.us
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: TLSOption
plural: tlsoptions
singular: tlsoption
scope: Namespaced

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: traefikservices.traefik.containo.us
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: TraefikService
plural: traefikservices
singular: traefikservice
scope: Namespaced

View file

@ -1,157 +0,0 @@
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: wrr2
namespace: {{ traefik_namespace }}
spec:
weighted:
services:
- name: s1
weight: 1
port: 80
# Optional, as it is the default value
kind: Service
- name: s3
weight: 1
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: wrr1
namespace: {{ traefik_namespace }}
spec:
weighted:
services:
- name: wrr2
kind: TraefikService
weight: 1
- name: s3
weight: 1
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: mirror1
namespace: {{ traefik_namespace }}
spec:
mirroring:
name: s1
port: 80
mirrors:
- name: s3
percent: 20
port: 80
- name: mirror2
kind: TraefikService
percent: 20
---
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: mirror2
namespace: {{ traefik_namespace }}
spec:
mirroring:
name: wrr2
kind: TraefikService
mirrors:
- name: s2
# Optional, as it is the default value
kind: Service
percent: 20
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: ingressroute
spec:
entryPoints:
- web
- websecure
routes:
- match: Host(`foo.com`) && PathPrefix(`/bar`)
kind: Rule
priority: 12
# defining several services is possible and allowed, but for now the servers of
# all the services (for a given route) get merged altogether under the same
# load-balancing strategy.
services:
- name: s1
port: 80
healthCheck:
path: /health
host: baz.com
intervalSeconds: 7
timeoutSeconds: 60
# strategy defines the load balancing strategy between the servers. It defaults
# to Round Robin, and for now only Round Robin is supported anyway.
strategy: RoundRobin
- name: s2
port: 433
healthCheck:
path: /health
host: baz.com
intervalSeconds: 7
timeoutSeconds: 60
- match: PathPrefix(`/misc`)
services:
- name: s3
port: 80
middlewares:
- name: stripprefix
- name: addprefix
- match: PathPrefix(`/misc`)
services:
- name: s3
# Optional, as it is the default value
kind: Service
port: 8443
# scheme allow to override the scheme for the service. (ex: https or h2c)
scheme: https
- match: PathPrefix(`/lb`)
services:
- name: wrr1
kind: TraefikService
- match: PathPrefix(`/mirrored`)
services:
- name: mirror1
kind: TraefikService
# use an empty tls object for TLS with Let's Encrypt
tls:
secretName: supersecret
options:
name: myTLSOption
namespace: default
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
name: ingressroutetcp.crd
namespace: default
spec:
entryPoints:
- footcp
routes:
- match: HostSNI(`bar.com`)
services:
- name: whoamitcp
port: 8080
tls:
secretName: foosecret
passthrough: false
options:
name: myTLSOption
namespace: default

View file

@ -1,48 +0,0 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: traefik-ingress-controller
rules:
- apiGroups: ['policy']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames: ['traefik-ingress-controller']
- apiGroups:
- ""
resources:
- services
- endpoints
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- ingresses
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- ingresses/status
verbs:
- update
- apiGroups:
- traefik.containo.us
resources:
- middlewares
- ingressroutes
- traefikservices
- ingressroutetcps
- ingressrouteudps
- tlsoptions
- tlsstores
verbs:
- get
- list
- watch

View file

@ -1,13 +0,0 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: traefik-ingress-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: traefik-ingress-controller
subjects:
- kind: ServiceAccount
name: traefik-ingress-controller
namespace: {{ traefik_namespace }}

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ingressroutes.traefik.containo.us
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: IngressRoute
plural: ingressroutes
singular: ingressroute
scope: Namespaced

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ingressroutetcps.traefik.containo.us
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: IngressRouteTCP
plural: ingressroutetcps
singular: ingressroutetcp
scope: Namespaced

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ingressrouteudps.traefik.containo.us
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: IngressRouteUDP
plural: ingressrouteudps
singular: ingressrouteudp
scope: Namespaced

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: middlewares.traefik.containo.us
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: Middleware
plural: middlewares
singular: middleware
scope: Namespaced

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: tlsoptions.traefik.containo.us
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: TLSOption
plural: tlsoptions
singular: tlsoption
scope: Namespaced

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: tlsstores.traefik.containo.us
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: TLSStore
plural: tlsstores
singular: tlsstore
scope: Namespaced

View file

@ -1,16 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: traefikservices.traefik.containo.us
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: TraefikService
plural: traefikservices
singular: traefikservice
scope: Namespaced

View file

@ -1,157 +0,0 @@
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: wrr2
namespace: {{ traefik_namespace }}
spec:
weighted:
services:
- name: s1
weight: 1
port: 80
# Optional, as it is the default value
kind: Service
- name: s3
weight: 1
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: wrr1
namespace: {{ traefik_namespace }}
spec:
weighted:
services:
- name: wrr2
kind: TraefikService
weight: 1
- name: s3
weight: 1
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: mirror1
namespace: {{ traefik_namespace }}
spec:
mirroring:
name: s1
port: 80
mirrors:
- name: s3
percent: 20
port: 80
- name: mirror2
kind: TraefikService
percent: 20
---
apiVersion: traefik.containo.us/v1alpha1
kind: TraefikService
metadata:
name: mirror2
namespace: {{ traefik_namespace }}
spec:
mirroring:
name: wrr2
kind: TraefikService
mirrors:
- name: s2
# Optional, as it is the default value
kind: Service
percent: 20
port: 80
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: ingressroute
spec:
entryPoints:
- web
- websecure
routes:
- match: Host(`foo.com`) && PathPrefix(`/bar`)
kind: Rule
priority: 12
# defining several services is possible and allowed, but for now the servers of
# all the services (for a given route) get merged altogether under the same
# load-balancing strategy.
services:
- name: s1
port: 80
healthCheck:
path: /health
host: baz.com
intervalSeconds: 7
timeoutSeconds: 60
# strategy defines the load balancing strategy between the servers. It defaults
# to Round Robin, and for now only Round Robin is supported anyway.
strategy: RoundRobin
- name: s2
port: 433
healthCheck:
path: /health
host: baz.com
intervalSeconds: 7
timeoutSeconds: 60
- match: PathPrefix(`/misc`)
services:
- name: s3
port: 80
middlewares:
- name: stripprefix
- name: addprefix
- match: PathPrefix(`/misc`)
services:
- name: s3
# Optional, as it is the default value
kind: Service
port: 8443
# scheme allow to override the scheme for the service. (ex: https or h2c)
scheme: https
- match: PathPrefix(`/lb`)
services:
- name: wrr1
kind: TraefikService
- match: PathPrefix(`/mirrored`)
services:
- name: mirror1
kind: TraefikService
# use an empty tls object for TLS with Let's Encrypt
tls:
secretName: supersecret
options:
name: myTLSOption
namespace: default
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
name: ingressroutetcp.crd
namespace: default
spec:
entryPoints:
- footcp
routes:
- match: HostSNI(`bar.com`)
services:
- name: whoamitcp
port: 8080
tls:
secretName: foosecret
passthrough: false
options:
name: myTLSOption
namespace: default

View file

@ -1,50 +0,0 @@
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: traefik-ingress-controller
rules:
- apiGroups: ['policy']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames: ['traefik-ingress-controller']
- apiGroups:
- ""
resources:
- services
- endpoints
- secrets
verbs:
- get
- list
- watch
- apiGroups:
- extensions
- networking.k8s.io
resources:
- ingresses
- ingressclasses
verbs:
- get
- list
- watch
- apiGroups:
- extensions
resources:
- ingresses/status
verbs:
- update
- apiGroups:
- traefik.containo.us
resources:
- middlewares
- ingressroutes
- traefikservices
- ingressroutetcps
- ingressrouteudps
- tlsoptions
- tlsstores
verbs:
- get
- list
- watch

View file

@ -1,13 +0,0 @@
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: traefik-ingress-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: traefik-ingress-controller
subjects:
- kind: ServiceAccount
name: traefik-ingress-controller
namespace: {{ traefik_namespace }}

View file

@ -1,13 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ingressroutes.traefik.containo.us
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: IngressRoute
plural: ingressroutes
singular: ingressroute
scope: Namespaced

View file

@ -1,13 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ingressroutetcps.traefik.containo.us
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: IngressRouteTCP
plural: ingressroutetcps
singular: ingressroutetcp
scope: Namespaced

View file

@ -1,13 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ingressrouteudps.traefik.containo.us
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: IngressRouteUDP
plural: ingressrouteudps
singular: ingressrouteudp
scope: Namespaced

View file

@ -1,13 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: middlewares.traefik.containo.us
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: Middleware
plural: middlewares
singular: middleware
scope: Namespaced

View file

@ -1,13 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: tlsoptions.traefik.containo.us
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: TLSOption
plural: tlsoptions
singular: tlsoption
scope: Namespaced

View file

@ -1,13 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: tlsstores.traefik.containo.us
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: TLSStore
plural: tlsstores
singular: tlsstore
scope: Namespaced

View file

@ -1,13 +0,0 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: traefikservices.traefik.containo.us
spec:
group: traefik.containo.us
version: v1alpha1
names:
kind: TraefikService
plural: traefikservices
singular: traefikservice
scope: Namespaced

View file

@ -0,0 +1,46 @@
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: intra-namespace
spec:
podSelector: {}
ingress:
- from:
- namespaceSelector:
matchLabels:
name: {{ traefik_namespace }}
#---
#apiVersion: networking.k8s.io/v1
#kind: NetworkPolicy
#metadata:
# name: allow-dns-access
#spec:
# podSelector:
# matchLabels: {}
# policyTypes:
# - Egress
# egress:
# - to:
# - namespaceSelector:
# matchLabels:
# kubernetes.io/metadata.name: kube-system
# podSelector:
# matchLabels:
# k8s-app: kube-dns
# ports:
# - protocol: UDP
# port: 53
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-all-traefik-v121-ingress
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: traefik
ingress:
- {}
policyTypes:
- Ingress

View file

@ -0,0 +1,12 @@
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: traefik.{{ cluster_domain }}
spec:
dnsNames:
- traefik.{{ cluster_domain }}
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
secretName: traefik.{{ cluster_domain }}

View file

@ -1,4 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: traefik
name: traefik-conf
data:
traefik.yaml: |
global:
@ -7,51 +12,114 @@ data:
serversTransport:
insecureSkipVerify: true
entryPoints:
web:
address: ":8000/tcp"
http:
# middlewares:
# - auth@file
# - secure_headers@file
# - crowdsec-bouncer@file
# - {{ traefik_namespace }}-crowdsec-traefik-bouncer@kubernetescrd
redirections:
entryPoint:
to: websecure
scheme: https
permanent: true
websecure:
address: ":8443"
http:
tls:
options: default
# middlewares:
# - auth@file
# - secure_headers@file
# - crowdsec-bouncer@file
http3:
advertisedPort: 443
traefik:
address: ":8080/tcp"
metrics:
address: ":9100/tcp"
{% if traefik_hub_token is defined %}
traefikhub-api:
address: ":9900"
traefikhub-tunl:
address: ":9901/tcp"
{% endif%}
{% for traefik_entrypoint in traefik_entrypoints %}
{{ traefik_entrypoint.name }}:
address: :{{ traefik_entrypoint.port }}
{% if traefik_entrypoint.tls is defined and traefik_entrypoint.tls|bool %}
{% if traefik_entrypoint.proto is defined %}
address: ":{{ traefik_entrypoint.port }}/{{ traefik_entrypoint.proto | lower }}"
{% else %}
address: ":{{ traefik_entrypoint.port }}"
{% endif %}
{% if traefik_entrypoint.tls is defined or traefik_entrypoint.middlewares is defined %}
http:
{% if traefik_entrypoint.middlewares is defined %}
middlewares:
{% for middleware in traefik_entrypoint.middlewares %}
- {{ middleware }}
{% endfor %}
{% endif %}
{% if traefik_entrypoint.tls is defined and traefik_entrypoint.tls|bool %}
tls: {}
{% endif %}
{% endif %}
{% endfor %}
providers:
kubernetesCRD:
# ingressClass: "traefik"
throttleDuration: 2s
{% if traefik_ondemand is defined %}
allowEmptyServices: true
{% endif%}
kubernetesIngress:
ingressClass: "traefik"
{% if traefik_hub_token is defined %}
allowExternalNameServices: true
{% endif%}
{% if traefik_ondemand is defined %}
allowEmptyServices: true
{% endif%}
kubernetesGateway: {}
file:
directory: /etc/traefik/file/
watch: true
metrics:
prometheus:
buckets:
- 0.1
- 0.3
- 1.2
- 5
entryPoint: traefik
entryPoint: metrics
addRoutersLabels: true
ping:
entryPoint: traefik
api:
insecure: true
dashboard: true
debug: true
{% if traefik_hub_token is defined %}
hub: {}
{% endif %}
log:
level: WARN
format: json
accessLog:
format: json
fields:
names:
BackendAddr: keep
BackendName: keep
BackendURL: keep
FrontendName: keep
kind: ConfigMap
metadata:
labels:
app: traefik
name: traefik
namespace: {{ traefik_namespace }}
level: ERROR
# format: json
accessLog: {}
#accessLog:
# filePath: "/var/log/traefik/access.log"
# bufferingSize: 50
## format: json
## fields:
## names:
## BackendAddr: keep
## BackendName: keep
## BackendURL: keep
## FrontendName: keep
{% if traefik_hub_token is defined or traefik_ondemand is defined %}
experimental:
# kubernetesGateway: true
{% if traefik_hub_token is defined %}
hub: true
{% endif %}
{% if traefik_ondemand is defined %}
plugins:
sablier:
moduleName: github.com/sablierapp/sablier
version: v{{ traefik_sabblier_version }}
{% endif %}
{% endif %}

View file

@ -1,40 +0,0 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: traefik-dashboard-insecure
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
entryPoints:
- http
routes:
# Match is the rule corresponding to an underlying router.
# Later on, match could be the simple form of a path prefix, e.g. just "/bar",
# but for now we only support a traefik style matching rule.
- match: Host(`traefik.{{ traefik_domain }}`)
# kind could eventually be one of "Rule", "Path", "Host", "Method", "Header",
# "Parameter", etc, to support simpler forms of rule matching, but for now we
# only support "Rule".
kind: Rule
# (optional) Priority disambiguates rules of the same length, for route matching.
middlewares:
{% if ingress_whitelist is defined %}
- name: traefik-ipwhitelist
{% endif %}
- name: https-only
services:
- name: api@internal
kind: TraefikService
# - name: traefik-dashboard
# port: 8080
# # (default 1) A weight used by the weighted round-robin strategy (WRR).
# weight: 1
# # (default true) PassHostHeader controls whether to leave the request's Host
# # Header as it was before it reached the proxy, or whether to let the proxy set it
# # to the destination (backend) host.
# passHostHeader: true
# responseForwarding:
# # (default 100ms) Interval between flushes of the buffered response body to the client.
# flushInterval: 100ms

View file

@ -1,24 +0,0 @@
apiVersion: v1
kind: Service
metadata:
labels:
app: traefik
name: traefik-dashboard
namespace: {{ traefik_namespace }}
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
# - name: traefik
# port: 8080
# protocol: TCP
- protocol: TCP
port: 443
name: https
targetPort: 443
type: ClusterIP
selector:
app: traefik

View file

@ -0,0 +1,16 @@
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: cheese
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
traefik.ingress.kubernetes.io/router.priority: "1"
traefik.ingress.kubernetes.io/router.middlewares: security_headers@file,compress@file
spec:
defaultBackend:
service:
name: stilton
port:
number: 80

View file

@ -1,93 +0,0 @@
kind: DaemonSet
apiVersion: apps/v1
metadata:
namespace: {{ traefik_namespace }}
name: traefik
labels:
app: traefik
spec:
# replicas: {% if traefik_node_selector is defined %}{{ traefik_node_selector|length }}{% else %}1{% endif %}
strategy:
type: Recreate
selector:
matchLabels:
app: traefik
template:
metadata:
labels:
app: traefik
spec:
serviceAccountName: traefik-ingress-controller
# securityContext:
# sysctls:
# - name: kernel.net.ipv4.ip_unprivileged_port_start
# value: "80"
containers:
- name: traefik
image: traefik:{{ lookup('vars', 'traefik_version_' + traefik_version | regex_replace('\.','_')) }}
args:
- --configfile=/config/traefik.yaml
# imagePullPolicy: IfNotPresent
ports:
{% for traefik_entrypoint in traefik_entrypoints %}
- name: {{ traefik_entrypoint.name }}
containerPort: {{ traefik_entrypoint.port }}
protocol: {{ traefik_entrypoint.proto }}
{% if traefik_entrypoint.hostport is defined %}
hostPort: {{ traefik_entrypoint.hostport }}
{% endif %}
{% endfor %}
readinessProbe:
httpGet:
path: /ping
port: traefik
failureThreshold: 1
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 2
livenessProbe:
httpGet:
path: /ping
port: traefik
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 2
securityContext:
capabilities:
drop:
- ALL
add:
- NET_BIND_SERVICE
runAsUser: 1000
runAsGroup: 1000
allowPrivilegeEscalation: true
resources:
limits:
cpu: {{ traefik_cpu_limit }}
memory: {{ traefik_memory_limit }}
requests:
cpu: 100m
memory: 20Mi
volumeMounts:
- mountPath: /config
name: config
{% if traefik_node_selector is defined %}
nodeSelector:
reslinger.net/entrypoint: traefik
{% endif %}
dnsPolicy: ClusterFirst
hostNetwork: false
restartPolicy: Always
terminationGracePeriodSeconds: 1
tolerations:
- effect: NoSchedule
operator: Exists
volumes:
- configMap:
defaultMode: 420
name: traefik
name: config

View file

@ -0,0 +1,155 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: traefik-files
data:
traefik-middlewares.yaml: |
http:
middlewares:
min_security:
chain:
middlewares:
- security_headers
{% if ingress_whitelist is defined %}
- traefik-ipwhitelist
{% endif %}
- rate-limit
- compress
{% if false %}
{% if basic_auth|bool %}
- basic-auth
{% endif %}
- authelia
{% endif %}
compress:
compress:
excludedContentTypes: ["text/event-stream"]
rate-limit:
rateLimit:
average: 100
burst: 50
security_headers:
headers:
accessControlAllowMethods: ["GET", "OPTIONS", "PUT"]
# accessControlAllowOrigin: "origin-list-or-null"
accessControlMaxAge: 100
addVaryHeader: true
browserXssFilter: true
contentTypeNosniff: true
forceSTSHeader: true
frameDeny: true
stsIncludeSubdomains: true
stsPreload: true
customFrameOptionsValue: "SAMEORIGIN"
referrerPolicy: "same-origin"
# permissionsPolicy: "vibrate 'self'"
permissionsPolicy: "camera 'none'; microphone 'none'; geolocation 'none'; payment 'none';"
stsSeconds: 315360000
# contentSecurityPolicy: "default-src 'self' 'unsafe-inline'"
# customResponseHeaders:
# X-Robots-Tag: "none,noarchive,nosnippet,notranslate,noimageindex,"
# server: ""
hostsProxyHeaders:
- "X-Forwarded-Host"
{% if ingress_whitelist is defined %}
traefik-ipwhitelist:
ipWhiteList:
sourceRange:
{% for acl_whitelist in ingress_whitelist %}
- {{ acl_whitelist }}
{% endfor %}
{% endif %}
{% if traefik_ondemand is defined %}
ondemand:
plugin:
sablier:
#group: default
dynamic:
displayName: Application is starting
refreshFrequency: 5s
showDetails: "true"
theme: hacker-terminal
sablierUrl: http://sablier:10000
sessionDuration: 1m
{% endif %}
{% if basic_auth|bool %}
basic-auth:
basicAuth:
removeHeader: true
usersFile: "/etc/traefik/basic-auth/basic_auth"
# users:
# - {{ basic_auth_data }}
{% endif %}
authelia:
forwardAuth:
address: "http://authelia:9091/api/verify?rd=https://login.example.com/"
trustForwardHeader: true
authResponseHeaders:
- "Remote-User"
- "Remote-Groups"
- "Remote-Name"
- "Remote-Email"
authelia-basic:
forwardAuth:
address: "http://authelia:9091/api/verify?auth=basic"
trustForwardHeader: true
authResponseHeaders:
- "Remote-User"
- "Remote-Groups"
- "Remote-Name"
- "Remote-Email"
crowdsec-bouncer:
forwardAuth:
address: "http://crowdsec-traefik-bouncer-service/api/v1/forwardAuth"
trustForwardHeader: true
traefik-servers-transport.yaml: |
http:
serversTransports:
skip-verify-https-backend:
insecureSkipVerify: true
traefik-tls-defaults-options.yaml: |
tls:
options:
default:
sniStrict: true
minVersion: VersionTLS12
curvePreferences:
- CurveP521
- CurveP384
cipherSuites:
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
- TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305
alpnProtocols:
- h2
- http/1.1
{% if false %}
stores:
default:
defaultCertificate:
certFile: path/to/wildcardcert.crt
keyFile: path/to/wildcardcert.key
certificates:
- certFile: /path/to/domain.cert
keyFile: /path/to/domain.key
- certFile: /path/to/other-domain.cert
keyFile: /path/to/other-domain.key
{% endif %}
# dashboard.yaml: |
# http:
# routers:
# traefik:
# rule: "Host(`traefik.{{ domain | lower }}`)"
# entryPoints:
# - "websecure"
# middlewares:
# - "min_security@file"
#{% if basic_auth|bool %}
# - "basic-auth@file"
#{% endif %}
# service: "api@internal"

View file

@ -0,0 +1,184 @@
# https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml
{% if traefik_version is defined %}
image:
tag: "{{ traefik_version }}"
{% endif %}
#fullnameOverride: "{{ my_context }}"
additionalArguments:
- --configFile=/etc/traefik/traefik.yaml
#podSecurityPolicy:
# enabled: true
service:
type: {{ traefik_service_type }}
{% if traefik_external_ips is defined %}
externalIPs:
{% for external_ip in traefik_external_ips %}
- {{ external_ip }}
{% endfor %}
{% endif %}
{% if traefik_service_type == "LoadBalancer" %}
annotations:
external-dns.alpha.kubernetes.io/hostname: traefik.{{ cluster_domain }}
{% endif %}
ingressRoute:
dashboard:
enabled: false
podDisruptionBudget:
enabled: true
minAvailable: 1
ingressClass:
enabled: true
isDefaultClass: true
{% if false %}
autoscaling:
enabled: true
minReplicas: 1
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
targetAverageUtilization: 60
- type: Resource
resource:
name: memory
targetAverageUtilization: 60
{% endif %}
{% if traefik_service_type == "NodePort" or (traefik_hostport is defined and traefik_hostport == true) or traefik_hub_token is defined %}
ports:
{% if traefik_service_type == "NodePort" or (traefik_hostport is defined and traefik_hostport == true) %}
web:
# redirectTo: websecure
{% if traefik_hostport is defined and traefik_hostport == true %}
hostPort: 80
{% endif %}
{% if traefik_service_type == "NodePort" %}
nodePort: 80
{% endif %}
websecure:
{% if traefik_hostport is defined and traefik_hostport == true %}
hostPort: 443
{% endif %}
{% if traefik_service_type == "NodePort" %}
nodePort: 443
{% endif %}
http3:
enabled: true
advertisedPort: 443
# tls:
# enabled: true
# options: default
{% endif %}
{% if traefik_hub_token is defined %}
traefikhub-tunl:
port: 9901
expose: true
exposedPort: 9901
protocol: "TCP"
{% endif %}
{% endif %}
volumes:
- mountPath: /etc/traefik
name: traefik-conf
type: configMap
- mountPath: /etc/traefik/file
name: traefik-files
type: configMap
- mountPath: /etc/traefik/basic-auth
name: basic-auth
type: secret
deployment:
{% if traefik_hostport is defined and traefik_hostport == true %}
kind: DaemonSet
{% else %}
replicas: 1
{% endif %}
revisionHistoryLimit: 3
# podAnnotations:
# prometheus.io/port: '9100'
# prometheus.io/scrape: 'true'
# prometheus.io/path: "/metrics"
{% if traefik_hostport is defined and traefik_hostport == true %}
updateStrategy:
type: OnDelete
{% endif %}
metrics:
prometheus:
service:
enabled: true
serviceMonitor:
metricRelabelings: []
# # - sourceLabels: [__name__]
# # separator: ;
# # regex: ^fluentd_output_status_buffer_(oldest|newest)_.+
# # replacement: $1
# # action: drop
relabelings: []
# # - sourceLabels: [__meta_kubernetes_pod_node_name]
# # separator: ;
# # regex: ^(.*)$
# # targetLabel: nodename
# # replacement: $1
# # action: replace
# jobLabel: traefik
# interval: 30s
# honorLabels: true
# # (Optional)
# # scrapeTimeout: 5s
# # honorTimestamps: true
# # enableHttp2: true
# # followRedirects: true
# # additionalLabels:
# # foo: bar
# # namespace: "another-namespace"
# # namespaceSelector: {}
# prometheusRule:
# enabled: true
# additionalLabels: {}
# namespace: "{{ traefik_namespace }}"
# rules:
# - alert: TraefikDown
# expr: up{job="traefik"} == 0
# for: 5m
# labels:
# context: traefik
# severity: warning
# annotations:
# summary: "Traefik Down"
# description: "{% raw %}{{ $labels.pod }} on {{ $labels.nodename }} is down{% endraw %}"
experimental:
{% if traefik_ondemand is defined %}
plugins:
sablier:
moduleName: "github.com/sablierapp/sablier"
version: "v1.8.1"
{% endif %}
{% if traefik_hub_token is defined %}
hub:
enabled: true
{% endif %}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
{% if false %}
{% raw %}
extraObjects:
- apiVersion: v1
kind: ConfigMap
metadata:
name: "extra"
data:
something: "extra"
- |
apiVersion: v1
kind: ConfigMap
metadata:
name: "templated"
data:
something: {{ printf "templated" }}
{% endraw %}
{% endif %}

View file

@ -0,0 +1,14 @@
apiVersion: v1
kind: List
items:
- apiVersion: v1
kind: Secret
metadata:
annotations:
app.kubernetes.io/managed-by: traefik-hub
name: hub-certificate
namespace: {{ traefik_namespace }}
type: kubernetes.io/tls
data:
tls.crt: {{ traefik_hub_tlscrt | b64encode }}
tls.key: {{ traefik_hub_tlskey | b64encode }}

View file

@ -1,19 +1,29 @@
apiVersion: traefik.containo.us/v1alpha1
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: traefik
namespace: {{ traefik_namespace }}
labels:
app: traefik
annotations:
kubernetes.io/ingress.class: traefik
{% if false %}
external-dns.alpha.kubernetes.io/hostname: traefik.{{ cluster_domain }}
external-dns.alpha.kubernetes.io/endpoints-type: NodeExternalIP
# external-dns.alpha.kubernetes.io/endpoints-type: HostIP
# external-dns.alpha.kubernetes.io/target: "1.2.3.4"
# external-dns.alpha.kubernetes.io/ttl: "120"
# external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
{% endif %}
spec:
entryPoints:
- https
- websecure
routes:
# Match is the rule corresponding to an underlying router.
# Later on, match could be the simple form of a path prefix, e.g. just "/bar",
# but for now we only support a traefik style matching rule.
- match: Host(`traefik.{{ traefik_domain }}`) && (PathPrefix(`/dashboard`) || PathPrefix(`/api`))
- match: Host(`traefik.{{ cluster_domain }}`) && (PathPrefix(`/dashboard`) || PathPrefix(`/api`))
# kind could eventually be one of "Rule", "Path", "Host", "Method", "Header",
# "Parameter", etc, to support simpler forms of rule matching, but for now we
# only support "Rule".
@ -21,43 +31,31 @@ spec:
{% if basic_auth is defined or ingress_whitelist is defined %}
middlewares:
{% if ingress_whitelist is defined %}
- name: traefik-ipwhitelist
- name: traefik-ipwhitelist@file
{% endif %}
{% if basic_auth is defined %}
- name: basic-auth
- name: basic-auth@file
{% endif %}
{% endif %}
services:
- name: api@internal
kind: TraefikService
# - name: traefik-dashboard
# port: 8080
# # (default 1) A weight used by the weighted round-robin strategy (WRR).
# weight: 1
# # (default true) PassHostHeader controls whether to leave the request's Host
# # Header as it was before it reached the proxy, or whether to let the proxy set it
# # to the destination (backend) host.
# passHostHeader: true
# responseForwarding:
# # (default 100ms) Interval between flushes of the buffered response body to the client.
# flushInterval: 100ms
- match: Host(`traefik.{{ traefik_domain }}`) && PathPrefix(`/ping`)
- match: Host(`traefik.{{ cluster_domain }}`) && PathPrefix(`/ping`)
kind: Rule
services:
- name: ping@internal
kind: TraefikService
- match: Host(`traefik.{{ traefik_domain }}`) && PathPrefix(`/metrics`)
kind: Rule
services:
- name: prometheus@internal
kind: TraefikService
# - match: Host(`traefik.{{ cluster_domain }}`) && PathPrefix(`/metrics`)
# kind: Rule
# services:
# - name: prometheus@internal
# kind: TraefikService
tls:
{% if traefik_dashboard_certificate is defined %}
secretName: {{ traefik_dashboard_certificate }}
{% else %}
secretName: traefik.{{ cluster_domain }}
{% endif %}
options:
name: default
namespace: {{ traefik_namespace }}

View file

@ -1,8 +0,0 @@
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: basic-auth
namespace: {{ traefik_namespace }}
spec:
basicAuth:
secret: basic-auth

View file

@ -1,31 +0,0 @@
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: security-headers
namespace: {{ traefik_namespace }}
spec:
headers:
browserXssFilter: "true"
contentTypeNosniff: "true"
forceSTSHeader: "true"
frameDeny: "true"
stsIncludeSubdomains: "true"
stsPreload: "true"
stsSeconds: "15768000"
sslRedirect: "true"
contentSecurityPolicy: "default-src 'self' 'unsafe-inline'"
customFrameOptionsValue: "SAMEORIGIN"
referrerPolicy: "same-origin"
featurePolicy: "vibrate 'self'"
# CORS
accessControlAllowMethods:
- "GET"
- "OPTIONS"
- "PUT"
accessControlAllowOrigin: "origin-list-or-null"
#accessControlAllowOriginList:
# - "https://foo.bar.org"
# - "https://example.org"
accessControlMaxAge: 100
addVaryHeader: "true"

View file

@ -1,8 +0,0 @@
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: https-only
namespace: {{ traefik_namespace }}
spec:
redirectScheme:
scheme: https

View file

@ -1,13 +0,0 @@
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: traefik-ipwhitelist
namespace: {{ traefik_namespace }}
spec:
ipWhiteList:
sourceRange:
{% if ingress_whitelist is defined %}
{% for acl_whitelist in ingress_whitelist %}
- {{ acl_whitelist }}
{% endfor %}
{% endif %}

View file

@ -0,0 +1,134 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sablier
labels:
app.kubernetes.io/name: sablier
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: sablier
template:
metadata:
labels:
app.kubernetes.io/name: sablier
spec:
serviceAccountName: sablier
serviceAccount: sablier
containers:
- name: sablier
image: sablierapp/sablier:{{ traefik_sabblier_version }}
args:
- "start"
- "--provider.name=kubernetes"
- "--server.port=10000"
- "--storage.file=/dev/shm/state.json"
ports:
- containerPort: 10000
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: [ALL]
readOnlyRootFilesystem: true
seccompProfile:
type: RuntimeDefault
securityContext:
runAsGroup: 65532
runAsNonRoot: true
runAsUser: 65532
# --configFile=path/to/myconfigfile.yml
---
apiVersion: v1
kind: Service
metadata:
name: sablier
spec:
selector:
app.kubernetes.io/name: sablier
ports:
- protocol: TCP
port: 10000
targetPort: 10000
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: sablier
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: sablier
# namespace: {{ traefik_namespace }}
rules:
- apiGroups:
- apps
- ""
resources:
- deployments
- statefulsets
verbs:
- get # Retrieve info about specific dep
- list # Events
- watch # Events
- apiGroups:
- apps
- ""
resources:
- deployments/scale
- statefulsets/scale
verbs:
- patch # Scale up and down
- get # Retrieve info about specific dep
- update # Scale up and down
- list # Events
- watch # Events
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: sablier
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: sablier
subjects:
- kind: ServiceAccount
name: sablier
namespace: {{ traefik_namespace }}
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-traefik-to-sablier
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: sablier
ingress:
- ports:
- port: 10000
from:
- podSelector:
matchLabels:
app.kubernetes.io/name: traefik
policyTypes:
- Ingress
#---
#apiVersion: traefik.io/v1alpha1
#kind: Middleware
#metadata:
# name: ondemand
#spec:
# plugin:
# names: toto # Comma separated names of containers/services/deployments etc.
# group: default # Group name to use to filter by label, ignored if names is set
# dynamic:
# displayName: My Title # (Optional) Defaults to the middleware name
# refreshFrequency: 5s # (Optional) The loading page refresh frequency
# showDetails: "true" # (Optional) Set to true or false to show details specifcally for this middleware, unset to use Sablier server defaults
# theme: hacker-terminal # (Optional) The theme to use
# sablierUrl: http://sablier.{{ traefik_namespace }}:10000 # The sablier URL service, must be reachable from the Traefik instance
# sessionDuration: 1m # The session duration after which containers/services/deployments instances are shutdown

View file

@ -1,41 +0,0 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: traefik-ping
namespace: {{ traefik_namespace }}
labels:
app: traefik
spec:
entryPoints:
- https
routes:
# Match is the rule corresponding to an underlying router.
# Later on, match could be the simple form of a path prefix, e.g. just "/bar",
# but for now we only support a traefik style matching rule.
- match: Host(`traefik.{{ traefik_domain }}`) && PathPrefix(`/ping`)
# kind could eventually be one of "Rule", "Path", "Host", "Method", "Header",
# "Parameter", etc, to support simpler forms of rule matching, but for now we
# only support "Rule".
kind: Rule
# (optional) Priority disambiguates rules of the same length, for route matching.
priority: 14
services:
- name: ping@internal
kind: TraefikService
# - name: traefik-dashboard
# port: 8080
# # (default 1) A weight used by the weighted round-robin strategy (WRR).
# weight: 1
# # (default true) PassHostHeader controls whether to leave the request's Host
# # Header as it was before it reached the proxy, or whether to let the proxy set it
# # to the destination (backend) host.
# passHostHeader: true
# responseForwarding:
# # (default 100ms) Interval between flushes of the buffered response body to the client.
# flushInterval: 100ms
tls:
secretName: wildcard-cluster
options:
name: default
namespace: {{ traefik_namespace }}

View file

@ -1,49 +0,0 @@
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: runtime/default
seccomp.security.alpha.kubernetes.io/defaultProfileName: runtime/default
name: traefik-ingress-controller
spec:
requiredDropCapabilities:
- ALL
allowedCapabilities:
- NET_BIND_SERVICE
privileged: false
allowPrivilegeEscalation: false
# Allow core volume types.
volumes:
- configMap
- downwardAPI
- secret
- emptyDir
- projected
# - persistentVolumeClaim
hostNetwork: false
hostIPC: false
hostPID: false
runAsUser:
# Require the container to run without root privileges.
rule: 'MustRunAsNonRoot'
supplementalGroups:
rule: 'MustRunAs'
ranges:
# Forbid adding the root group.
- min: 1
max: 65535
fsGroup:
rule: 'MustRunAs'
ranges:
# Forbid adding the root group.
- min: 1
max: 65535
hostPorts:
readOnlyRootFilesystem: true
seLinux:
rule: 'RunAsAny'
hostPorts:
- max: 65535
min: 1
#allowedUnsafeSysctls:
# - kernel.net.ipv4.ip_unprivileged_port_start

View file

@ -1,5 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
namespace: {{ traefik_namespace }}
name: traefik-ingress-controller

View file

@ -2,20 +2,31 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: traefik
app.kubernetes.io/instance: traefik
app.kubernetes.io/name: traefik
name: traefik
namespace: {{ traefik_namespace }}
spec:
ports:
- name: http
- name: web
port: 80
protocol: TCP
targetPort: 80
- protocol: TCP
targetPort: web
- name: websecure
port: 443
name: https
targetPort: 443
type: LoadBalancer
protocol: TCP
targetPort: websecure
- name: websecure-http3
port: 443
protocol: UDP
targetPort: websecure
{% if traefik_external_ips is defined %}
externalIPs:
{% for traefik_external_ip in traefik_external_ips %}
- {{ traefik_external_ip }}
{% endfor %}
{% endif %}
selector:
app: traefik
app.kubernetes.io/instance: traefik
app.kubernetes.io/name: traefik
sessionAffinity: None

View file

@ -1,16 +0,0 @@
apiVersion: traefik.containo.us/v1alpha1
kind: TLSOption
metadata:
name: default
namespace: {{ traefik_namespace }}
spec:
sniStrict: true
minVersion: VersionTLS12
cipherSuites:
- TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
- TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
- TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305
curvePreferences:
- CurveP521
- CurveP384

12
todo.sh Normal file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env bash
cat << 'EOF' | kubectl --context my_context apply -f -
---
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: traefik
spec:
controller: traefik.io/ingress-controller
EOF

View file

@ -1,42 +1 @@
traefik_version_2_0: 2.0.7
traefik_2_0_list:
- 2.0/traefik-clusterrole.yml.j2
- 2.0/traefik-clusterrolebinding.yml.j2
- 2.0/traefik-crd-ingressroute.yml.j2
- 2.0/traefik-crd-ingressroutetcp.yml.j2
- 2.0/traefik-crd-middleware.yml.j2
- 2.0/traefik-crd-tlsoption.yml.j2
traefik_version_2_1: 2.1.9
traefik_2_1_list:
- 2.1/traefik-clusterrole.yml.j2
- 2.1/traefik-clusterrolebinding.yml.j2
- 2.1/traefik-crd-ingressroute.yml.j2
- 2.1/traefik-crd-ingressroutetcp.yml.j2
- 2.1/traefik-crd-middleware.yml.j2
- 2.1/traefik-crd-tlsoption.yml.j2
- 2.1/traefik-crd-traefikservice.yml.j2
traefik_version_2_2: 2.2.11
traefik_2_2_list:
- 2.2/traefik-crd-ingressroutes.yml.j2
- 2.2/traefik-crd-ingressroutetcps.yml.j2
- 2.2/traefik-crd-ingressrouteudps.yml.j2
- 2.2/traefik-crd-middlewares.yml.j2
- 2.2/traefik-crd-tlsoptions.yml.j2
- 2.2/traefik-crd-tlsstores.yml.j2
- 2.2/traefik-crd-traefikservices.yml.j2
- 2.2/traefik-clusterrole.yml.j2
- 2.2/traefik-clusterrolebinding.yml.j2
traefik_version_2_3: 2.3.2
traefik_2_3_list:
- 2.3/traefik-crd-ingressroutes.yml.j2
- 2.3/traefik-crd-ingressroutetcps.yml.j2
- 2.3/traefik-crd-ingressrouteudps.yml.j2
- 2.3/traefik-crd-middlewares.yml.j2
- 2.3/traefik-crd-tlsoptions.yml.j2
- 2.3/traefik-crd-tlsstores.yml.j2
- 2.3/traefik-crd-traefikservices.yml.j2
- 2.3/traefik-clusterrole.yml.j2
- 2.3/traefik-clusterrolebinding.yml.j2
---