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/kubepack/_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 $ 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 $ pack dep
, if you checkout _vendor
’s foocorp-shard.jsonnet
file,
you’ll see as below
$ cat _vendor/github.com/kubepack/kube-a/foocorp-shard.jsonnet
apiVersion: v1
kind: Service
metadata:
name: foocorp
namespace: default
spec:
selector:
serviceName: foocorp
Now, $ pack dep
will generate final outcome in _outlook
folder.
$ tree _outlook/
_outlook/
└── github.com
└── kubepack
└── kube-a
├── foocorp-shard.jsonnet
├── nginx-deployment.yaml
└── nginx-dm.yaml
3 directories, 3 files