Skip to content

Commit

Permalink
fix dual stack cluster created by kind
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Aug 13, 2021
1 parent bdfe708 commit 5e9e41a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ kind-init-ipv6:
.PHONY: kind-init-dual
kind-init-dual:
kind delete cluster --name=kube-ovn
kube_proxy_mode=iptables ip_family=DualStack ha=false single=false j2 yamls/kind.yaml.j2 -o yamls/kind.yaml
kube_proxy_mode=iptables ip_family=dual ha=false single=false j2 yamls/kind.yaml.j2 -o yamls/kind.yaml
kind create cluster --config yamls/kind.yaml --name kube-ovn
kubectl describe no
docker exec kube-ovn-worker sysctl -w net.ipv6.conf.all.disable_ipv6=0
Expand Down
12 changes: 8 additions & 4 deletions yamls/kind.yaml.j2
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{% set nodeTag = "v1.19.11" -%}
{% if ip_family is equalto "dual" -%}
{% set nodeTag = "v1.21.2" -%}
{% endif -%}
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
networking:
Expand All @@ -16,15 +20,15 @@ kubeadmConfigPatches:

nodes:
- role: control-plane
image: kindest/node:v1.19.11
image: kindest/node:{{ nodeTag }}
{%- if ha is equalto "true" %}
- role: control-plane
image: kindest/node:v1.19.11
image: kindest/node:{{ nodeTag }}
- role: control-plane
image: kindest/node:v1.19.11
image: kindest/node:{{ nodeTag }}
{%- elif single is equalto "true" %}

{%- else %}
- role: worker
image: kindest/node:v1.19.11
image: kindest/node:{{ nodeTag }}
{%- endif %}

0 comments on commit 5e9e41a

Please sign in to comment.