fix glitch in hello world

This commit is contained in:
Jeffrey Regan
2018-05-01 11:02:17 -07:00
parent a6ce97668d
commit 422a5183aa

View File

@@ -32,26 +32,27 @@ Alternatively, use
> DEMO_HOME=~/hello > DEMO_HOME=~/hello
> ``` > ```
## Clone an example ## Establish the base
Let's run the [hello] service. Let's run the [hello] service.
We'll first need a [base] configuration for it - To use [overlays] to create [instances], we must
the resource files we'll build on with overlays. first establish a common [base].
To keep this document shorter, we'll copy them in To keep this document shorter, the base resources are
(rather than declare them as HERE documents): off in a supplemental data directory rather than
declared here as HERE documents. Download them:
<!-- @downloadBase @test --> <!-- @downloadBase @test -->
``` ```
BASE=$DEMO_HOME/base BASE=$DEMO_HOME/base
mkdir -p $BASE mkdir -p $BASE
exRepo=https://raw.githubusercontent.com/kubernetes/kubectl resources="https://raw.githubusercontent.com/kubernetes/kubectl\
exDir=master/cmd/kustomize/demos/data/helloWorld /master/cmd/kustomize/demos/data/helloWorld\
/{configMap,deployment,kustomization,service}.yaml"
curl -s "$exRepo/$exDir/{configMap,deployment,kustomization,service}.yaml" \ curl -s $resources -o "$BASE/#1.yaml"
-o "$BASE/#1.yaml"
``` ```
Look at the directory: Look at the directory:
@@ -85,7 +86,7 @@ cluster:
to instantiate the _hello_ service. `kubectl` to instantiate the _hello_ service. `kubectl`
would only recognize the resource files. would only recognize the resource files.
## The Base Kustomization ### The Base Kustomization
The `base` directory has a [kustomization] file: The `base` directory has a [kustomization] file:
@@ -94,15 +95,15 @@ The `base` directory has a [kustomization] file:
more $BASE/kustomization.yaml more $BASE/kustomization.yaml
``` ```
Run `kustomize` on the base to emit customized resources Optionally, run `kustomize` on the base to emit
to `stdout`: customized resources to `stdout`:
<!-- @buildBase @test --> <!-- @buildBase @test -->
``` ```
kustomize build $BASE kustomize build $BASE
``` ```
## Customize the base ### Customize the base
A first customization step could be to change the _app A first customization step could be to change the _app
label_ applied to all resources: label_ applied to all resources:
@@ -417,7 +418,8 @@ uses the map:
<!-- @countHashes @test --> <!-- @countHashes @test -->
``` ```
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 Applying these resources to the cluster will result in