Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds example using simple-app and downwardAPI #870

Merged
merged 1 commit into from
Sep 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: {}