Skip to content

Commit

Permalink
deploy cilium ansible playbook & roles
Browse files Browse the repository at this point in the history
  • Loading branch information
smoleyxd committed Apr 5, 2024
1 parent 9cf9e72 commit d4ab4f2
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 19 deletions.
3 changes: 0 additions & 3 deletions ansible/inventory/dev.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ dev-k8s-master ansible_host= # TODO Add IP
dev-k8s-worker-01 ansible_host= # TODO Add IP
dev-k8s-worker-02 ansible_host= # TODO Add IP

[monitoring]
dev-monitoring ansible_host= # TODO Add IP

[k8s_cluster:children]
k8s_masters
k8s_workers
Expand Down
4 changes: 0 additions & 4 deletions ansible/inventory/group_vars/monitoring.yml

This file was deleted.

6 changes: 0 additions & 6 deletions ansible/inventory/host_vars/monitoring.yml

This file was deleted.

3 changes: 0 additions & 3 deletions ansible/inventory/prd.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ prd-k8s-master ansible_host= # TODO Add IP
prd-k8s-worker-01 ansible_host= # TODO Add IP
prd-k8s-worker-02 ansible_host= # TODO Add IP

[monitoring]
prd-monitoring ansible_host= # TODO Add IP

[k8s_cluster:children]
k8s_masters
k8s_workers
Expand Down
3 changes: 0 additions & 3 deletions ansible/inventory/staging.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ staging-k8s-master ansible_host= # TODO Add IP
staging-k8s-worker-01 ansible_host= # TODO Add IP
staging-k8s-worker-02 ansible_host= # TODO Add IP

[monitoring]
staging-monitoring ansible_host= # TODO Add IP

[k8s_cluster:children]
k8s_masters
k8s_workers
Expand Down
7 changes: 7 additions & 0 deletions ansible/playbooks/deploy-cilium.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- hosts: kubernetes_masters[0]
become: yes
roles:
- role: cilium-deploy
vars:
cilium_version: "1.9.8"
hubble_enabled: true
Empty file.
3 changes: 3 additions & 0 deletions ansible/roles/cilium-deploy/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# defaults/main.yml
cilium_version: "1.9.5"
hubble_enabled: true
14 changes: 14 additions & 0 deletions ansible/roles/cilium-deploy/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# tasks/main.yml
- name: Check if Cilium is already installed
ansible.builtin.shell: kubectl get namespace cilium | grep -c 'cilium'
register: cilium_namespace
ignore_errors: true

- name: Deploy Cilium with Helm
ansible.builtin.shell: |
helm upgrade --install cilium cilium/cilium --version {{ cilium_version }}
--namespace kube-system
--set hubble.relay.enabled={{ hubble_enabled }}
--set hubble.ui.enabled={{ hubble_enabled }}
--set global.hubble.metrics.enabled="{dns,drop,tcp,flow,port-distribution,icmp,http}"
when: cilium_namespace.stdout == "0"
File renamed without changes.

0 comments on commit d4ab4f2

Please sign in to comment.