carvel-dev / kapp-controller

Continuous delivery and package management for Kubernetes.
https://carvel.dev/kapp-controller
Apache License 2.0
260 stars 99 forks source link

kapp deploy command failed due to "lstat /etc/kappctrl-mem-tmp/kapp-controller-fetch-template-deploy262513077/config: no such file or directory" #1583

Open troll-warlord opened 1 week ago

troll-warlord commented 1 week ago

I have below package file (sensitive data omited)

apiVersion: data.packaging.carvel.dev/v1alpha1
kind: Package
metadata:
  name: dummy-name:2.0.0
spec:
  refName: dummy-name
  version: 2.0.0
  releaseNotes: |
    Initial release of the simple app package
  valuesSchema:
    openAPIv3:
      nullable: true
      default: null
  template:
    spec:
      fetch:
      - imgpkgBundle:
          image: registry.com/app1:1.0.0
      - imgpkgBundle:
          image: registry.com/app2:1.0.0
      template:
      - ytt:
          paths:
          - config/
      - kbld:
          paths:
          - .imgpkg/images.yml
          - '-'
      deploy:
      - kapp: {}

When i run this command, kapp deploy -a demo -f pkginstall.yml -y i get below error

Op:      1 create, 0 delete, 0 update, 0 noop, 0 exists
Wait to: 1 reconcile, 0 delete, 0 noop

11:00:03PM: ---- applying 1 changes [0/1 done] ----
11:00:03PM: create packageinstall/demo (packaging.carvel.dev/v1alpha1) namespace: default
11:00:03PM: ---- waiting on 1 changes [0/1 done] ----
11:00:03PM: ongoing: reconcile packageinstall/demo (packaging.carvel.dev/v1alpha1) namespace: default
11:00:03PM:  ^ Waiting for generation 1 to be observed
11:00:06PM: ongoing: reconcile packageinstall/demo (packaging.carvel.dev/v1alpha1) namespace: default
11:00:06PM:  ^ Reconciling
11:00:21PM: fail: reconcile packageinstall/demo (packaging.carvel.dev/v1alpha1) namespace: default
11:00:21PM:  ^ Reconcile failed:  (message: ytt: Error: Checking file '/etc/kappctrl-mem-tmp/kapp-controller-fetch-template-deploy262513077/config': lstat /etc/kappctrl-mem-tmp/kapp-controller-fetch-template-deploy262513077/config: no such file or directory
)

kapp: Error: waiting on reconcile packageinstall/demo (packaging.carvel.dev/v1alpha1) namespace: default:
  Finished unsuccessfully (Reconcile failed:  (message: ytt: Error: Checking file '/etc/kappctrl-mem-tmp/kapp-controller-fetch-template-deploy262513077/config': lstat /etc/kappctrl-mem-tmp/kapp-controller-fetch-template-deploy262513077/config: no such file or directory
))

I tried removing the ytt section from Package resource, but still facing the same error. I'm not using ytt anywhere for templating

praveenrewar commented 6 days ago
      fetch:
      - imgpkgBundle:
          image: registry.com/app1:1.0.0
      - imgpkgBundle:
          image: registry.com/app2:1.0.0

@troll-warlord You seem to having multiple fetch steps, could you share your use case around this?

When you have multiple fetch steps, the contents would be in different directories (by default they are indexed 0, 1, 2...) but they can also be named. For example, you can do something like this:

      fetch:
      - imgpkgBundle:
          image: registry.com/app1:1.0.0
         path: app-1
      - imgpkgBundle:
          image: registry.com/app2:1.0.0
         path: app-2
      template:
      - ytt:
          paths:
          - app-1/config/
      - kbld:
          paths:
          - '-'
          - app-1/.imgpkg/images.yml
troll-warlord commented 4 days ago

@praveenrewar i was actually trying to bundle multiple applications in same package.

praveenrewar commented 2 days ago

@troll-warlord Any specific reason you want to bundle multiple applications in the same package? Do they work together? Like one of them depends on the other? Currently, folks use the concept of "meta package" to install multiple package at once. Basically, the meta package just consists of package installs for the different packages that you want to install. We are also going to work on dependencies in future, where one package can specify another package as a dependency and kapp-controller would ensure that all the dependencies are installed before a package is installed.