Skip to content
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

Adding a sidecar to session pods via job-json-overrides prevents Workbench from connecting to session #145

Open
d-m opened this issue Jan 19, 2022 · 2 comments
Labels

Comments

@d-m
Copy link
Contributor

d-m commented Jan 19, 2022

We run node_exporter in user sessions to get additional metrics on session read/write behavior. We currently install it in each session container but would like to run it as a sidecar instead to simplify our images. When I added the following to the job-json-overrides section of the config:

config:
  profiles:
    launcher.kubernetes.profiles.conf:
      "*":
        job-json-overrides:
          - target: /spec/template/spec/containers/1
            json:
              image: "quay.io/prometheus/node-exporter:v1.3.1"
              name: "node-exporter"
              command:
                - node_exporter
                - --collector.disable-defaults
                - --collector.mountstats
                - --web.disable-exporter-metrics
            name: nodeExporterSidecar

the sidecar is created and the pod starts. However, Workbench is unable to connect to the pod and reports the following error in /var/log/rstudio/launcher/rstudio-kubernetes-launcher.log:

2022-01-19T01:24:36.087036Z [rstudio-kubernetes-launcher] ERROR system error 71 (Protocol error) [description: watchPodLogs: received non-streaming response: Bad Request - {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"a container name must be specified for pod session-34051cfc78a31b207e05e-USERNAME---rstudio-sessio--1-vblzj, choose one of: [5964456645756e31523730702b4b57455844483063773d3d node-exporter]","reason":"BadRequest","code":400}|||]; OCCURRED AT rstudio::job_launcher::impls::kubernetes::KubernetesApi::watchPodLogs(const string&, const OnLogOutputHandler&, const ErrorHandler&)::<lambda(const rstudio::core::http::Response&)> src/cpp/job_launcher/impls/kubernetes/KubernetesApi.cpp:1092; LOGGED FROM: rstudio::job_launcher::impls::kubernetes::KubernetesOutputStream::init()::<lambda(const rstudio::core::json::Array&)>::<lambda(const rstudio::core::Error&)> src/cpp/job_launcher/impls/kubernetes/KubernetesOutputStream.cpp:85

It looks like the Kubernetes Plugin assumes that there will only be one container per session pod. There's no issue with the Helm chart, so If this isn't the right venue for this error please let me know and I'll report it via support and our sales rep.

@colearendt
Copy link
Contributor

Thanks for reporting this!! I believe the new version of RStudio Workbench should resolve this issue. We will aim to have that built into a container and integrated into the helm chart next week 😄

@colearendt colearendt added the rsw label Apr 23, 2022
@colearendt
Copy link
Contributor

Next week became months... wowzers. In any case, we are nearing having the template integration built into the helm chart. Per #161 , if you have any examples of job-json-overrides that you are using and are able to share, it'd be great to ensure that we have commonly used values taken care of when we ship it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants