devspace-sh / devspace

DevSpace - The Fastest Developer Tool for Kubernetes ⚡ Automate your deployment workflow with DevSpace and develop software directly inside Kubernetes.
https://devspace.sh
Apache License 2.0
4.4k stars 362 forks source link

Deploy job while `devspace dev` is running #2564

Open ddziech opened 1 year ago

ddziech commented 1 year ago

What happened? I'm trying to deploy a kubernetes job with devspace 6 while devspace dev is running.

What did you expect to happen instead? The job inside profile xyz-my-job-generate will be deployed.

How can we reproduce the bug? (as minimally and precisely as possible)

My devspace.yaml:

version: v2beta1
name: xyz

vars:
  PHP_IMAGE: "xyz-webapp-php"
  PHP_MY_JOB_IMAGE: "xyz-my-job"
  NGINX_IMAGE: "xyz-webapp-nginx"

deployments:
  webapp:
    namespace: xyz-dev
    kubectl:
      manifests:
        - kustomize/overlays/dev/webapp/
      kustomize: true

dev:
  php:
    imageSelector: '${PHP_IMAGE}'
    sync:
      - path: ./:/app
        excludePaths:
          - .git/
          - .idea/
          - .devspace/
          - var
          - docker
          - terraform
          - k8s
        uploadExcludePaths:
          - node_modules
        initialSync: preferLocal
        printLogs: true
    logs: { }
  nginx:
    imageSelector: '${NGINX_IMAGE}'
    sync:
      - path: ./public:app/public
        initialSync: preferLocal
        disableDownload: true
        printLogs: true
    logs: { }

profiles:
  - name: xyz-my-job-generate
    replace:
      images:
        php:
          image: '${PHP_MY_JOB_IMAGE}'
          tags:
            - 'dev-php-my-job-${DEVSPACE_GIT_COMMIT}-${DEVSPACE_TIMESTAMP}'
          dockerfile: docker/web/Dockerfile
          context: .
          target: php-dev
          buildKit: { }
      deployments:
        xyz-my-job-generate:
          namespace: xyz-dev
          kubectl:
            manifests:
              - kustomize/overlays/dev/my-job/
            kustomize: true

images:
  php:
    image: '${PHP_IMAGE}'
    tags:
      - 'dev-php-${DEVSPACE_GIT_COMMIT}-#####'
    dockerfile: docker/web/Dockerfile
    context: .
    target: php-dev
    buildKit: { }

  nginx:
    image: '${NGINX_IMAGE}'
    tags:
      - 'dev-nginx-${DEVSPACE_GIT_COMMIT}-#####'
    dockerfile: docker/web/Dockerfile
    context: .
    target: nginx-dev
    buildKit: { }

...

Local Environment:

Anything else we need to know? It works in devspace 5 pkg/devspace/pipeline/pipeline.go:108

lizardruss commented 1 year ago

Hello! Thanks for reporting this issue. We will look into a fix, since this worked in DevSpace v5.