Skip to content

Commit

Permalink
add examples/istio-v1.0.2/patches.yml to show how ytt can be used wit…
Browse files Browse the repository at this point in the history
…h kapp
  • Loading branch information
cppforlife committed Mar 19, 2019
1 parent d473230 commit 0cc272e
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/istio-v1.0.2/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Istio

Downloaded from: https://github.com/knative/serving/releases/tag/v0.2.1

- `config.yml` can be used to get rid cluster changes
- `patches.yml` can be used with `ytt` to get rid of helm specific and/or template inaccuracies
2 changes: 1 addition & 1 deletion examples/istio-v1.0.2/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: kapp.k14s.io/v1alpha1
kind: Config

rebaseRules:
# It seems that caBundle is automatically populated
#! It seems that caBundle is automatically populated
- path: [webhooks, {allIndexes: true}, clientConfig, caBundle]
merge: copy
sources: [new, existing]
Expand Down
47 changes: 47 additions & 0 deletions examples/istio-v1.0.2/patches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#@ load("@ytt:overlay", "overlay")

#! annotations should be a map
#@overlay/match by=overlay.subset({"kind": "Service", "metadata":{"name": "istio-egressgateway"}})
---
metadata:
#@overlay/remove
annotations:

#! annotations should be a map
#@overlay/match by=overlay.subset({"kind": "Service", "metadata":{"name": "istio-ingressgateway"}})
---
metadata:
#@overlay/remove
annotations:

#@overlay/match by=overlay.subset({"kind": "MutatingWebhookConfiguration"})
---
metadata:
#! MWC is cluster-wide config
#@overlay/remove
namespace:
webhooks:
#@overlay/match by="name"
- name: sidecar-injector.istio.io
clientConfig:
#! caBundle is populated by the cluster
#@overlay/remove
caBundle:

#@overlay/match by=overlay.subset({"kind": "Deployment", "metadata":{"name": "istio-pilot"}})
---
spec:
template:
spec:
containers:
#@overlay/match by="name"
- name: discovery
resources:
requests:
#! Kubernetes changes 2048Mi to 2Gi
memory: 2Gi

#! Delete all post-delete hooks as kapp does not run them
#@overlay/match by=overlay.subset({"metadata":{"annotations": {"helm.sh/hook": "post-delete"}}}),expects="1+"
#@overlay/remove
---

0 comments on commit 0cc272e

Please sign in to comment.