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
{{ message }}
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.
Hey,
Thanks for the inspiration. As you have mentioned in the readme that multinode is still todo.
I had to solve it in my case and below you can find a nix snippet to make multicluster work.
I was a bit unhappy to keep whole node config and registry in repo, so in my solution:
I’m taking the node config and appending local repo to all nodes
Using helm chart for registry docker-helm-chart instead of keeping custom definition within registry.
In my case it works well, however I had to change local registry path to dev.local to make knative happy.
{pkgs,env-config}:
withpkgs;letdocker="${pkgs.docker}/bin/docker";docker-cfg=env-config.docker;registry-alias="${docker-cfg.registry}";# dev.local - to make knative happyexposed-port=docker-cfg.local-registry.exposedPort;# 32001cluster-name=env-config.projectName;change-config=pkgs.writeScript"change-config"'' sed '/\[plugins.cri.registry.mirrors\]/s/.*/&\ \ [plugins.cri.registry.mirrors."${registry-alias}"\]\ \ endpoint = \["http:\/\/host.docker.internal:${toStringexposed-port}"\]/' $1 > $1.toml '';get-kind-nodes=pkgs.writeScript"get-kind-nodes"''${docker} ps --filter 'name=${cluster-name}-*' --format "{{.Names}}" '';get-node-config=pkgs.writeScript"get-node-config"'' node=$1${docker} exec $node cat /etc/containerd/config.toml '';copy-config=pkgs.writeScript"copy-config-to-node"'' config=$1 node=$2${docker} cp $config.toml $node:/etc/containerd/config.toml '';restart-node-containerd=pkgs.writeScript"restart-node-containerd"'' node=$1${docker} exec $node systemctl restart containerd.service${docker} exec $node systemctl restart kubelet.service '';inpkgs.writeScriptBin"append-local-docker-registry"'' TEMP=$(mktemp -d) for node in $(${get-kind-nodes}); do config="$(${get-node-config} $node)" config_location=$TEMP/$node if [[ "$config" != *"${registry-alias}"* ]]; then echo "$config" > $config_location${change-config} $config_location${copy-config} $config_location $node${restart-node-containerd} $node echo "Adding local docker registry to node: $node" else echo "Containerd already aware of local registry: $node" fi done''
To make picture clear and be able to automate all these things, flow which works for me is as follows:
create kind cluster
apply changes to configuration - to kind nodes (above script)
apply helm chart and wait to be ready on kubernetes (wait for pod)
upload images to localhost:32001
at this point all images will be available
The text was updated successfully, but these errors were encountered:
damianbaar
changed the title
Handling multicluster variant for kind
Handling multinode variant for kindJul 9, 2019
Hey,
Thanks for the inspiration. As you have mentioned in the readme that multinode is still todo.
I had to solve it in my case and below you can find a
nix
snippet to make multicluster work.I was a bit unhappy to keep whole node config and registry in repo, so in my solution:
In my case it works well, however I had to change local registry path to
dev.local
to makeknative
happy.To make picture clear and be able to automate all these things, flow which works for me is as follows:
kind
clusterkind
nodes (above script)kubernetes
(wait for pod)localhost:32001
The text was updated successfully, but these errors were encountered: