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

Skaffold reports attempting to sync with wrong pods #2797

Closed
demisx opened this issue Sep 4, 2019 · 2 comments · Fixed by #2802
Closed

Skaffold reports attempting to sync with wrong pods #2797

demisx opened this issue Sep 4, 2019 · 2 comments · Fixed by #2802
Assignees
Labels
area/logging area/sync kind/bug Something isn't working priority/p1 High impact feature/bug.

Comments

@demisx
Copy link
Contributor

demisx commented Sep 4, 2019

Expected behavior

Skaffold will sync only with pods that the file sync is enabled for and disregard everything else.

Actual behavior

Though, Skaffold seems to sync with the correct destination pod, it also reports not being able to sync with many other pods and a job which I didn't even ask it to sync with. This even includes pods from different namespace, e.g. "kube-system". This is what I'm seeing after modifying just one file publish-ad.spec.ts in default namespace. If I read the log correctly, it appears to sync in non-related pods, but skips them because they are not running at the moment.

INFO[1719] files modified: [api/test/request/ad/publish-ad.spec.ts] 
INFO[1720] files modified: [api/test/request/ad/publish-ad.spec.ts] 
Syncing 1 files for api.dev:fee6b6649a885c677f9ebd9b9329821ba5a6982ab97a2407f46ead41584c8ee4
INFO[1720] Copying files: map[api/test/request/ad/publish-ad.spec.ts:[/usr/src/dl/api/test/request/ad/publish-ad.spec.ts]] to api.dev:fee6b6649a885c677f9ebd9b9329821ba5a6982ab97a2407f46ead41584c8ee4 
INFO[1720] Skipping sync with pod init-db-s29wm because it's not running 
INFO[1720] Skipping sync with pod compose-6c67d745f6-tjnkb because it's not running 
INFO[1720] Skipping sync with pod compose-api-57ff65b8c7-lvtnb because it's not running 
INFO[1720] Skipping sync with pod coredns-fb8b8dccf-dbxtw because it's not running 
INFO[1720] Skipping sync with pod coredns-fb8b8dccf-pq226 because it's not running 

Information

  • Skaffold version: 81c50fe
  • Operating system: MacOs Mojave 10.14.6
  • Contents of skaffold.yaml:
apiVersion: skaffold/v1beta13
kind: Config
profiles:
  - name: dev
    activation:
      - command: dev
    deploy:
      kubectl:
        manifests:
          - api/app/k8s/dev/api.k8s-config.yaml
          - api/app/k8s/dev/db.k8s-config.yaml
          - api/app/k8s/dev/es.k8s-config.yaml
          - api/app/k8s/dev/postgres.k8s-deployment.yaml
          - api/app/k8s/dev/postgres.k8s-service.yaml
          - api/app/k8s/dev/init-db.k8s-job.yaml
          - api/app/k8s/dev/es.k8s-deployment.yaml
          - api/app/k8s/dev/es.k8s-service.yaml
          - api/app/k8s/dev/api.k8s-deployment.yaml
          - api/app/k8s/dev/api.k8s-service.yaml
          - web/k8s/dev/web.k8s-config.yaml
          - web/k8s/dev/web.k8s-deployment.yaml
          - web/k8s/dev/web.k8s-service.yaml
    build:
      local:
        useBuildkit: true
      artifacts:
        - image: init-db.dev
          context: .
          docker:
            dockerfile: api/Dockerfile
            target: init-db.dev
            buildArgs:
              # This namespace is developer specific
              DL_ORG_DEV_NAMESPACE: '{{.DL_ORG_DEV_NAMESPACE}}'
              DL_ORG_AWS_ACCOUNT_ID: '{{.DL_ORG_AWS_ACCOUNT_ID}}'
        # API service
        - image: api.dev
          context: .
          sync:
            manual:
              - src: 'api/test/**/*'
                dest: .
                strip: 'api'
              - src: 'api/app/src/**/*.ts'
                dest: .
                strip: 'api'
              - src: 'api/app/src/**/*.json'
                dest: .
                strip: 'api'
              - src: 'api/apidoc/**/*'
                dest: .
                strip: 'api'
          docker:
            dockerfile: api/Dockerfile
            target: api.dev
            buildArgs:
              # These vars are different per each developer and cannot be part of ConfigMap in git
              DL_ORG_DEV_NAMESPACE: '{{.DL_ORG_DEV_NAMESPACE}}'
              DL_ORG_AWS_ACCOUNT_ID: '{{.DL_ORG_AWS_ACCOUNT_ID}}'
        # Web client (Angular)
        - image: web.dev
          context: .
          sync:
            manual:
              - src: 'web/src/**/*'
                dest: .
                strip: 'web'
              - src: 'web/e2e/**/*'
                dest: .
                strip: 'web'
          docker:
            dockerfile: web/Dockerfile
            target: web.dev
    portForward:
      - resourceType: service
        resourceName: postgres
        port: 5432
      - resourceType: service
        resourceName: elasticsearch
        port: 9200
@balopat balopat added kind/bug Something isn't working area/sync area/logging priority/p1 High impact feature/bug. labels Sep 4, 2019
@balopat
Copy link
Contributor

balopat commented Sep 4, 2019

Thank you @demisx this is definitely some confusing logging. We'll have to dig into it.

@dgageot dgageot self-assigned this Sep 4, 2019
@dgageot
Copy link
Contributor

dgageot commented Sep 4, 2019

I'll remove those logs since they are misleading. We wouldn't attempt to sync with those pods anyways since they are not using any image managed by Skaffold

dgageot added a commit to dgageot/skaffold that referenced this issue Sep 4, 2019
Fix GoogleContainerTools#2797

Signed-off-by: David Gageot <david@gageot.net>
dgageot added a commit that referenced this issue Sep 4, 2019
Fix #2797

Signed-off-by: David Gageot <david@gageot.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging area/sync kind/bug Something isn't working priority/p1 High impact feature/bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants