Move KinD to seperate directory

This commit is contained in:
Khue Doan 2021-07-21 00:15:26 +07:00
parent bf70d4c04b
commit 175321f3cf
No known key found for this signature in database
GPG Key ID: 4C1A90A461B3C27B
2 changed files with 22 additions and 6 deletions

View File

@ -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