networkservicemesh / examples

Network Service Mesh examples repo
Apache License 2.0
15 stars 27 forks source link

Simple-client not initialising correctly in examples #100

Open lewisfelix opened 3 years ago

lewisfelix commented 3 years ago

Good morning:

When following the instructions on simple-bridge, the containers become stuck in an Init:0/1 state in kubectl get pods, never reaching the "initialised" state.

The command kubectl logs pods/simple-client-ffcdd585c-5mvnl nsm-init-container throws the following errors:

time="2021-03-05T09:45:23Z" level=info msg="==--> RequestNetworkService() span:33b5c79275b34f64:33b5c79275b34f64:0:1" time="2021-03-05T09:45:23Z" level=info msg="ADVERTISE_NSE_NAME not found." time="2021-03-05T09:45:23Z" level=info msg="OUTGOING_NSC_NAME not found." time="2021-03-05T09:45:23Z" level=info msg="ADVERTISE_NSE_LABELS not found." time="2021-03-05T09:45:23Z" level=info msg="OUTGOING_NSC_LABELS not found." time="2021-03-05T09:45:23Z" level=info msg="NSC_INTERFACE_NAME not found." time="2021-03-05T09:45:23Z" level=info msg="MECHANISM_TYPE not found." time="2021-03-05T09:45:23Z" level=info msg="IP_ADDRESS not found." time="2021-03-05T09:45:23Z" level=info msg="POD_NAME not found." time="2021-03-05T09:45:23Z" level=info msg="NSM_NAMESPACE not found." time="2021-03-05T09:45:23Z" level=info msg="ROUTES not found." time="2021-03-05T09:45:23Z" level=info msg="NSM_NAMESPACE not found." time="2021-03-05T09:45:23Z" level=warning msg="global opentracer is already initialized" time="2021-03-05T09:45:23Z" level=info msg="Creating logger from config: &{nsm-client@simple-client-ffcdd585c-5mvnl false false [] 0xc000184780 0xc00005e3c0 }"

time="2021-03-05T09:50:24Z" level=info msg="FetchX509SVID.Recv failed with rpc error: code = PermissionDenied desc = no identity issued; aborting due to timeout (last success 5m0.018688341s ago)

Any idea what should be done in this case?

denis-tingaikin commented 3 years ago

@lewisfelix Hello, currently we are moving NSM to multirepo approach. Consider looking into https://github.com/networkservicemesh/deployments-k8s

denis-tingaikin commented 3 years ago

@lewisfelix To run a simple example you could look at:

https://github.com/networkservicemesh/deployments-k8s/tree/main/examples/basic see at Kernel to Kernel Connection

To run it you need to do:

  1. have a cluster.
  2. clone https://github.com/networkservicemesh/deployments-k8s
  3. move to directory with example
  4. Copy paste steps from Run into the terminal
  5. if the example has requires then need to do it first as described in step 4.

Let us know about any issues with it.

lewisfelix commented 3 years ago

Hello @denis-tingaikin

I did what you suggested and it worked like a charm! :) I tried to perform the examples kernel2kernel and memif2memif and they are working perfectly.

However, with this new approach I have some questions: in the examples there is no NetworkService defined per-se as it is suggested in the main documentation of NSM (rather only the customisation file), so in this case how can it be performed the connectivity between two different endpoints for example? Do you have a case of such nature for this approach?

denis-tingaikin commented 3 years ago

I did what you suggested and it worked like a charm! :) I tried to perform the examples kernel2kernel and memif2memif and they are working perfectly.

That's good to hear.

However, with this new approach I have some questions: in the examples there is no NetworkService defined per-se as it is suggested in the main documentation of NSM (rather only the customisation file)

Currently, we have an example of NSE that provides a simple icmp-responder service: https://github.com/networkservicemesh/cmd-nse-icmp-responder/blob/master/main.go#L70

So our NSC in the examples applies with a kustomization patch to connect to the icmp-responder service look at https://github.com/networkservicemesh/deployments-k8s/blame/main/examples/use-cases/Kernel2Kernel/README.md#L65 You can replace it with another.

so in this case how can it be performed the connectivity between two different endpoints for example?

It's a good point to improve our examples. Let's create an Issue about an example for the Endpoint to Endpoint connection and we'll consider it.

lewisfelix commented 3 years ago

OK perfect! I will be taking a deeper look on the examples then, as it seems a really interesting solution for complex networking cases with K8s!

That example would be great to have in my honest opinion in order to show the potential regarding how this tool could interconnect two services in any k8s cluster. Therefore, shall we close this issue and open a new one in the repo that you pointed out?

Again, thank you so much for everything!