2018-09-07 00:17:36 +02:00
|
|
|
local params = import 'params.libsonnet';
|
|
|
|
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"apiVersion": "v1",
|
|
|
|
"kind": "Service",
|
|
|
|
"metadata": {
|
|
|
|
"name": params.name
|
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"ports": [
|
|
|
|
{
|
|
|
|
"port": params.servicePort,
|
|
|
|
"targetPort": params.containerPort
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"selector": {
|
|
|
|
"app": params.name
|
|
|
|
},
|
|
|
|
"type": params.type
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"apiVersion": "apps/v1beta2",
|
|
|
|
"kind": "Deployment",
|
|
|
|
"metadata": {
|
|
|
|
"name": params.name
|
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"replicas": params.replicas,
|
2018-12-11 03:05:32 +01:00
|
|
|
"revisionHistoryLimit": 3,
|
2018-09-07 00:17:36 +02:00
|
|
|
"selector": {
|
|
|
|
"matchLabels": {
|
|
|
|
"app": params.name
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"template": {
|
|
|
|
"metadata": {
|
|
|
|
"labels": {
|
|
|
|
"app": params.name
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"containers": [
|
|
|
|
{
|
|
|
|
"image": params.image,
|
|
|
|
"name": params.name,
|
|
|
|
"ports": [
|
|
|
|
{
|
|
|
|
"containerPort": params.containerPort
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|