Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Add support for ephemeral containers #1703

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

GuessWhoSamFoo
Copy link
Contributor

This PR contains an initial pass at supporting ephemeral containers in Octant. If the feature gate is enabled when visiting a pod, it will automatically add debug container using a debian image.

Pods with an ephemeral container will have their object status modified as warning (yellow).

If there is interest in this feature, further efforts can be invested into making the debug container configurable and proper UI.

Which issue(s) this PR fixes

Special notes for your reviewer:
Example of a distroless image where sh and bash will not work:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  selector:
    matchLabels:
      app: nginx
  replicas: 3
  template:
    metadata:
      labels:
        app: nginx
    spec:
      shareProcessNamespace: true
      containers:
      - name: nginx
        image: sfoo/nginx-distroless:latest
        ports:
        - containerPort: 80
        - containerPort: 443

Testing if a feature gate is enabled using mocked clients is not straightforward and I haven't figured out a way to do this yet. The terminal viewer component is pending a refactor soon because the terminal viewer does not have knowledge of the manager's state which causes unnecessary synchronization challenges.

Signed-off-by: GuessWhoSamFoo foos@vmware.com

@GuessWhoSamFoo GuessWhoSamFoo force-pushed the feature-gate branch 2 times, most recently from 6d61a77 to e64b6f9 Compare December 3, 2020 02:20
Copy link
Contributor

@wwitzel3 wwitzel3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good, part of this should be a PR that lands in upstream as its own change though.

internal/api/terminal_manager.go Outdated Show resolved Hide resolved
Signed-off-by: GuessWhoSamFoo <foos@vmware.com>
@wwitzel3 wwitzel3 merged commit 381e1e5 into vmware-archive:master Jan 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create ephemeral containers for debugging
2 participants