New to Kubepack? Please start here.
Scenario-9
This docs trying to explain the behavior of Pack
This section explain, how jsonnet
appears in Pack.
If you look into manifest.yaml
file:
$ cat manifest.yaml
package: github.com/kubepack/pack/_testdata/test-9
owners:
- name: Appscode
email: [email protected]
dependencies:
- package: github.com/kubepack/kube-a
branch: test-9
You see, this test-case depend on branch test-9
of repository kube-a.
In branch test-9
of kube-a contains a jsonnet file.
When execute $ kubectl plugin pack dep
to get the dependencies, it’ll get all the dependencies and
convert jsonnet
file into yaml file.
If you see, jsonnet file of kube-a, will see as below
local shardTemplate = import "shard.jsonnet.TEMPLATE";
shardTemplate + {
name:: "foocorp",
namespace:: "default",
}
After $ kubectl plugin pack dep
, if you checkout manifests/vendor
’s foocorp-shard.jsonnet
file,
you’ll see as below
$ cat manifests/vendor/github.com/kubepack/kube-a/manifests/app/foocorp-shard.jsonnet
apiVersion: v1
kind: Service
metadata:
name: foocorp
namespace: default
spec:
selector:
serviceName: foocorp
Now, $ kubectl plugin pack up
will generate final outcome in manifests/output
folder.
$ tree manifests/output/
manifests/output/
└── github.com
└── kubepack
└── kube-a
└── manifests
└── app
├── foocorp-shard.jsonnet
├── nginx-deployment.yaml
└── nginx-dm.yaml
5 directories, 3 files