mirror of
https://github.com/argoproj/argocd-example-apps.git
synced 2024-11-24 11:15:15 +01:00
Add jsonnet example
This commit is contained in:
parent
a3ea618bb9
commit
9c549b198c
@ -8,6 +8,7 @@ to explore ArgoCD and GitOps!
|
||||
|-------------|-------------|
|
||||
| [guestbook](guestbook/) | The ksonnet hello word application |
|
||||
| [helm-guestbook](helm-guestbook/) | The guestbook application as a Helm chart |
|
||||
| [jsonnet-guestbook](jsonnet-guestbook/) | The guestbook application as a raw jsonnet |
|
||||
| [pre-post-sync](pre-post-sync/) | Demonstrates ArgoCD PreSync and PostSync hooks |
|
||||
| [blue-green-deploy](blue-green-deploy/) | Demonstrates an ArgoCD Sync hook which performs a blue/green deployment |
|
||||
| [sock-shop](sock-shop/) | A microservices demo application (https://microservices-demo.github.io) |
|
||||
|
58
jsonnet-guestbook/guestbook-ui.jsonnet
Normal file
58
jsonnet-guestbook/guestbook-ui.jsonnet
Normal file
@ -0,0 +1,58 @@
|
||||
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,
|
||||
"selector": {
|
||||
"matchLabels": {
|
||||
"app": params.name
|
||||
},
|
||||
},
|
||||
"template": {
|
||||
"metadata": {
|
||||
"labels": {
|
||||
"app": params.name
|
||||
}
|
||||
},
|
||||
"spec": {
|
||||
"containers": [
|
||||
{
|
||||
"image": params.image,
|
||||
"name": params.name,
|
||||
"ports": [
|
||||
{
|
||||
"containerPort": params.containerPort
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
8
jsonnet-guestbook/params.libsonnet
Normal file
8
jsonnet-guestbook/params.libsonnet
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
containerPort: 80,
|
||||
image: "gcr.io/heptio-images/ks-guestbook-demo:0.2",
|
||||
name: "guestbook-ui",
|
||||
replicas: 1,
|
||||
servicePort: 80,
|
||||
type: "LoadBalancer",
|
||||
}
|
Loading…
Reference in New Issue
Block a user