Use clusterctl config file in bootstrap script

This commit is contained in:
Khue Doan 2021-07-20 19:50:47 +07:00
parent fb3c6abf25
commit 1540f9da1a
No known key found for this signature in database
GPG Key ID: 4C1A90A461B3C27B
2 changed files with 14 additions and 15 deletions

View File

@ -4,30 +4,29 @@ set -e
# DHCP server
export PUBLIC_IP="192.168.1.19"
talosctl cluster create \
-p 69:69/udp,8081:8081/tcp \
--workers 0 \
--endpoint $PUBLIC_IP
--endpoint '192.168.1.19'
kubectl taint node talos-default-master-1 node-role.kubernetes.io/master:NoSchedule-
SIDERO_CONTROLLER_MANAGER_HOST_NETWORK=true \
SIDERO_CONTROLLER_MANAGER_API_ENDPOINT=$PUBLIC_IP \
SIDERO_CONTROLLER_MANAGER_AUTO_ACCEPT_SERVERS=true \
clusterctl init -b talos -c talos -i sidero
clusterctl init -b talos -c talos -i sidero --config clusterctl.yaml
wol '00:23:24:d1:f3:f0'
# wol '00:23:24:d1:f4:d6'
# wol '00:23:24:d1:f5:69'
# wol '00:23:24:e7:04:60'
kubectl apply -f serverclasses
# Wait for servers to register
sleep 30
kubectl apply -f serverclasses
kubectl apply -f servers
kubectl apply -f clusters
clusterctl config cluster management-plane -i sidero --config clusterctl.yaml > cluster/management-plane.yaml
wol '00:23:24:d1:f3:f0'
wol '00:23:24:d1:f4:d6'
wol '00:23:24:d1:f5:69'
wol '00:23:24:e7:04:60'
kubectl apply -f cluster/
kubectl get talosconfig \
-l cluster.x-k8s.io/cluster-name=management-plane \

View File

@ -81,7 +81,7 @@ metadata:
namespace: default
spec:
clusterName: management-plane
replicas: 3
replicas: 0
selector:
matchLabels: null
template: