Back to Top

New to Kubepack? Please start here.

Scenario-10

This docs trying to explain the behavior of Pack


This section explain how jsonnet appears Pack, more complex situation than scenario-9

alt text

Above diagram shows the dependency chain. Here,

  • test-10 depend on repository kube-a (branch test-10).
  • kube-a depends on repository kube-b (branch test-10). Also, contains a jsonnet file.
  • kube-b depends on repository kube-c (branch test-10). Also, contains a patch of yaml file from kube-a repository. This yaml is generated from jsonnet file.
  • kube-c depend on nothing.

See manifest.yaml file below:

    $ cat manifest.yaml
    
    package: github.com/kubepack/kubepack/_testdata/test-10
    owners:
    - name: Appscode
      email: team@appscode.com
    dependencies:
    - package: github.com/kubepack/kube-a
      branch: test-10

 Get Dependencies

$ pack dep command gets all the dependencies and place it under _vendor folder. In this scenario, following things happen:

  • kube-b repository contains patch of jsonnet file’s yaml, so kube-c’s jsonnet will be yaml. This yaml is combination of jsonnet’s yaml and this yaml’s patch which exists in kube-b repository.
  • kube-a contains a jsonnet file. In _vendor folder, this jsonnet file will be converted into yaml file.

Now, $ pack up command will generate the final output in _outlook folder.

    $ tree _outlook/
    
    
    _outlook/
    └── github.com
        └── kubepack
            ├── kube-a
            │   ├── foocorp-shard.jsonnet
            │   ├── nginx-deployment.yaml
            │   └── nginx-dm.yaml
            ├── kube-b
            │   ├── nginx-deployment.yaml
            │   ├── nginx-dm.yaml
            │   ├── _outlook
            │   │   └── github.com
            │   │       └── kubepack
            │   │           └── kube-c
            │   │               ├── foocorp-shard.jsonnet
            │   │               ├── nginx-deployment.yaml
            │   │               └── nginx-dm.yaml
            │   ├── patch
            │   │   └── github.com
            │   │       └── kubepack
            │   │           └── kube-c
            │   │               └── foocorp-shard.jsonnet
            │   └── _vendor
            │       └── github.com
            │           └── kubepack
            │               └── kube-c
            │                   ├── foocorp-shard.jsonnet
            │                   ├── nginx-deployment.yaml
            │                   └── nginx-dm.yaml
            └── kube-c
                ├── foocorp-shard.jsonnet
                ├── nginx-deployment.yaml
                └── nginx-dm.yaml
    
    17 directories, 15 files

 Next Steps

  • Want to publish apps using Kubepack? Please visit here.
  • Want to consume apps published using Kubepack? Please visit here.
  • To learn about manifest.yaml file, please visit here.
  • Learn more about pack cli from here.

Subscribe to our free technical newsletter!

Join thousands of subscribers and stay up-to-date on AppsCode.