Format commands examples
This commit is contained in:
1
Makefile
1
Makefile
@@ -20,5 +20,6 @@ build:
|
|||||||
install:
|
install:
|
||||||
go install cmd/tk
|
go install cmd/tk
|
||||||
|
|
||||||
|
.PHONY: docs
|
||||||
docs:
|
docs:
|
||||||
mkdir -p ./docs/cmd && go run ./cmd/tk/ docgen
|
mkdir -p ./docs/cmd && go run ./cmd/tk/ docgen
|
||||||
|
|||||||
@@ -24,25 +24,25 @@ var createKsCmd = &cobra.Command{
|
|||||||
The kustomization source command generates a kustomization.kustomize.fluxcd.io resource for a given GitRepository source.
|
The kustomization source command generates a kustomization.kustomize.fluxcd.io resource for a given GitRepository source.
|
||||||
API spec: https://github.com/fluxcd/kustomize-controller/tree/master/docs/spec/v1alpha1`,
|
API spec: https://github.com/fluxcd/kustomize-controller/tree/master/docs/spec/v1alpha1`,
|
||||||
Example: ` # Create a kustomization from a source at a given path
|
Example: ` # Create a kustomization from a source at a given path
|
||||||
create kustomization backend \
|
create kustomization contour \
|
||||||
--source=webapp \
|
--source=contour \
|
||||||
--path="./overlays/backend/" \
|
--path="./examples/contour/" \
|
||||||
--prune="app=backend" \
|
--prune="instance=contour" \
|
||||||
|
--generate=true \
|
||||||
--interval=10m \
|
--interval=10m \
|
||||||
--validate=client \
|
--validate=client \
|
||||||
--health-check="StatefulSet/backend.test" \
|
--health-check="Deployment/contour.projectcontour" \
|
||||||
|
--health-check="DaemonSet/envoy.projectcontour" \
|
||||||
--health-check-timeout=3m
|
--health-check-timeout=3m
|
||||||
|
|
||||||
# Create a kustomization that depends on another
|
# Create a kustomization that depends on the previous one
|
||||||
create kustomization frontend \
|
create kustomization webapp \
|
||||||
--depends-on=backend \
|
--depends-on=contour \
|
||||||
--source=webapp \
|
--source=webapp \
|
||||||
--path="./overlays/frontend/" \
|
--path="./deploy/overlays/dev" \
|
||||||
--prune="app=frontend" \
|
--prune="env=dev,instance=webapp" \
|
||||||
--interval=5m \
|
--interval=5m \
|
||||||
--validate=client \
|
--validate=client
|
||||||
--health-check="Deployment/frontend.test" \
|
|
||||||
--health-check-timeout=2m
|
|
||||||
`,
|
`,
|
||||||
RunE: createKsCmdRun,
|
RunE: createKsCmdRun,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,11 +16,35 @@ var VERSION = "0.0.1"
|
|||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
Use: "tk",
|
Use: "tk",
|
||||||
Short: "Command line utility for assembling Kubernetes CD pipelines",
|
|
||||||
Long: `Command line utility for assembling Kubernetes CD pipelines.`,
|
|
||||||
Version: VERSION,
|
Version: VERSION,
|
||||||
SilenceUsage: true,
|
SilenceUsage: true,
|
||||||
SilenceErrors: true,
|
SilenceErrors: true,
|
||||||
|
Short: "Command line utility for assembling Kubernetes CD pipelines",
|
||||||
|
Long: `Command line utility for assembling Kubernetes CD pipelines.`,
|
||||||
|
Example: ` # Check prerequisites
|
||||||
|
tk check --pre
|
||||||
|
|
||||||
|
# Install the latest version of the toolkit
|
||||||
|
tk install --version=master
|
||||||
|
|
||||||
|
# Create a source from a public Git repository
|
||||||
|
tk create source webapp \
|
||||||
|
--git-url=https://github.com/stefanprodan/podinfo \
|
||||||
|
--git-branch=master \
|
||||||
|
--interval=5m
|
||||||
|
|
||||||
|
# Create a kustomization for deploying a series of microservices
|
||||||
|
tk create kustomization webapp \
|
||||||
|
--source=webapp \
|
||||||
|
--path="./deploy/webapp/" \
|
||||||
|
--prune="instance=webapp" \
|
||||||
|
--generate=true \
|
||||||
|
--interval=5m \
|
||||||
|
--validate=client \
|
||||||
|
--health-check="Deployment/backend.webapp" \
|
||||||
|
--health-check="Deployment/frontend.webapp" \
|
||||||
|
--health-check-timeout=2m
|
||||||
|
`,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
Reference in New Issue
Block a user