Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] cluster lifecycle hooks #205

Open
inercia opened this issue Mar 10, 2020 · 1 comment
Open

[FEATURE] cluster lifecycle hooks #205

inercia opened this issue Mar 10, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@inercia
Copy link
Collaborator

inercia commented Mar 10, 2020

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.conf
server=/$K3D_CLUSTER.local/$dns_server
local=/$K3D_CLUSTER.local/ 
EOF

Depends on #204

@inercia inercia added the enhancement New feature or request label Mar 10, 2020
@iwilltry42 iwilltry42 added this to the v4.2.0 milestone Feb 5, 2021
@iwilltry42
Copy link
Member

We have NodeHookActions now, which have yet to be "opened up" for general usage.

@iwilltry42 iwilltry42 self-assigned this Feb 5, 2021
@iwilltry42 iwilltry42 modified the milestones: v4.3.0, v4.4.0 Mar 10, 2021
@iwilltry42 iwilltry42 modified the milestones: v4.4.5, v5.0.0 Jun 11, 2021
@iwilltry42 iwilltry42 assigned inercia and unassigned iwilltry42 Jul 21, 2021
@iwilltry42 iwilltry42 modified the milestones: v5.0.0, v5.1.0 Sep 6, 2021
@iwilltry42 iwilltry42 modified the milestones: v5.1.0, v5.2.0 Nov 5, 2021
@iwilltry42 iwilltry42 modified the milestones: v5.3.0, v5.4.0 Dec 20, 2021
@iwilltry42 iwilltry42 modified the milestones: v5.4.0, v5.5.0 Mar 24, 2022
@iwilltry42 iwilltry42 modified the milestones: v5.5.0, v5.6.0 May 17, 2023
@iwilltry42 iwilltry42 modified the milestones: v5.6.0, v5.8.0 Sep 28, 2023
@iwilltry42 iwilltry42 modified the milestones: v5.8.0, v5.7.0 Apr 3, 2024
@iwilltry42 iwilltry42 modified the milestones: v5.7.0, v5.8.0 Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants