@@ -31,6 +31,16 @@ TALOS_WORKER_COUNT ?= 1
3131
3232TALOS_API_PORT ?= 50000
3333
34+ TALOS_UNDERLAY_CIDR_IPV4 = 172.99.99.0/24
35+ TALOS_UNDERLAY_CIDR_IPV6 = 2001:db8:99:99::1/120
36+ TALOS_UNDERLAY_CIDR_DUAL = $(TALOS_UNDERLAY_CIDR_IPV4 ) ,$(TALOS_UNDERLAY_CIDR_IPV6 )
37+ TALOS_UNDERLAY_GATEWAY_IPV4 = 172.99.99.1
38+ TALOS_UNDERLAY_GATEWAY_IPV6 = 2001:db8:99:99::1
39+ TALOS_UNDERLAY_GATEWAY_DUAL = $(TALOS_UNDERLAY_GATEWAY_IPV4 ) ,$(TALOS_UNDERLAY_GATEWAY_IPV6 )
40+ TALOS_UNDERLAY_EXCLUDE_IPS_IPV4 = 172.99.99.11..172.99.99.99
41+ TALOS_UNDERLAY_EXCLUDE_IPS_IPV6 = 2001:db8:99:99::11..2001:db8:99:99::99
42+ TALOS_UNDERLAY_EXCLUDE_IPS_DUAL = $(TALOS_UNDERLAY_EXCLUDE_IPS_IPV4 ) ,$(TALOS_UNDERLAY_EXCLUDE_IPS_IPV6 )
43+
3444# geneve causes kernel panic on my local libvirt virtual machines
3545# use vxlan instead
3646TALOS_TUNNEL_TYPE = vxlan
@@ -71,7 +81,7 @@ talos-libvirt-init: talos-libvirt-clean
7181 sudo mkdir -p " $( TALOS_IMAGE_DIR) " && \
7282 sudo chmod 777 " $( TALOS_IMAGE_DIR) " && \
7383 echo " >>> Downloading Talos image $( TALOS_IMAGE_ISO) into $( TALOS_IMAGE_DIR) ..." && \
74- wget " $( TALOS_IMAGE_URL) " -O " $( TALOS_IMAGE_PATH) " && \
84+ wget " $( TALOS_IMAGE_URL) " --quiet - O " $( TALOS_IMAGE_PATH) " && \
7585 echo " >>> Talos image downloaded." ; \
7686 fi
7787 @echo " >>> Creating libvirt network $( TALOS_LIBVIRT_NETWORK_NAME) ..."
@@ -199,19 +209,20 @@ talos-init-%: talos-libvirt-init talos-prepare-images
199209 @echo " >>> Waiting for k8s endpoint to be ready..."
200210 @while true ; do \
201211 if kubectl get nodes & > /dev/null; then \
202- echo " >>>>>> K8s endpoint is ready." ; \
212+ echo " >>> K8s endpoint is ready." ; \
203213 break ; \
204214 fi ; \
205215 echo " >>>>>> Waiting for k8s endpoint..." ; \
206216 sleep 2; \
207217 done
208- @echo " >>> Waiting for all k8s nodes to be present ..."
218+ @echo " >>> Waiting for all k8s nodes to be registered ..."
209219 @while true ; do \
210- if [ $$ (kubectl get nodes -o name | wc -l) -eq $$ (( $(TALOS_CONTROL_PLANE_COUNT)+ $(TALOS_WORKER_COUNT)) ) ]; then \
211- echo " >>>>>> K8s nodes are present." ; \
220+ count=$$(kubectl get nodes -o name | wc -l ) ; \
221+ echo " >>>>>> $$ {count} node(s) are registered..." ; \
222+ if [ $$ {count} -eq $$ (( $(TALOS_CONTROL_PLANE_COUNT)+ $(TALOS_WORKER_COUNT)) ) ]; then \
223+ echo " >>> All k8s nodes are registered." ; \
212224 break ; \
213225 fi ; \
214- echo " >>>>>> Waiting for all k8s nodes to be present..." ; \
215226 sleep 2; \
216227 done
217228 @echo " >>> Waiting for kube-proxy to be ready..."
@@ -249,12 +260,30 @@ talos-install: talos-install-prepare
249260 $(MAKE ) install-chart
250261
251262.PHONY : talos-install-%
252- talos-install-% :
253- @NET_STACK=$* $(MAKE ) talos-install
263+ talos-install-% : talos-install-overlay-$*
254264
255265.PHONY : talos-install-dev
256266talos-install-dev : talos-install-dev-ipv4
257267
258268.PHONY : talos-install-dev-%
259269talos-install-dev-% :
260270 @VERSION=$(DEV_TAG ) $(MAKE ) talos-install-$*
271+
272+ .PHONY : talos-install-overlay
273+ talos-install-overlay : talos-install-overlay-ipv4
274+
275+ .PHONY : talos-install-overlay-%
276+ talos-install-overlay-% :
277+ @NET_STACK=$* $(MAKE ) talos-install
278+
279+ .PHONY : talos-install-underlay
280+ talos-install-underlay : talos-install-underlay-ipv4
281+
282+ .PHONY : talos-install-underlay-%
283+ talos-install-underlay-% :
284+ @$(eval UNDERLAY_VAR_SUFFIX = $(shell echo $* | tr 'a-z' 'A-Z') )
285+ @NET_STACK=$* NETWORK_TYPE=vlan VLAN_INTERFACE_NAME=enp0s5f1 VLAN_ID=0 \
286+ POD_CIDR=$(TALOS_UNDERLAY_CIDR_$(UNDERLAY_VAR_SUFFIX ) ) \
287+ POD_GATEWAY=$(TALOS_UNDERLAY_GATEWAY_$(UNDERLAY_VAR_SUFFIX ) ) \
288+ EXCLUDE_IPS=$(TALOS_UNDERLAY_EXCLUDE_IPS_$(UNDERLAY_VAR_SUFFIX ) ) \
289+ $(MAKE ) talos-install
0 commit comments