Fix getting-started guide: Use full paths for YAML files and correct kubeconfig references#1451
Merged
devdattakulkarni merged 3 commits intocloud-ark:masterfrom Feb 9, 2026
Conversation
…t kubeconfig Update all YAML file references to use full relative paths from repository root: - examples/multitenancy/hello-world/hello-world-service-composition.yaml - examples/multitenancy/hello-world/hs1.yaml - examples/multitenancy/hello-world/hs2.yaml - examples/multitenancy/hello-world/hs1-no-replicas.yaml - examples/multitenancy/hello-world/hs2-no-replicas.yaml Update all kubeconfig references to use kubeplus-saas-provider.json (the actual file created by provider-kubeconfig.py in the root directory) instead of provider.conf. This allows users to run commands from the repository root without needing to change directories or create additional config files.
- Update getting-started.md to use full paths for YAML files from repo root - Fix kubeconfig references to use kubeplus-saas-provider.json (actual file created) - Add CRD wait step before creating HelloWorldService instances - Fix kubectl-allow-network-traffic and kubectl-deny-network-traffic wrappers to properly handle -k flag by reordering arguments for argparse compatibility - Add -k flag back to allow/deny commands in getting-started guide This allows users to run all commands from the repository root without needing to change directories, and ensures the -k flag works correctly as documented in kubectl-kubeplus-commands help text.
| ns2="$2" | ||
| shift 2 | ||
|
|
||
| # "$@" now contains any remaining flags (e.g. -k kubeplus-saas-provider.json) |
| shift 2 | ||
|
|
||
| # "$@" now contains any remaining flags (e.g. -k kubeplus-saas-provider.json) | ||
| python3 "$KUBEPLUS_HOME/plugins/network_traffic.py" "$@" allow "$ns1" "$ns2" |
Contributor
There was a problem hiding this comment.
By shifting out ns1 and ns2, there is no issue of duplicates in $@.
Contributor
|
@anniegracehu Looks good!! |
| # This wrapper passes all arguments to our Python script. | ||
| python3 "$KUBEPLUS_HOME/plugins/network_traffic.py" allow "$@" | ||
| # Usage (as advertised in kubectl-kubeplus-commands): | ||
| # kubectl allow network traffic <ns1> <ns2> [-k <kubeconfig>] |
Contributor
There was a problem hiding this comment.
Will this change work if we don't provide the kubeconfig parameter (i.e., if -k is missing)
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
This PR fixes the Network Isolation Testing section in
examples/getting-started.mdand thekubectl-allow-network-traffic/kubectl-deny-network-trafficplugin wrappers so that:-kflag works as advertisedChanges
Getting Started Guide (
examples/getting-started.md)YAML file paths: Changed from relative filenames (requiring
cdinto subdirectories) to full relative paths from repository root:examples/multitenancy/hello-world/hello-world-service-composition.yamlexamples/multitenancy/hello-world/hs1.yamlexamples/multitenancy/hello-world/hs2.yamlexamples/multitenancy/hello-world/hs1-no-replicas.yamlexamples/multitenancy/hello-world/hs2-no-replicas.yamlKubeconfig filename: Changed from
provider.conftokubeplus-saas-provider.json(the actual file created byprovider-kubeconfig.pyin the root directory).CRD wait step: Added a wait loop between ResourceComposition creation and instance creation to ensure the HelloWorldService CRD is registered, preventing "resource mapping not found" errors.
Network traffic commands: Updated to include
-k kubeplus-saas-provider.jsonflag (now works correctly with the wrapper fix below).Plugin Wrappers (
plugins/kubectl-allow-network-traffic,plugins/kubectl-deny-network-traffic)Fixed
-kflag parsing: The wrappers now reorder arguments so that-k(when present) comes before the subcommand, matching whatargparseexpects.Current behavior (on master):
kubectl allow-network-traffic hs1 hs2 -k file→ wrapper passesallow hs1 hs2 -k file→ argparse failsFixed behavior (this PR):
kubectl allow-network-traffic hs1 hs2 -k file→ wrapper reorders to-k file allow hs1 hs2→ argparse parses correctlyThis makes the documented CLI shape (
kubectl allow network traffic <ns1> <ns2> [-k <kubeconfig>]) work as intended.Testing
Verified end-to-end on Minikube with Cilium CNI:
minikube start --cni=cilium)kubectl allow-network-traffic hs1 hs2 -k kubeplus-saas-provider.jsonkubectl deny-network-traffic hs1 hs2 -k kubeplus-saas-provider.jsonAll commands work correctly from the repository root without requiring directory changes.