Skip to content

Commit

Permalink
adds example using simple-app and downwardAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-kimmel-vmw committed Sep 13, 2022
1 parent 3f1c263 commit 6ba55a8
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions examples/simple-app-downward-api/app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
apiVersion: kappctrl.k14s.io/v1alpha1
kind: App
metadata:
name: simple-app
namespace: default
spec:
serviceAccountName: default-ns-sa
fetch:
- git:
url: https://github.com/k14s/k8s-simple-app-example
ref: origin/develop
subPath: config-step-2-template
template:
- ytt:
valuesFrom:
- downwardAPI:
items:
- name: ns
fieldPath: metadata.namespace
- name: k8sV
kubernetesVersion: {}
- name: kcV
kappControllerVersion: {}
inline:
paths:
filename.yaml: |
#@ load("@ytt:overlay", "overlay")
#@ load("@ytt:data", "data")
#@overlay/match by=overlay.subset({"kind": "Deployment"})
---
spec:
template:
spec:
containers:
#@overlay/match by="name"
- name: simple-app
env:
#@overlay/match by="name"
- name: HELLO_MSG
value: #@ "from {} namespace, deployed by kapp-controller v{}, hosted on kubernetes v{}".format(data.values.ns, data.values.kcV, data.values.k8sV)
#! sample output: <h1>Hello from default namespace, deployed by kapp-controller v0.40.0+develop, hosted on kubernetes v1.23.3!</h1>
deploy:
- kapp: {}

0 comments on commit 6ba55a8

Please sign in to comment.