odpi / egeria-charts

Helm chart repository
https://odpi.github.io/egeria-charts
Apache License 2.0
13 stars 9 forks source link

Add ssh capability between deployed containers (odpi-egeria-lab) #126

Open planetf1 opened 2 years ago

planetf1 commented 2 years ago

When building demos in our coco pharma environment, on occasion we need to similar things happening on different systems - outside the scope of egeria operations. In particular this is often in the context of running a demo 'script' via a notebook

For example

planetf1 commented 2 years ago

Investigating:

Adding '-v10' to any kubectl command prints out the equivilent curl command to use. For example kubectl exec lab-odpi-egeria-lab-core-0 -- /bin/ls becomes

I0210 18:52:39.051518   38389 round_trippers.go:466] curl -v -XGET  -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.23.3 (darwin/amd64) kubernetes/816c97a" 'https://c108-e.eu-gb.containers.cloud.ibm.com:31413/api/v1/namespaces/lab/pods/lab-odpi-egeria-lab-core-0'
I0210 18:52:39.432094   38389 round_trippers.go:466] curl -v -XPOST  -H "X-Stream-Protocol-Version: v4.channel.k8s.io" -H "X-Stream-Protocol-Version: v3.channel.k8s.io" -H "X-Stream-Protocol-Version: v2.channel.k8s.io" -H "X-Stream-Protocol-Version: channel.k8s.io" -H "User-Agent: kubectl/v1.23.3 (darwin/amd64) kubernetes/816c97a" 'https://c108-e.eu-gb.containers.cloud.ibm.com:31413/api/v1/namespaces/lab/pods/lab-odpi-egeria-lab-core-0/exec?command=%2Fbin%2Fls&container=egeria&stderr=true&stdout=true'

This is cumbersome.

The intent of this issue was to look at how to invoke commands from the Jupyter container to the egeria - or other containers. If we restrict the change to jupyter only we can now just consider issuing the commands from Python.

Therefore the easiest root is actually to use https://github.com/kubernetes-client/python pip install kubernetes since the required credentials should be available under /var/run/secrets, placed there automatically by k8s