You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to provide some hooks for the lifecycle of the k3d clusters. These hooks would be invoked, for example, after a cluster is created, before a cluster is destroyed, after the registry is created, etc. They would receive some information from k3d in environment variables.
For example, in the k3d config file located at $HOME/.config/k3d/config:
hooks:
post-create: $HOME/.kd3/post-create.sh
And post-create.sh:
#!/bin/sh# input: some variables like K3D_CLUSTER_NAME, K3D_MASTER_IP, K3D_CLUSTER_IPS, etc
dns_server=""# TODO: calculate the DNS server from $K3D_CLUSTER_IPS# route all the 10.0.x.x traffic to the cluster via the master
sudo ip route add $K3D_CLUSTER_IPS via $K3D_MASTER_IP# this would resolve (from the host) all the services running in this k3d cluster# with the DNS server inside the cluster
cat<<EOF > /etc/NetworkManager/dnsmasq.d/$K3D_CLUSTER_NAME.confserver=/$K3D_CLUSTER.local/$dns_serverlocal=/$K3D_CLUSTER.local/ EOF
It would be nice to provide some hooks for the lifecycle of the k3d clusters. These hooks would be invoked, for example, after a cluster is created, before a cluster is destroyed, after the registry is created, etc. They would receive some information from k3d in environment variables.
For example, in the k3d config file located at
$HOME/.config/k3d/config
:And
post-create.sh
:Depends on #204
The text was updated successfully, but these errors were encountered: