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

Add just recipe to configure multicluster with a flat network #11187

Merged
merged 1 commit into from
Aug 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ _linkerd-viz-uninit:
## linkerd multicluster
##

_mc-target-k3d-flags := "--k3s-arg --disable='local-storage,metrics-server@server:*'"
_mc-target-k3d-flags := "--k3s-arg --disable='local-storage,metrics-server@server:*' --k3s-arg '--cluster-cidr=10.23.0.0/24@server:*'"

linkerd-mc-install: _linkerd-init
{{ _linkerd }} mc install --set='linkerdVersion={{ linkerd-tag }}' \
Expand Down Expand Up @@ -502,10 +502,6 @@ _mc-target-load:
_mc-load

# Run the multicluster tests with cluster setup
#
# The multicluster test does its own installation of control planes/etc, so
# we don't do any setup beyond ensuring the cluster is present with images
# loaded.
mc-test: mc-test-load mc-test-run

mc-test-build:
Expand All @@ -514,6 +510,19 @@ mc-test-build:

mc-test-load: _mc-load _mc-target-load

k3d-source-server := "k3d-" + k3d-name + "-server-0"
k3d-target-server := "k3d-" + k3d-name + "-target-server-0"

_mc-route-output-fmt := "-o jsonpath='ip route add {.spec.podCIDR} via {.status.addresses[?(.type==\"InternalIP\")].address}'"
_mc-print-source-route := _kubectl + " " + "get node " + k3d-source-server + " " + _mc-route-output-fmt
_mc-print-target-route := "kubectl --context=k3d-" + k3d-name + "-target "+ "get node " + k3d-target-server + " " + _mc-route-output-fmt

# Allow two k3d server nodes to participate in a flat network
mc-flat-network-init:
@docker exec -it k3d-{{k3d-name}}-server-0 `{{_mc-print-target-route}}`
@docker exec -it k3d-{{k3d-name}}-target-server-0 `{{_mc-print-source-route}}`


# Run the multicluster tests without any setup
mc-test-run:
LINKERD_DOCKER_REGISTRY='{{ DOCKER_REGISTRY }}' \
Expand Down
Loading