From 422a5183aadc5a583ee038e636149bf4e42c24c8 Mon Sep 17 00:00:00 2001 From: Jeffrey Regan Date: Tue, 1 May 2018 11:02:17 -0700 Subject: [PATCH] fix glitch in hello world --- demos/helloWorld.md | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/demos/helloWorld.md b/demos/helloWorld.md index b97ce797b..2a7424e84 100644 --- a/demos/helloWorld.md +++ b/demos/helloWorld.md @@ -32,26 +32,27 @@ Alternatively, use > DEMO_HOME=~/hello > ``` -## Clone an example +## Establish the base Let's run the [hello] service. -We'll first need a [base] configuration for it - -the resource files we'll build on with overlays. +To use [overlays] to create [instances], we must +first establish a common [base]. -To keep this document shorter, we'll copy them in -(rather than declare them as HERE documents): +To keep this document shorter, the base resources are +off in a supplemental data directory rather than +declared here as HERE documents. Download them: ``` BASE=$DEMO_HOME/base mkdir -p $BASE -exRepo=https://raw.githubusercontent.com/kubernetes/kubectl -exDir=master/cmd/kustomize/demos/data/helloWorld +resources="https://raw.githubusercontent.com/kubernetes/kubectl\ +/master/cmd/kustomize/demos/data/helloWorld\ +/{configMap,deployment,kustomization,service}.yaml" -curl -s "$exRepo/$exDir/{configMap,deployment,kustomization,service}.yaml" \ - -o "$BASE/#1.yaml" +curl -s $resources -o "$BASE/#1.yaml" ``` Look at the directory: @@ -85,7 +86,7 @@ cluster: to instantiate the _hello_ service. `kubectl` would only recognize the resource files. -## The Base Kustomization +### The Base Kustomization The `base` directory has a [kustomization] file: @@ -94,15 +95,15 @@ The `base` directory has a [kustomization] file: more $BASE/kustomization.yaml ``` -Run `kustomize` on the base to emit customized resources -to `stdout`: +Optionally, run `kustomize` on the base to emit +customized resources to `stdout`: ``` kustomize build $BASE ``` -## Customize the base +### Customize the base A first customization step could be to change the _app label_ applied to all resources: @@ -417,7 +418,8 @@ uses the map: ``` -test 3 == $(kustomize build $OVERLAYS/staging | grep khk45ktkd9 | wc -l) +test 3 == \ + $(kustomize build $OVERLAYS/staging | grep khk45ktkd9 | wc -l) ``` Applying these resources to the cluster will result in