khuedoan-homelab/bootstrap/bootstrap.sh

48 lines
1.3 KiB
Bash
Raw Normal View History

2021-07-18 16:12:13 +07:00
#!/bin/sh
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
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
2021-07-20 15:59:42 +07:00
sleep 30
2021-07-18 16:12:13 +07:00
2021-07-20 15:59:42 +07:00
kubectl apply -f serverclasses
kubectl apply -f servers
kubectl apply -f clusters
2021-07-18 16:12:13 +07:00
2021-07-20 15:59:42 +07:00
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'
2021-07-18 18:06:30 +07:00
kubectl get talosconfig \
-l cluster.x-k8s.io/cluster-name=management-plane \
-o yaml -o jsonpath='{.items[0].status.talosConfig}' > management-plane-talosconfig.yaml
clusterctl init \
--kubeconfig-context=admin@management-plane
-i sidero -b talos -c talos
clusterctl move \
--kubeconfig-context=admin@talos-default \
--to-kubeconfig=$HOME/.kube/config \
--to-kubeconfig-context=admin@management-plane
2021-07-18 18:37:40 +07:00
kubectl taint node talos-192-168-1-24 node-role.kubernetes.io/master:NoSchedule-
kubectl patch deploy -n sidero-system sidero-controller-manager --type='json' -p='[{"op": "add", "path": "/spec/template/spec/hostNetwork", "value": true}]'