mirror of
https://github.com/khuedoan/homelab.git
synced 2025-01-07 14:03:01 +07:00
Create DHCP server when bootstrap
This commit is contained in:
parent
3477e4ef43
commit
3da62ff7a1
@ -15,6 +15,21 @@ clusterctl init \
|
|||||||
--infrastructure sidero \
|
--infrastructure sidero \
|
||||||
--kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
--kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
||||||
--config clusterctl.yaml
|
--config clusterctl.yaml
|
||||||
|
|
||||||
|
# Create DHCP server
|
||||||
|
# kubectl create configmap dhcp-server \
|
||||||
|
# --kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
||||||
|
# --from-file dhcp-server/dhcpd.conf
|
||||||
|
# kubectl apply \
|
||||||
|
# --kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
||||||
|
# --filename dhcp-server/deployment.yaml
|
||||||
|
docker run --detach \
|
||||||
|
--name bootstrap-dhcp-server \
|
||||||
|
--network=host \
|
||||||
|
--volume $PWD/dhcp-server/dhcpd.conf:/data/dhcpd.conf \
|
||||||
|
networkboot/dhcpd:1.1.0
|
||||||
|
|
||||||
|
# Wait for all pods to be ready
|
||||||
kubectl wait pods \
|
kubectl wait pods \
|
||||||
--kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
--kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
|
||||||
--all \
|
--all \
|
||||||
@ -52,5 +67,6 @@ clusterctl get kubeconfig \
|
|||||||
homelab > kubeconfig.yaml
|
homelab > kubeconfig.yaml
|
||||||
|
|
||||||
# Cleanup ephemeral cluster
|
# Cleanup ephemeral cluster
|
||||||
# kind delete cluster --name bootstrap-cluster
|
kind delete cluster --name bootstrap-cluster
|
||||||
# rm ephemeral-cluster/kind-kubeconfig.yaml
|
rm ephemeral-cluster/kind-kubeconfig.yaml
|
||||||
|
docker rm --force bootstrap-dhcp-server
|
||||||
|
Loading…
Reference in New Issue
Block a user