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

Support volumes for components of type kubernetes/openshift #15122

Closed
metlos opened this issue Nov 6, 2019 · 2 comments
Closed

Support volumes for components of type kubernetes/openshift #15122

metlos opened this issue Nov 6, 2019 · 2 comments
Assignees
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P1 Has a major impact to usage or development of the system.
Milestone

Comments

@metlos
Copy link
Contributor

metlos commented Nov 6, 2019

Subtask of #14970

Is your task related to a problem? Please describe.

To be able to share storage between different components of the devfile, it would be beneficial to be able to specify volumes on the kubernetes/openshift components the same way it is possible on the dockerimage components.

Describe alternatives you've considered

There are two possible solutions how to apply volumes:

  1. Apply the volumes to all containers (matching the selector of the component). This might be dangerous because we might overwrite files that we don't want to in certain containers.
  2. Use the same mechanism as for entrypoints of k8s/openshift components, e.g. have a parentSelector + containerName on the volume to limit where the volume should be applied on potentially per-container basis.
@metlos metlos added the kind/task Internal things, technical debt, and to-do tasks to be performed. label Nov 6, 2019
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Nov 6, 2019
@skabashnyuk skabashnyuk added team/platform and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Nov 6, 2019
@skabashnyuk skabashnyuk added this to the Backlog - Platform milestone Nov 6, 2019
@skabashnyuk skabashnyuk added the severity/P1 Has a major impact to usage or development of the system. label Nov 6, 2019
@mshaposhnik mshaposhnik self-assigned this Mar 31, 2020
@mshaposhnik
Copy link
Contributor

mshaposhnik commented Mar 31, 2020

So there might be not very user-friendly message when volume defined in devfile matches any of the volumes defined in K8S/OS recipe (see below). So we cah either break workspace startup with more meaningful message, or just merge equal volumes to avoid messages at all. @metlos @l0rd WDYT?
Example:
Devfile:

...
components:
  - type: kubernetes
    reference: mongo-db.yaml
    volumes:
      - name: mongo-persistent-storage
        containerPath: /data/db

mongo-db.yaml:

spec:
        containers:
        - image: mongo
          name: mongo
          ports:
          - name: mongo
            containerPort: 27017
          volumeMounts:
              - name: mongo-persistent-storage
                mountPath: /data/db
        volumes:
          - name: mongo-persistent-storage
            persistentVolumeClaim:
              claimName: mongo-persistent-storage
-
  apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: mongo-persistent-storage
  spec:
    accessModes:
     - ReadWriteOnce
    resources:
      requests:
        storage: 1Gi

Result:
volume_duplicate

@mshaposhnik
Copy link
Contributor

So as for me, adding volume into devfile is an easy way to add volume into all containers without editing original recipe (when it's big or inaccessible for edit), so it looks logical just to add volume into all containers which did not containing it, and simply ignoring the ones which are already do contain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/task Internal things, technical debt, and to-do tasks to be performed. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

4 participants