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.37k stars 361 forks source link

Couldn't find any Pods #1690

Closed edim24 closed 2 years ago

edim24 commented 3 years ago

After upgrading to version 5.16.0 devspace did not start correctly.

devspace dev
[info]   Using namespace 'de'
[info]   Using kube context 'kubernetes-admin@kubernetes'
[info]   Skipping building image nginx                                           
[info]   Skipping building image node
[info]   Execute 'helm list --namespace de --output json --kube-context kubernetes-admin@kubernetes'
[info]   Skipping deployment edim24-project

#########################################################
[info]   DevSpace UI available at: http://localhost:8090
#########################################################

[0:sync] Waiting for pods...
[warn]   DevSpace still couldn't find any Pods that match the selector. DevSpace will continue waiting, but this operation might timeout
[fatal]  start sync: unable to start sync: Error selecting pod: timeout: couldn't find a pod / container in time with image selector: image(node):tag(node)

After downgrading to version 5.15.0 devspace could find all pods.

FabianKramm commented 3 years ago

@edim24 thanks for opening this PR! Could you share your devspace.yaml please? What happens if you do a devspace purge and devspace dev -b -d?

edim24 commented 3 years ago

I've tried both devspace purge devspace dev -b -d

No effect (((

My devspace.yaml looks like this:

version: v1beta9
vars:
  - name: TAG
    default: "master"
    source: none
images:
  node:
    image: example.com/node:${TAG}
    build:
      disabled: true
  nginx:
    image: example.com/nginx:${TAG}
    preferSyncOverRebuild: true
    build:
      disabled: true
deployments:
  - name: foobar
    helm:
      replaceImageTags: false
      chart:
        name: ./dev/chart
      values:
        ingress:
          enabled: true
          annotations:
            kubernetes.io/ingress.class: ingress-private
            kubernetes.io/ingress.provider: nginx
            cert-manager.io/cluster-issuer: cert-manager-issuer
dev:
  logs:
    sync: false
    images:
      - node
  open:
    - url: https://${DEVELOPER_TAG}.foobar.example.com
  sync:
    - imageName: node
      disableDownload: false
      localSubPath: ./
      containerPath: /src/
      uploadExcludePaths:
        - node_modules
        - dist
        - dev

profiles:
  - name: build
    patches:
      - op: replace
        path: deployments.name=foobar.helm.values.node.image
        value: example.com/node:dev-${DEVELOPER_TAG}
      - op: add
        path: deployments.name=foobar.helm.values.node.build
        value:
          disabled: false
          docker:
            useBuildKit: true
      - op: replace
        path: deployments.name=foobar.helm.values.nginx.image
        value: example.com/nginx:dev-${DEVELOPER_TAG}
      - op: add
        path: deployments.name=foobar.helm.values.nginx.build
        value:
          disabled: false
          docker:
            useBuildKit: true
      - op: replace
        path: deployments.name=foobar.helm.replaceImageTags
        value: true
    merge:
      images:
        node:
          image: example.com/node
          build:
            disabled: false
            docker:
              useBuildKit: true
              options:
                target: node
          tags:
            - dev-${DEVELOPER_TAG}
        nginx:
          image: example.com/nginx
          preferSyncOverRebuild: true
          build:
            disabled: false
            docker:
              useBuildKit: true
          tags:
            - dev-${DEVELOPER_TAG}
  - name: debug
    patches:
      - op: add
        path: dev.ports
        value:
          - imageName: node
            forward:
              - port: 9229
                remotePort: 9229
FabianKramm commented 3 years ago

@edim24 thanks for the information! I guess the problem is the image: example.com/node:${TAG}, you need to specify it like this:

images:
  node:
    image: example.com/node
    tags: ["${TAG}"]
    build:
      disabled: true
  nginx:
    image: example.com/nginx
    tags: ["${TAG}"]
    preferSyncOverRebuild: true
    build:
      disabled: true