tweakdemo

This commit is contained in:
jregan 2018-02-07 08:50:51 -08:00
parent 61d538f8b3
commit c2ff14d28e
7 changed files with 42 additions and 22 deletions

View File

@ -8,6 +8,11 @@ apply it to your cluster.
kubectl apply -f $TUT_APP
```
<!-- @showResources @demo -->
```
kubectl get deployments
```
Define some functions to query the server directly:
<!-- @funcGetAddress @env @test -->

View File

@ -8,21 +8,16 @@ of `Kube-manifest.yaml`.
## Names
The simplest form of customization is to change
resource names. In DAM, this is done by adding a
prefix.
resource names.
Be sure the manifest is in original form:
<!-- @resetManifest @test -->
```
cp $TUT_ORG_MANIFEST $TUT_APP_MANIFEST
```
In DAM, this is done by adding a
prefix.
Add a _namePrefix_ specification to the manifest:
<!-- @addNamePrefix @test -->
```
cd $TUT_APP
kinflate setnameprefix acme-
# echo "namePrefix: acme-" >> $TUT_APP_MANIFEST
```
Run it:
@ -69,5 +64,5 @@ its resources into her version control repository.
It becomes her own version of the _app_.
She can capture upgrades (manifest and resource
She can capture upgrades (i.e. manifest and resource
changes) by rebasing from the original.

View File

@ -44,6 +44,11 @@ data:
EOF
```
<!-- @ls @test -->
```
ls
```
Add it to the manifest:
<!-- @addResource @test -->

View File

@ -15,10 +15,9 @@ and optionally more (or fewer) resources.
Create a _staging_ and _production_ instance.
* The greetings from the web server will differ.
* In staging we'll enable a risky feature.
* Production will have a higher replica count because
it takes public traffic.
* The greetings from the _hello world_ web servers will differ.
* _Staging_ enables a risky feature (for testing).
* _Production_ has a higher replica count.
<!-- @makePatchDirectories @test -->
```

View File

@ -1,8 +1,15 @@
# Compare them
Review the instance differences:
Before running kinflate on the two different instance
directories, review the directory
structure:
<!-- @reviewDiffs @test -->
<!-- @listFiles @test -->
```
find $TUT_APP
```
<!-- @compareKinflateOutput @test -->
```
diff \
<(kinflate inflate -f $TUT_APP/staging) \
@ -36,13 +43,22 @@ kinflate inflate -f $TUT_APP/production |\
kubectl apply -f -
```
Query them:
<!-- @getAll @demo -->
```
kubectl get all
```
<!-- @queryStaging @demo -->
Delete the resources:
<!-- @deleteStaging @demo -->
```
tut_query staging-acme-tut-service pear
kubectl delete configmap staging-acme-tut-map
kubectl delete service staging-acme-tut-service
kubectl delete deployment staging-acme-tut-deployment
```
<!-- @queryProduction @demo -->
<!-- @deleteProduction @demo -->
```
tut_query production-acme-tut-service apple
kinflate inflate -f $TUT_APP/production |\
kubectl delete -f -
```

View File

@ -20,7 +20,7 @@ objectLabels:
org: acmeCorporation
objectAnnotations:
note: Hello there I am production!
note: Hello, I am production!
resources:
- ..

View File

@ -20,7 +20,7 @@ objectLabels:
org: acmeCorporation
objectAnnotations:
note: Hello there I am staging!
note: Hello, I am staging!
resources:
- ..