Skip to content

Commit

Permalink
add: ingress controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
pasiol committed Dec 26, 2024
1 parent 593260d commit 42407e4
Show file tree
Hide file tree
Showing 7 changed files with 1,001 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ A light-weight Kubernetes distribution for educational purposes. Run the latest
- Vanilla Kubernetes from pkgs.k8s.io repository
- Flannel or Calico CNI plugin
- MetalLB loadbalander
- Ingress controller Traefik or HAProxy
- one control plane and multiple worker nodes

### Options
Expand Down
1 change: 1 addition & 0 deletions group_vars/all/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ kubernetes_minor_version: >-
}}
kubernetes_major_version: "{{ kubernetes_package_version_splitted[0] }}.{{ kubernetes_package_version_splitted[1] }}"
cni_plugin: calico
ingress_controller: traefik
admission_plugins:
- NodeRestriction
- ResourceQuota
Expand Down
1 change: 1 addition & 0 deletions playbook-cluster-configure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
hosts: control_planes
roles:
- cluster_control_plane_set_up_admission_plugins
- ingress_controller
vars:
ansible_user: kubeadmin

Expand Down
1 change: 1 addition & 0 deletions playbook-cluster-finalize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
hosts: control_planes
roles:
- cluster_control_plane_set_up_admission_plugins
- ingress_controller
vars:
ansible_user: kubeadmin

Expand Down
967 changes: 967 additions & 0 deletions roles/ingress_controller/files/traefik_values.yaml

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions roles/ingress_controller/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: Include task ingress controller
ansible.builtin.include_tasks:
file: "{{ ingress_controller | lower }}.yaml"
26 changes: 26 additions & 0 deletions roles/ingress_controller/tasks/traefik.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- name: Add traefik repo
kubernetes.core.helm_repository:
name: traefik
repo_url: "https://traefik.github.io/charts"

- name: Copy values ansible host
ansible.builtin.copy:
src: traefik_values.yaml
dest: /tmp/traefik_values.yaml
mode: "0755"

- name: Deploy traefik
kubernetes.core.helm:
name: traefik
state: present
chart_ref: traefik/traefik
release_namespace: traefik-v2
create_namespace: true
values_files:
- /tmp/traefik_values.yaml

- name: Remove values file
ansible.builtin.file:
path: /tmp/traefik_values.yaml
state: absent

0 comments on commit 42407e4

Please sign in to comment.