From 2ec8189c1caadd99af743694d3226ff702891cd3 Mon Sep 17 00:00:00 2001 From: Jeff Regan Date: Mon, 29 Apr 2019 09:59:00 -0700 Subject: [PATCH 1/2] Update remoteBuild.md --- examples/remoteBuild.md | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/examples/remoteBuild.md b/examples/remoteBuild.md index 1e3a42ac7..2f0ca7121 100644 --- a/examples/remoteBuild.md +++ b/examples/remoteBuild.md @@ -1,22 +1,15 @@ # remote targets -`kustomize build` can be run against a url. The effect is the same as cloing the repo, checking out the specified ref, -then running `kustomize build` against the desired directory in the local copy. +`kustomize build` can be run on a URL. -Take `github.com/kubernetes-sigs/kustomize//examples/multibases?ref=v1.0.6` as an example. -According to [multibases](multibases/README.md) demo, this kustomization contains three Pod objects with names as -`cluster-a-dev-myapp-pod`, `cluster-a-stag-myapp-pod`, `cluster-a-prod-myapp-pod`. -Running `kustomize build` against the url gives the same output. +The effect is the same as cloning the repo, checking out a particular +_ref_ (commit hash, branch name, release tag, etc.), +then running `kustomize build` against the desired +directory in the local copy. - -``` -target=github.com/kubernetes-sigs/kustomize//examples/multibases -test 3 == \ - $(kustomize build $target | grep cluster-a-.*-myapp-pod | wc -l); \ - echo $? -``` - -Overlays can be remote as well: +To try this immediately, run a build against the kustomization +in the [multibases](multibases/README.md) example. There's +one pod in the output: @@ -27,7 +20,18 @@ test 1 == \ echo $? ``` -A base can also be specified as a URL: +Or run against the overlay that combines the dev, staging and prod bases +in that example (you get three pods): + + +``` +target="https://github.com/kubernetes-sigs/kustomize//examples/multibases?ref=v1.0.6" +test 3 == \ + $(kustomize build $target | grep cluster-a-.*-myapp-pod | wc -l); \ + echo $? +``` + +A base can be a URL: ``` @@ -39,7 +43,8 @@ bases: namePrefix: remote- EOF ``` -Running `kustomize build $DEMO_HOME` and confirm the output contains three Pods and all have `remote-` prefix. + +Build this to confirm all three pods (from the base) have the `remote-` prefix. ``` test 3 == \ @@ -48,6 +53,7 @@ test 3 == \ ``` ## URL format + The url should follow [hashicorp/go-getter URL format](https://github.com/hashicorp/go-getter#url-format). Here are some example urls pointing to Github repos following this convention. From 865348695f20360e71d5c442bc5ae7afc84c1adf Mon Sep 17 00:00:00 2001 From: Jeff Regan Date: Mon, 29 Apr 2019 10:06:41 -0700 Subject: [PATCH 2/2] Update remoteBuild.md --- examples/remoteBuild.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/remoteBuild.md b/examples/remoteBuild.md index 2f0ca7121..315f6f571 100644 --- a/examples/remoteBuild.md +++ b/examples/remoteBuild.md @@ -14,14 +14,15 @@ one pod in the output: ``` -target=github.com/kubernetes-sigs/kustomize//examples/multibases/dev/?ref=v1.0.6 +target="github.com/kubernetes-sigs/kustomize//examples/multibases/dev/?ref=v1.0.6" test 1 == \ - $(kustomize build $target | grep cluster-a-dev-myapp-pod | wc -l); \ + $(kustomize build $target | grep dev-myapp-pod | wc -l); \ echo $? ``` -Or run against the overlay that combines the dev, staging and prod bases -in that example (you get three pods): +Run against the overlay in that example to get three pods +(the overlay combines the dev, staging and prod bases for +someone who wants to send them all at the same time): ``` @@ -44,7 +45,9 @@ namePrefix: remote- EOF ``` -Build this to confirm all three pods (from the base) have the `remote-` prefix. +Build this to confirm that all three pods from the base +have the `remote-` prefix. + ``` test 3 == \