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

feature: Enable dual stack network #122

Open
VanDuy91 opened this issue Dec 10, 2022 · 2 comments
Open

feature: Enable dual stack network #122

VanDuy91 opened this issue Dec 10, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@VanDuy91
Copy link

Summary

Hello,
How can I enable dual stack network when init k8s cluster (with input IP/IPv6 addresses from main.yaml)

Thank you.

Issue Type

Feature Idea

@VanDuy91 VanDuy91 added the enhancement New feature or request label Dec 10, 2022
@JcGKitten
Copy link

Isn't this possible by adding

rke2_server_options:
    - "cluster-cidr: '10.42.0.0/16,2001:cafe:42:0::/56'"
    - "service-cidr: '10.43.0.0/16,2001:cafe:42:1::/112'"

to the hosts where your control nodes are run?

@tregad
Copy link
Contributor

tregad commented Jul 19, 2024

Should be possible by adding something like this:

diff --git a/defaults/main.yml b/defaults/main.yml
index 562d960..bd17171 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -294,3 +294,9 @@ rke2_debug: false
 
 # The value for the node-name configuration item
 rke2_node_name: "{{ inventory_hostname }}"
+# default pod network range for rke2
+rke2_cluster_cidr:
+  - 10.42.0.0/16
+# default service network range for rke2
+rke2_service_cidr:
+  - 10.43.0.0/16
diff --git a/templates/config.yaml.j2 b/templates/config.yaml.j2
index 5bf78d0..9317e5d 100644
--- a/templates/config.yaml.j2
+++ b/templates/config.yaml.j2
@@ -90,3 +90,9 @@ kube-proxy-arg:
 disable-cloud-controller: true
 cloud-provider-name: "{{ rke2_cloud_provider_name }}"
 {% endif %}
+{% if rke2_cluster_cidr is defined %}
+cluster-cidr: "{% for network in rke2_cluster_cidr %}{{ network }}{% if not loop['last'] %},{% endif %}{% endfor %}"
+{% endif %}
+{% if rke2_service_cidr is defined %}
+service-cidr: "{% for network in rke2_service_cidr %}{{ network }}{% if not loop['last'] %},{% endif %}{% endfor %}"
+{% endif %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants