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

Out of main pod containers #48

Closed
l0rd opened this issue May 18, 2020 · 8 comments · Fixed by #86
Closed

Out of main pod containers #48

l0rd opened this issue May 18, 2020 · 8 comments · Fixed by #86

Comments

@l0rd
Copy link
Contributor

l0rd commented May 18, 2020

In current devfile spec there it is not possible to specify if a container will be run as part of the main dev environment pod[1] or if it should run in its own separated pod. In the v2.0.0 spec we would like to add a new field (dedicatedPod ) that can be applied to container components.

components:
  - container:
        image: maven
        dedicatedPod: true          # <-- Optional. Default value is false

[1] In Che the main pod is the pod where the editor and its plugins run.

@benoitf
Copy link
Contributor

benoitf commented May 18, 2020

hi, in the comment there is a typo on "runIsnOwnPod" (is/in)

alternatives could it be like dedicatedPod: true or separatePod: true

@l0rd
Copy link
Contributor Author

l0rd commented May 18, 2020

@benoitf thanks. Changed to dedicatedPod: true.

@metlos
Copy link

metlos commented May 19, 2020

I think we should be careful with the endpoint definitions (#33).

If the default endpoint exposure is none (which is fine for single-pod workspaces), the following would IMHO be slightly hard to decipher to the user:

components:
  - container:
        image: postgresql
        dedicatedPod: true
        endpoints:
        - name: dbPort
          targetPort: 5432

This definition would make the endpoint unreachable from the rest of the workspace (default exposure is none).

@kadel
Copy link
Member

kadel commented May 19, 2020

```yaml
  - kubernetes:
       reference: https://.../mongo.yaml
       dedicatedPod: true

⚠️ If a Kubernetes component specifies a resource of type Pod or Deployment and dedicatedPod is set to false the containers definition will be extracted and included in the development environment Pod.

I'm afraid that using dedicatedPod: true as default for the Kubernetes component might be a little bit confusing. In most of the cases, the reason why I would use the Kubernetes component in Devfile is to create additional more complex resources (like Secretes, CustomResources, StatefulSets, or even Deployments with customized parameters like RollingStrategy etc..). For a lot of resources extracting ContainerSpec and combining it with the environment Pod won't even make sense.
Would it maybe make sense to invert the default in Kubernetes component to be dedicatedPod: false, otherwise 99% of Devfiles will to specify dedicatedPod: false

@l0rd
Copy link
Contributor Author

l0rd commented May 19, 2020

@kadel I am ok with your proposal. @davidfestal @elsony what do you think about that?

@davidfestal
Copy link
Collaborator

I'm wondering whether the semantic of the dedicatedPod field would really be the same for container and kubernetes components. And obviously the expected default value for each one would not be the same as well:

  • For container components we're trying to express that we want to force a container to run outside the workspace POD (default is inside)
  • For kubernetes components we'd like to express that we want the containers involved in the kubernetes POD-like structures to be injected into the workspace POD (default is to create the kubernetes objects without any change).

So I'd rather start with the dedicatedPod field only for container components, and provide a distinct option the kubernetes component, possibly in a distinct issue.

@elsony
Copy link
Contributor

elsony commented May 20, 2020

+1 for the default value of dedicatedPod to be false. That's the mode that I foresee the majority of the containers are.
One thing that I'd like to confirm is the lifecycle of the pod if dedicatedPod is set to true. I assume that pod will still gets cleaned up properly when the removing the workspace.

@l0rd l0rd changed the title Out of main pod components Out of main pod containers May 26, 2020
@l0rd
Copy link
Contributor Author

l0rd commented May 26, 2020

Edited the description, discussed and agreed.

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

Successfully merging a pull request may close this issue.

6 participants