Create DHCP server when bootstrap

This commit is contained in:
Khue Doan 2021-07-24 02:33:02 +07:00
parent 3477e4ef43
commit 3da62ff7a1
No known key found for this signature in database
GPG Key ID: 4C1A90A461B3C27B

View File

@ -15,6 +15,21 @@ clusterctl init \
--infrastructure sidero \
--kubeconfig ephemeral-cluster/kind-kubeconfig.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 \
--kubeconfig ephemeral-cluster/kind-kubeconfig.yaml \
--all \
@ -52,5 +67,6 @@ clusterctl get kubeconfig \
homelab > kubeconfig.yaml
# Cleanup ephemeral cluster
# kind delete cluster --name bootstrap-cluster
# rm ephemeral-cluster/kind-kubeconfig.yaml
kind delete cluster --name bootstrap-cluster
rm ephemeral-cluster/kind-kubeconfig.yaml
docker rm --force bootstrap-dhcp-server