mirror of
https://github.com/khuedoan/homelab.git
synced 2025-01-05 21:11:52 +07:00
Move KinD to seperate directory
This commit is contained in:
parent
bf70d4c04b
commit
175321f3cf
@ -1,25 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
set -euo pipefail
|
||||
|
||||
# Create ephemeral cluster
|
||||
kind create cluster \
|
||||
--wait 60s \
|
||||
--config kind.yaml
|
||||
--kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
||||
--config ephemeral-cluster/kind.yaml
|
||||
|
||||
# Install Sidero
|
||||
clusterctl init \
|
||||
--bootstrap talos \
|
||||
--control-plane talos \
|
||||
--infrastructure sidero \
|
||||
--kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
||||
--config clusterctl.yaml
|
||||
kubectl wait pods \
|
||||
--kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
||||
--all \
|
||||
--all-namespaces \
|
||||
--timeout 300s \
|
||||
--for=condition=Ready
|
||||
|
||||
# Apply server classes
|
||||
kubectl apply \
|
||||
--kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
||||
--filename serverclasses/
|
||||
|
||||
# Waker servers up
|
||||
@ -29,12 +34,23 @@ wol '00:23:24:d1:f3:f0'
|
||||
# wol '00:23:24:e7:04:60'
|
||||
|
||||
# Create cluster
|
||||
export CONTROL_PLANE_ENDPOINT=$(kubectl get server -o jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}')
|
||||
clusterctl config cluster homelab \
|
||||
export CONTROL_PLANE_ENDPOINT=$(kubectl get server \
|
||||
--kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
||||
--output jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}')
|
||||
clusterctl config cluster \
|
||||
--infrastructure sidero \
|
||||
--config clusterctl.yaml > cluster/homelab.yaml
|
||||
--kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
||||
--config clusterctl.yaml \
|
||||
homelab > cluster/homelab.yaml
|
||||
kubectl apply \
|
||||
--kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
||||
--filename cluster/homelab.yaml
|
||||
|
||||
# Get kube config
|
||||
clusterctl get kubeconfig homelab > kubeconfig.yaml
|
||||
clusterctl get kubeconfig \
|
||||
--kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
||||
homelab > kubeconfig.yaml
|
||||
|
||||
# Cleanup ephemeral cluster
|
||||
# kind delete cluster --name bootstrap-cluster
|
||||
# rm ephemeral-cluster/kind-kubeconfig.yaml
|
||||
|
Loading…
Reference in New Issue
Block a user