Skip to content

Commit

Permalink
Upgrade Traefik to v2.3.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
SorenA committed Sep 23, 2020
1 parent 4465e41 commit 53988a5
Show file tree
Hide file tree
Showing 14 changed files with 167 additions and 200 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,7 @@ In order to get a cluster up and running fast, an extra Ansible playbook is prov
- Deploy [Hetzner CSI Driver v1.4.0](https://github.com/hetznercloud/csi-driver) - Container Storage Interface for persistent volumes
- Deploy [cbeneke's Hetzner FIP controller v0.3.5](https://github.com/cbeneke/hcloud-fip-controller) - Assigns the cluster floating IP to the node running the controller, effectively keeping the cluster resources HA
- Deploy [Jetstack cert-manager v1.0.1](https://github.com/jetstack/cert-manager)
- Deploy [Traefik](https://github.com/containous/traefik/)
- Deploy Traefik Dashboard - with LetsEncrypt cert available on traefik.(cluster-domain), eg. traefik.default.cluster.example.com
- Deploy [Traefik Proxy v2.3.0](https://github.com/traefik/traefik)
- Deploy [Kubernetes Dashboard v2.0.4](https://github.com/kubernetes/dashboard) - available through `kubectl proxy`

Running the playbook requires the Ansible variables that Terraform generates.
Expand Down
1 change: 0 additions & 1 deletion k8s/provision-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@
- ansible-role-k8s-traefik
- ansible-role-k8s-cert-manager
- ansible-role-k8s-kubernetes-dashboard
- ansible-role-k8s-traefik-dashboard
25 changes: 0 additions & 25 deletions k8s/roles/ansible-role-k8s-traefik-dashboard/tasks/main.yml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 6 additions & 1 deletion k8s/roles/ansible-role-k8s-traefik/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@
state: present
definition: "{{ lookup('template', '02-rbac.yml') }}"

- name: Apply Service
k8s:
state: present
definition: "{{ lookup('template', '03-service.yml') }}"

- name: Apply Daemon Set
k8s:
state: present
definition: "{{ lookup('template', '03-daemon-set.yml') }}"
definition: "{{ lookup('template', '04-daemon-set.yml') }}"
49 changes: 48 additions & 1 deletion k8s/roles/ansible-role-k8s-traefik/templates/01-crd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ spec:
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

---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition

metadata:
name: middlewares.traefik.containo.us
spec:
Expand All @@ -56,4 +72,35 @@ spec:
kind: TLSOption
plural: tlsoptions
singular: tlsoption
scope: Namespaced
scope: Namespaced

---
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

---
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
50 changes: 21 additions & 29 deletions k8s/roles/ansible-role-k8s-traefik/templates/02-rbac.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1

metadata:
name: traefik-ingress-controller
name: traefik
labels:
app.kubernetes.io/name: traefik
app.kubernetes.io/instance: traefik
rules:
- apiGroups:
- ""
Expand All @@ -29,58 +32,47 @@ rules:
- 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:
- ingressrouteudps
- middlewares
- tlsoptions
- tlsstores
- traefikservices
verbs:
- get
- list
- watch

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1

metadata:
name: traefik-ingress-controller
name: traefik
labels:
app.kubernetes.io/name: traefik
app.kubernetes.io/instance: traefik
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: traefik-ingress-controller
name: traefik
subjects:
- kind: ServiceAccount
name: traefik-ingress-controller
name: traefik
namespace: traefik

---
apiVersion: v1
kind: ServiceAccount

metadata:
name: traefik
namespace: traefik
name: traefik-ingress-controller
labels:
app.kubernetes.io/name: traefik
app.kubernetes.io/instance: traefik
annotations:
42 changes: 0 additions & 42 deletions k8s/roles/ansible-role-k8s-traefik/templates/03-daemon-set.yml

This file was deleted.

19 changes: 19 additions & 0 deletions k8s/roles/ansible-role-k8s-traefik/templates/03-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: v1
kind: Service

metadata:
name: traefik
namespace: traefik
labels:
app.kubernetes.io/name: traefik
app.kubernetes.io/instance: traefik
annotations:
spec:
selector:
app.kubernetes.io/name: traefik
app.kubernetes.io/instance: traefik
ports:
- port: 9000
name: dashboard
protocol: TCP
Loading

0 comments on commit 53988a5

Please sign in to comment.