Example deployment

Signed-off-by: Andrew Keesler <akeesler@vmware.com>
This commit is contained in:
Ryan Richard 2020-07-07 13:17:34 -07:00 committed by Andrew Keesler
parent 7eaca5a56d
commit 4e17853ecf
3 changed files with 44 additions and 0 deletions

7
deploy/README.md Normal file
View File

@ -0,0 +1,7 @@
# Deploying
This example deployment uses `ytt` and `kapp` from [https://k14s.io](https://k14s.io/).
1. Fill in the values in [values.yml](values.yaml)
2. In a terminal, cd to this `deploy` directory
3. Run: `ytt --file . | kapp deploy --yes --app placeholder-name --diff-changes --file -`

31
deploy/deployment.yaml Normal file
View File

@ -0,0 +1,31 @@
#@ load("@ytt:data", "data")
---
apiVersion: v1
kind: Namespace
metadata:
name: #@ data.values.namespace
labels:
name: #@ data.values.namespace
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: #@ data.values.app_name + "-deployment"
namespace: #@ data.values.namespace
labels:
app: #@ data.values.app_name
spec:
replicas: 1
selector:
matchLabels:
app: #@ data.values.app_name
template:
metadata:
labels:
app: #@ data.values.app_name
spec:
containers:
- name: placeholder-name
image: #@ data.values.image_repo + "@" + data.values.image_digest

6
deploy/values.yaml Normal file
View File

@ -0,0 +1,6 @@
#@data/values
---
app_name: placeholder-name
namespace:
image_repo: #! e.g. gcr.io/your-project-name/repo-name
image_digest: #! e.g. sha256:f3c4fdfd3ef865d4b97a1fd295d94acc3f0c654c46b6f27ffad5cf80216903c8