-
Notifications
You must be signed in to change notification settings - Fork 85
resolve: replicas issue and add network testing section #1388
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,3 +104,63 @@ Let’s look at an example of creating a multi-instance WordPress Service using | |
helm delete kubeplus -n $KUBEPLUS_NS | ||
python3 provider-kubeconfig.py delete $KUBEPLUS_NS | ||
``` | ||
|
||
## Network Isolation Testing | ||
|
||
This section verifies that the network policies are correctly isolating HelloWorldService instances. | ||
|
||
### Steps | ||
|
||
#### Install a Network Driver | ||
|
||
On Minikube, install a network driver capable of recognizing `NetworkPolicy` objects (e.g., Cilium): | ||
|
||
```bash | ||
$ minikube start --cni=cilium | ||
$ eval $(minikube docker-env) | ||
``` | ||
|
||
#### Refer for main readme for installing the kubeplus operator and plugings | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Refer main README ... |
||
|
||
#### Create HelloWorldService Instances | ||
|
||
```bash | ||
$ kubectl create -f hello-world-service-composition.yaml --kubeconfig=provider.conf | ||
$ kubectl create -f hs1.yaml --kubeconfig=provider.conf | ||
$ kubectl create -f hs2.yaml --kubeconfig=provider.conf | ||
``` | ||
|
||
#### Test Network Isolation | ||
|
||
- **Ping/HTTP Test from `hs1` to `hs2`:** | ||
|
||
```bash | ||
$ HELLOWORLD_POD_HS1=$(kubectl get pods -n hs1 --kubeconfig=provider.conf -o jsonpath='{.items[0].metadata.name}') | ||
$ kubectl exec -it $HELLOWORLD_POD_HS1 -n hs1 --kubeconfig=provider.conf -- curl <hs2-app-endpoint> | ||
``` | ||
|
||
The connection should be denied. | ||
|
||
- **Ping/HTTP Test from `hs2` to `hs1`:** | ||
|
||
```bash | ||
$ HELLOWORLD_POD_HS2=$(kubectl get pods -n hs2 --kubeconfig=provider.conf -o jsonpath='{.items[0].metadata.name}') | ||
$ kubectl exec -it $HELLOWORLD_POD_HS2 -n hs2 --kubeconfig=provider.conf -- curl <hs1-app-endpoint> | ||
``` | ||
|
||
The connection should be denied. | ||
|
||
--- | ||
|
||
## Clean Up | ||
|
||
### As Consumer | ||
|
||
```bash | ||
$ kubectl delete -f hs1-no-replicas.yaml --kubeconfig=provider.conf | ||
$ kubectl delete -f hs2-no-replicas.yaml --kubeconfig=provider.conf | ||
$ kubectl delete -f hello-world-service-composition.yaml --kubeconfig=provider.conf | ||
``` | ||
|
||
|
||
Ensure the `helloworldservices.platformapi.kubeplus` CRD is removed. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ spec: | |
version: v1alpha1 | ||
plural: helloworldservices | ||
# URL of the Helm chart that contains Kubernetes resources that represent a workflow. | ||
chartURL: https://github.com/cloud-ark/operatorcharts/blob/master/hello-world-chart-0.0.2.tgz?raw=true | ||
chartURL: https://github.com/cloud-ark/kubeplus/blob/master/examples/multitenancy/hello-world/hello-world-chart-0.0.3.tgz?raw=true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
chartName: hello-world-chart | ||
# respolicy defines the resource policy to be applied to instances of the specified custom resource. | ||
respolicy: | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correctly isolating application instances.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will use HelloWorldService as an example.