tweakdemo
This commit is contained in:
parent
61d538f8b3
commit
c2ff14d28e
|
|
@ -8,6 +8,11 @@ apply it to your cluster.
|
||||||
kubectl apply -f $TUT_APP
|
kubectl apply -f $TUT_APP
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<!-- @showResources @demo -->
|
||||||
|
```
|
||||||
|
kubectl get deployments
|
||||||
|
```
|
||||||
|
|
||||||
Define some functions to query the server directly:
|
Define some functions to query the server directly:
|
||||||
|
|
||||||
<!-- @funcGetAddress @env @test -->
|
<!-- @funcGetAddress @env @test -->
|
||||||
|
|
|
||||||
|
|
@ -8,21 +8,16 @@ of `Kube-manifest.yaml`.
|
||||||
## Names
|
## Names
|
||||||
|
|
||||||
The simplest form of customization is to change
|
The simplest form of customization is to change
|
||||||
resource names. In DAM, this is done by adding a
|
resource names.
|
||||||
prefix.
|
|
||||||
|
|
||||||
Be sure the manifest is in original form:
|
In DAM, this is done by adding a
|
||||||
<!-- @resetManifest @test -->
|
prefix.
|
||||||
```
|
|
||||||
cp $TUT_ORG_MANIFEST $TUT_APP_MANIFEST
|
|
||||||
```
|
|
||||||
|
|
||||||
Add a _namePrefix_ specification to the manifest:
|
Add a _namePrefix_ specification to the manifest:
|
||||||
<!-- @addNamePrefix @test -->
|
<!-- @addNamePrefix @test -->
|
||||||
```
|
```
|
||||||
cd $TUT_APP
|
cd $TUT_APP
|
||||||
kinflate setnameprefix acme-
|
kinflate setnameprefix acme-
|
||||||
# echo "namePrefix: acme-" >> $TUT_APP_MANIFEST
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Run it:
|
Run it:
|
||||||
|
|
@ -69,5 +64,5 @@ its resources into her version control repository.
|
||||||
|
|
||||||
It becomes her own version of the _app_.
|
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.
|
changes) by rebasing from the original.
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,11 @@ data:
|
||||||
EOF
|
EOF
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<!-- @ls @test -->
|
||||||
|
```
|
||||||
|
ls
|
||||||
|
```
|
||||||
|
|
||||||
Add it to the manifest:
|
Add it to the manifest:
|
||||||
|
|
||||||
<!-- @addResource @test -->
|
<!-- @addResource @test -->
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,9 @@ and optionally more (or fewer) resources.
|
||||||
|
|
||||||
Create a _staging_ and _production_ instance.
|
Create a _staging_ and _production_ instance.
|
||||||
|
|
||||||
* The greetings from the web server will differ.
|
* The greetings from the _hello world_ web servers will differ.
|
||||||
* In staging we'll enable a risky feature.
|
* _Staging_ enables a risky feature (for testing).
|
||||||
* Production will have a higher replica count because
|
* _Production_ has a higher replica count.
|
||||||
it takes public traffic.
|
|
||||||
|
|
||||||
<!-- @makePatchDirectories @test -->
|
<!-- @makePatchDirectories @test -->
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,15 @@
|
||||||
# Compare them
|
# 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 \
|
diff \
|
||||||
<(kinflate inflate -f $TUT_APP/staging) \
|
<(kinflate inflate -f $TUT_APP/staging) \
|
||||||
|
|
@ -36,13 +43,22 @@ kinflate inflate -f $TUT_APP/production |\
|
||||||
kubectl apply -f -
|
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 -
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ objectLabels:
|
||||||
org: acmeCorporation
|
org: acmeCorporation
|
||||||
|
|
||||||
objectAnnotations:
|
objectAnnotations:
|
||||||
note: Hello there I am production!
|
note: Hello, I am production!
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- ..
|
- ..
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ objectLabels:
|
||||||
org: acmeCorporation
|
org: acmeCorporation
|
||||||
|
|
||||||
objectAnnotations:
|
objectAnnotations:
|
||||||
note: Hello there I am staging!
|
note: Hello, I am staging!
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
- ..
|
- ..
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue