Skip to content

Commit

Permalink
resolve: replicas issue and add network testing section
Browse files Browse the repository at this point in the history
  • Loading branch information
SuyogShinde942 committed Jan 31, 2025
1 parent e23d1f0 commit 82d2e2d
Showing 1 changed file with 18 additions and 9 deletions.
27 changes: 18 additions & 9 deletions examples/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Let’s look at an example of creating a multi-instance WordPress Service using

## Network Isolation Testing

This section verifies that the network policies are correctly isolating HelloWorldService instances.
This section verifies that the network policies are correctly isolating application instances.

### Steps

Expand All @@ -120,7 +120,7 @@ $ minikube start --cni=cilium
$ eval $(minikube docker-env)
```

#### Refer for main readme for installing the kubeplus operator and plugings
#### Refer main README for installing the kubeplus operator and plugings

#### Create HelloWorldService Instances

Expand All @@ -135,26 +135,35 @@ $ kubectl create -f hs2.yaml --kubeconfig=provider.conf
- **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>
# Get the Pod name for hs1
HELLOWORLD_POD_HS1=$(kubectl get pods -n hs1 --kubeconfig=provider.conf -o jsonpath='{.items[0].metadata.name}')

# Get the Pod IP for hs2
HS2_POD_IP=$(kubectl get pods -n hs2 --kubeconfig=provider.conf -o jsonpath='{.items[0].status.podIP}')

# Test connectivity from hs1 to hs2 using the IP
kubectl exec -it $HELLOWORLD_POD_HS1 -n hs1 --kubeconfig=provider.conf -- curl $HS2_POD_IP
```

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>
# Get the Pod name for hs2
HELLOWORLD_POD_HS2=$(kubectl get pods -n hs2 --kubeconfig=provider.conf -o jsonpath='{.items[0].metadata.name}')

# Get the Pod IP for hs1
HS1_POD_IP=$(kubectl get pods -n hs1 --kubeconfig=provider.conf -o jsonpath='{.items[0].status.podIP}')

# Test connectivity from hs2 to hs1 using the IP
kubectl exec -it $HELLOWORLD_POD_HS2 -n hs2 --kubeconfig=provider.conf -- curl $HS1_POD_IP
```

The connection should be denied.

---

## Clean Up

### As Consumer

```bash
$ kubectl delete -f hs1-no-replicas.yaml --kubeconfig=provider.conf
Expand Down

0 comments on commit 82d2e2d

Please sign in to comment.