Skip to content

Commit

Permalink
Merge pull request #154 from vmware-tanzu/tekton-setup
Browse files Browse the repository at this point in the history
hack: include tekton in the setup
  • Loading branch information
Ciro S. Costa authored Sep 24, 2021
2 parents 953eb28 + bc42870 commit 5b17502
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
32 changes: 21 additions & 11 deletions hack/overlays/remove-resource-requests-from-deployments.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,29 @@

#@ load("@ytt:overlay", "overlay")

#@overlay/match by=overlay.subset({"kind":"Deployment"}), expects="1+"
#! Remove resource requirements to support smaller environments

#@ is_dep = overlay.subset({"kind": "Deployment"})
#@ is_ds = overlay.subset({"kind": "DaemonSet"})
#@ is_sts = overlay.subset({"kind": "StatefulSet"})

#@overlay/match by=overlay.or_op(is_dep, is_ds, is_sts),expects="1+"
---
spec:
#@overlay/match
template:
spec:
#@overlay/match
#@overlay/match when=1
initContainers:
#@overlay/match by=overlay.all,when="1+"
-
#@overlay/match missing_ok=True
#@overlay/remove
resources: {}

#@overlay/match when=1
containers:
#@overlay/match by=overlay.all,expects="0+"
- resources:
#@overlay/match missing_ok=True
#@overlay/replace
requests: {}
#@overlay/match missing_ok=True
#@overlay/replace
limits: {}
#@overlay/match by=overlay.all,when="1+"
-
#@overlay/match missing_ok=True
#@overlay/remove
resources: {}
9 changes: 9 additions & 0 deletions hack/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ readonly KNATIVE_SERVING_VERSION=0.25.0
readonly KPACK_VERSION=0.3.1
readonly SECRETGEN_CONTROLLER_VERSION=0.5.0
readonly SOURCE_CONTROLLER_VERSION=0.15.4
readonly TEKTON_VERSION=0.28.0

main() {
test $# -eq 0 && show_usage_help
Expand All @@ -56,6 +57,7 @@ main() {
install_source_controller
install_kpack
install_knative_serving
install_tekton
;;

example)
Expand Down Expand Up @@ -233,6 +235,13 @@ install_knative_serving() {
kapp deploy --yes -a knative-serving -f-
}

install_tekton() {
ytt --ignore-unknown-comments \
-f https://storage.googleapis.com/tekton-releases/pipeline/previous/v$TEKTON_VERSION/release.yaml \
-f $DIR/overlays/remove-resource-requests-from-deployments.yaml |
kapp deploy --yes -a tekton -f-
}

setup_example() {
ytt --ignore-unknown-comments \
-f $DIR/../examples/source-to-knative-service \
Expand Down

0 comments on commit 5b17502

Please sign in to comment.