diff --git a/deploy/README.md b/deploy/README.md new file mode 100644 index 00000000..69754ce0 --- /dev/null +++ b/deploy/README.md @@ -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 -` diff --git a/deploy/deployment.yaml b/deploy/deployment.yaml new file mode 100644 index 00000000..a609910c --- /dev/null +++ b/deploy/deployment.yaml @@ -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 diff --git a/deploy/values.yaml b/deploy/values.yaml new file mode 100644 index 00000000..465a0e7d --- /dev/null +++ b/deploy/values.yaml @@ -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