From 61d538f8b3ba46cf68b387863282690ca885b39b Mon Sep 17 00:00:00 2001 From: jregan Date: Tue, 6 Feb 2018 17:18:16 -0800 Subject: [PATCH] demotweak --- cmd/kinflate/longerDemo/base.md | 2 +- cmd/kinflate/longerDemo/customization.md | 6 ++-- cmd/kinflate/longerDemo/instances/README.md | 6 ++-- cmd/kinflate/longerDemo/instances/compare.md | 36 +++++++++++++++----- cmd/kinflate/longerDemo/lifecycle.md | 2 +- cmd/kinflate/longerDemo/manifest.md | 4 +-- cmd/kinflate/longerDemo/resources.md | 9 ++--- 7 files changed, 42 insertions(+), 23 deletions(-) diff --git a/cmd/kinflate/longerDemo/base.md b/cmd/kinflate/longerDemo/base.md index 2b237ec40..ec6e14f14 100644 --- a/cmd/kinflate/longerDemo/base.md +++ b/cmd/kinflate/longerDemo/base.md @@ -39,5 +39,5 @@ All done. Clear the cluster for the next example. ``` kubectl delete deployment tut-deployment kubectl delete service tut-service -kubectl delete configmap tut-configmap +kubectl delete configmap tut-map ``` diff --git a/cmd/kinflate/longerDemo/customization.md b/cmd/kinflate/longerDemo/customization.md index f552eaecd..a399c9b0e 100644 --- a/cmd/kinflate/longerDemo/customization.md +++ b/cmd/kinflate/longerDemo/customization.md @@ -36,12 +36,12 @@ Compare to see result: ``` -diff -u $TUT_TMP/original_out $TUT_TMP/customized_out +diff $TUT_TMP/original_out $TUT_TMP/customized_out ``` ## Labels and annotations -Without further ado: +Just add some new fields directly to the manifest: ``` @@ -61,7 +61,7 @@ kinflate inflate -f $TUT_APP >$TUT_TMP/customized_out ``` -diff -u $TUT_TMP/original_out $TUT_TMP/customized_out +diff $TUT_TMP/original_out $TUT_TMP/customized_out | more ``` At this point, an end user could check the manifest and diff --git a/cmd/kinflate/longerDemo/instances/README.md b/cmd/kinflate/longerDemo/instances/README.md index 8b657f7ef..e7646340f 100644 --- a/cmd/kinflate/longerDemo/instances/README.md +++ b/cmd/kinflate/longerDemo/instances/README.md @@ -4,7 +4,7 @@ _Instances_ of a cluster app represent a common configuration problem. Their configuration is mostly the same. -We only want to manage _differences_. +We'd like to focus on managing _differences_. The DAM approach is to create _overlays_. @@ -15,10 +15,8 @@ and optionally more (or fewer) resources. Create a _staging_ and _production_ instance. -The differences: - + * The greetings from the web server will differ. * In staging we'll enable a risky feature. - * The greetings will differ. * Production will have a higher replica count because it takes public traffic. diff --git a/cmd/kinflate/longerDemo/instances/compare.md b/cmd/kinflate/longerDemo/instances/compare.md index cb5beb683..8835110fa 100644 --- a/cmd/kinflate/longerDemo/instances/compare.md +++ b/cmd/kinflate/longerDemo/instances/compare.md @@ -1,21 +1,16 @@ # Compare them -To deploy staging (or production) one would run a command like - -> ``` -> kinflate inflate -f $TUT_APP/staging | kubectl apply -f - -> ``` - Review the instance differences: ``` diff \ <(kinflate inflate -f $TUT_APP/staging) \ - <(kinflate inflate -f $TUT_APP/production) | more + <(kinflate inflate -f $TUT_APP/production) |\ + more ``` -Look out output individually: +Look at the output individually: ``` @@ -26,3 +21,28 @@ kinflate inflate -f $TUT_APP/staging ``` kinflate inflate -f $TUT_APP/production ``` + +Deploy them: + + +``` +kinflate inflate -f $TUT_APP/staging |\ + kubectl apply -f - +``` + + +``` +kinflate inflate -f $TUT_APP/production |\ + kubectl apply -f - +``` + +Query them: + + +``` +tut_query staging-acme-tut-service pear +``` + +``` +tut_query production-acme-tut-service apple +``` diff --git a/cmd/kinflate/longerDemo/lifecycle.md b/cmd/kinflate/longerDemo/lifecycle.md index c6df482ed..d0c5798f8 100644 --- a/cmd/kinflate/longerDemo/lifecycle.md +++ b/cmd/kinflate/longerDemo/lifecycle.md @@ -2,7 +2,7 @@ ``` -find $TUT_DAM +find $TUT_APP ``` TODO: Show edits required to roll staging out to diff --git a/cmd/kinflate/longerDemo/manifest.md b/cmd/kinflate/longerDemo/manifest.md index edbfd84d6..9901b0479 100644 --- a/cmd/kinflate/longerDemo/manifest.md +++ b/cmd/kinflate/longerDemo/manifest.md @@ -25,10 +25,10 @@ description: Tuthello offers greetings as a service. keywords: [hospitality, kubernetes] appVersion: 0.1.0 -home: https://github.com/TODO_MakeAHomeForThis +home: https://github.com/kinflate/tuthello sources: -- https://github.com/TODO_MakeAHomeForThis +- https://github.com/kinflate/tuthello icon: https://www.pexels.com/photo/some-icon.png diff --git a/cmd/kinflate/longerDemo/resources.md b/cmd/kinflate/longerDemo/resources.md index 5e37d4f45..a3b7b9ede 100644 --- a/cmd/kinflate/longerDemo/resources.md +++ b/cmd/kinflate/longerDemo/resources.md @@ -1,17 +1,18 @@ # Resources -Make three resource files. The resources -have name field with the values: +Make three resource files. The resources have name +fields with these values: * tut-deployment +* tut-map * tut-service -* tut-configmap _tut-_ just stands for _tutorial_. + ``` -TUT_APP=$TUT_DIR/hello +TUT_APP=$TUT_DIR/tuthello /bin/rm -rf $TUT_APP mkdir -p $TUT_APP ```