question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Istio-sidecar handling

See original GitHub issue

/kind feature

Describe the solution you’d like [A clear and concise description of what you want to happen.]

I’d like to run katib-experiment with istio-sidecar injection. I guess the reason why katib induce user to run katib-experiment with istio-sidecar injection “false” was something like this:

Thus, the following problem is maybe the main issue. A) katib’s metrics-logger-and-collector sidecar container should know when the istio-proxy sidecar container started B) metrics-logger-and-collector sidecar container should kill when the main container finished well or not.


By the way I think changing initial-logic and end-logic in metrics-collector image, katib could handle this.

Maybe something like this;

  1. Handling issue B above from metrics-collector (https://github.com/kubeflow/katib/blob/eea6ada974ee11daf13fc66627696c458b4bad77/cmd/metricscollector/v1beta1/file-metricscollector/main.go#L339)
func killIstioProxySidecar() {
	klog.Infof("Let's kill istio-proxy sidecar")

	// curl -fsI -X POST http://localhost:15020/quitquitquit
	resp, err := http.Post("http://localhost:15020/quitquitquit", "text/plain", bytes.NewBufferString(""))
	if err != nil {
		// TODO 
		klog.Infof("there is no istio-proxy sidecar")
	}

	defer resp.Body.Close()
	klog.Infof("istio-proxy sidecar killed")
}

func main() {
	defer killIstioProxySidecar()

	flag.Var(&stopRules, "stop-rule", "The list of early stopping stop rules")
	flag.Parse()
	klog.Infof("Trial Name: %s", *trialName)
.....
  1. Also, pass the process from istio-proxy sidecar nearby here
		// Ignore istio-sidecar processes
                // TODO this must be more sophisticated to catch istio-proxy's process
		if strings.Contains(cmdline, "envoy") || strings.Contains(cmdline, "sidecar") {
			fmt.Printf("Ignore istio-sidecar container's processes")
			continue
		}
  1. Handling issue A above. I have no idea how to implement this now, but the primary container’s command should be changed automatically by katib experiment/trial’s controller as follows:
  • Before
- command:
  - <YOUR_COMMAND>;
  • After
- command:
  - /bin/sh
  - -c
  - |
    until curl -fsI http://localhost:15021/healthz/ready; do echo \"Waiting for Sidecar...\"; sleep 3; done;
    echo \"Sidecar available. Running the command...\";
    <YOUR_COMMAND>
  • I guess there is the way since katib-controller already automatically adds echo completed > /var/log/katib/$$$$.pid at the end of primary-container’s command.

Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]

  • I’m afraid this feature could be generalized except “Job” kind.
    • But for “Job”, this might be useful who wants to work with istio-sidecar

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:16 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
anencore94commented, Oct 18, 2021

Thanks @tenzen-y I changed the links

0reactions
longpi1commented, Sep 22, 2022

I remember I solved this problem before, if you need, you can chat with me privately, or I will propose a PR。

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sidecar - Istio
The Sidecar configuration provides a way to fine tune the set of ports, protocols that the proxy will accept when forwarding traffic to...
Read more >
Handling Istio Sidecars in Kubernetes Jobs - Medium
Whenever a new pod is created in Kubernetes Istio creates a sidecar container that proxies all traffic in and out of the pod....
Read more >
Understanding the Sidecar Injection, Traffic Intercepting ...
How are the sidecar injections done in Istio? How does the sidecar proxy ... Istio currently supports handling inbound traffic via tproxy.
Read more >
Enable Istio Proxy Sidecar Injection in Oracle Cloud Native ...
Istio uses a sidecar design, which means that communication proxies run in their own containers beside every service container. To put Istio automatic...
Read more >
Goodbye Sidecars: Could eBPF Steal Istio Service Meshes ...
The sidecar pattern has historically made a lot of sense for managing microservices within distributed apps that are deployed as containers and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found