2020-07-07 20:17:34 +00:00
#@ load("@ytt:data", "data")
---
apiVersion : v1
kind : Namespace
metadata :
name : #@ data.values.namespace
labels :
name : #@ data.values.namespace
2020-07-09 16:42:31 +00:00
---
apiVersion : v1
2020-07-17 21:42:02 +00:00
kind : ServiceAccount
metadata :
name : #@ data.values.app_name + "-service-account"
namespace : #@ data.values.namespace
---
apiVersion : v1
2020-07-09 16:42:31 +00:00
kind : ConfigMap
metadata :
name : #@ data.values.app_name + "-config"
namespace : #@ data.values.namespace
labels :
app : #@ data.values.app_name
data :
2020-07-09 16:58:28 +00:00
#@yaml/text-templated-strings
2020-07-23 15:05:21 +00:00
placeholder-name.yaml : |
2020-07-14 16:38:43 +00:00
webhook :
url : (@= data.values.webhook_url @)
caBundle : (@= data.values.webhook_ca_bundle @)
2020-07-07 20:17:34 +00:00
---
2020-07-23 15:05:21 +00:00
#! TODO set up healthy, ready, etc. probes correctly for our deployment
#! TODO set the priority-critical-urgent on our deployment to ask kube to never let it die
#! TODO set resource minimums (e.g. 512MB RAM) on the deployment to make sure we get scheduled onto a reasonable node
2020-07-07 20:17:34 +00:00
apiVersion : apps/v1
kind : Deployment
metadata :
name : #@ data.values.app_name + "-deployment"
namespace : #@ data.values.namespace
labels :
app : #@ data.values.app_name
spec :
2020-07-23 15:05:21 +00:00
replicas : 1 #! TODO more than one replica for high availability, and share the same serving certificate among them (maybe using client-go leader election)
2020-07-07 20:17:34 +00:00
selector :
matchLabels :
app : #@ data.values.app_name
template :
metadata :
labels :
app : #@ data.values.app_name
spec :
2020-07-17 21:42:02 +00:00
serviceAccountName : #@ data.values.app_name + "-service-account"
2020-07-07 20:17:34 +00:00
containers :
- name : placeholder-name
2020-07-09 17:16:46 +00:00
#@ if data.values.image_digest:
2020-07-07 20:17:34 +00:00
image : #@ data.values.image_repo + "@" + data.values.image_digest
2020-07-09 17:16:46 +00:00
#@ else:
image : #@ data.values.image_repo + ":" + data.values.image_tag
#@ end
2020-07-09 04:39:56 +00:00
imagePullPolicy : IfNotPresent
2020-07-09 16:42:31 +00:00
command :
2020-07-20 04:21:47 +00:00
- ./placeholder-name
2020-07-17 21:42:02 +00:00
args :
2020-07-23 15:05:21 +00:00
- --config=/etc/config/placeholder-name.yaml
2020-07-17 21:42:02 +00:00
- --downward-api-path=/etc/podinfo
2020-07-09 16:42:31 +00:00
volumeMounts :
2020-07-17 21:42:02 +00:00
- name : config-volume
mountPath : /etc/config
- name : podinfo
mountPath : /etc/podinfo
2020-07-09 16:42:31 +00:00
volumes :
2020-07-17 21:42:02 +00:00
- name : config-volume
configMap :
name : #@ data.values.app_name + "-config"
2020-07-16 19:24:30 +00:00
- name : podinfo
2020-07-17 21:42:02 +00:00
downwardAPI :
items :
- path : "labels"
fieldRef :
fieldPath : metadata.labels
- path : "namespace"
fieldRef :
fieldPath : metadata.namespace