Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add cilium values #314

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions tasks/cilium.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
- name: Create the RKE2 manifests directory
ansible.builtin.file:
state: directory
path: "{{ rke2_data_path }}/server/manifests"
owner: root
group: root
mode: 0700

- name: Copy cilium-config files to first server
ansible.builtin.template:
src: "templates/cilium-config.yml.j2"
dest: "{{ rke2_data_path }}/server/manifests/rke2-cilium-config.yaml"
owner: root
group: root
mode: 0664
7 changes: 7 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@
- rke2_ingress_nginx_values is defined
- rke2_ingress_nginx_values | length > 0

- name: Copy cilium-config manifests to the masternode
ansible.builtin.include_tasks: cilium.yml
when:
- inventory_hostname == groups[rke2_servers_group_name].0
- rke2_cilium_values is defined
- rke2_cilium_values | length > 0

- name: Prepare very first server node in the cluster
ansible.builtin.include_tasks: first_server.yml
when:
Expand Down
10 changes: 10 additions & 0 deletions templates/cilium-config.yml.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: helm.cattle.io/v1
kind: HelmChartConfig
metadata:
name: rke2-cilium
namespace: kube-system
spec:
valuesContent: |-
{% if rke2_cilium_values | length > 0 %}
{{ rke2_cilium_values | to_nice_yaml(indent=2) | indent(4) }}
{% endif %}
Loading