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

Factory flow should support k8s/OS tool in Devfile #12266

Closed
sleshchenko opened this issue Dec 22, 2018 · 1 comment
Closed

Factory flow should support k8s/OS tool in Devfile #12266

sleshchenko opened this issue Dec 22, 2018 · 1 comment
Assignees
Labels
kind/enhancement A feature request - must adhere to the feature request template. status/in-progress This issue has been taken by an engineer and is under active development.

Comments

@sleshchenko
Copy link
Member

Description

The goal is to improve factory flow to support k8s/OS tool with a relative path to a configuration file specified in Devfile.

# An example of Devfile with Kubernetes/OpenShift tool specified
---
specVersion: 0.0.1
name: petclinic-dev-environment
projects:
  - name: petclinic
    source:
      type: git
      location: 'git@github.com:spring-projects/spring-petclinic.git'
tools:
  - name: petclinic-app
    type: kubernetes
    local: petclinic-app.yml
  - name: theia-ide
    type: cheEditor
    id: eclipse/theia:0.0.3
  - name: jdt.ls
    type: chePlugin
    id: eclipse/theia-jdtls:0.0.3
commands:
  - name: run
    actions:
      - type: exec
        tool: petclinic-app
        command: `./catalina.sh start`
        workdir: /home/user/app/tomcat

An idea is not to embed k8s/OS yaml into Devfile model but just reference file with k8s/OS content that is located in the same repository where Devfile lives.
Then resolve factory flow should parse Devfile and fetch k8s/OS tool configuration content by specified relative path in repository. Then the environment should be provisioned into Factory#getWorkspaceConfig with fetched k8s/OS configuration as content of recipe with type kubernetes/openshift.

# An example OpenShift Tool Configuration
apiVersion: v1
kind: List
items:
- apiVersion: v1
  kind: Pod
  metadata:
    name: petclinic
    labels:
      app: petclinic
  spec:
    containers:
    - name: server
      image: mariolet/petclinic
      ports:
      - containerPort: 8080
        protocol: TCP
      resources:
        limits:
        memory: 512Mi
    - name: mysql
      image: centos/mysql-57-centos7
      env:
      - name: MYSQL_USER
        value: petclinic
      - name: MYSQL_PASSWORD
        value: petclinic
      - name: MYSQL_ROOT_PASSWORD
        value: petclinic
      - name: MYSQL_DATABASE
        value: petclinic
      ports:
      - containerPort: 3306
        protocol: TCP
      resources:
        limits:
        memory: 512Mi
- kind: Service
  apiVersion: v1
  metadata:
    name: petclinic
    labels:
      app: petclinic
  spec:
    ports:
      - name: web
        port: 8080
        targetPort: 8080
    selector:
      app: petclinic
- kind: Service
  apiVersion: v1
  metadata:
    name: mysql
    labels:
      app: petclinic
  spec:
    ports:
      - name: mysql
        port: 3306
        targetPort: 3360
    selector:
      app: petclinic
@sleshchenko sleshchenko added kind/enhancement A feature request - must adhere to the feature request template. team/platform labels Dec 22, 2018
@sleshchenko
Copy link
Member Author

It depends on #11906

@mshaposhnik mshaposhnik reopened this Jan 2, 2019
@mshaposhnik mshaposhnik self-assigned this Jan 2, 2019
@mshaposhnik mshaposhnik added the status/in-progress This issue has been taken by an engineer and is under active development. label Jan 3, 2019
@slemeur slemeur mentioned this issue Jan 3, 2019
69 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A feature request - must adhere to the feature request template. status/in-progress This issue has been taken by an engineer and is under active development.
Projects
None yet
Development

No branches or pull requests

2 participants