diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_init.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_init.md index 3aabfdac50..7452223bb9 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_init.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_init.md @@ -22,28 +22,28 @@ zarf init [flags] ``` - # Initializing without any optional components: - zarf init +# Initializing without any optional components: +$ zarf init - # Initializing w/ Zarfs internal git server: - zarf init --components=git-server +# Initializing w/ Zarfs internal git server: +$ zarf init --components=git-server - # Initializing w/ Zarfs internal git server and PLG stack: - zarf init --components=git-server,logging +# Initializing w/ Zarfs internal git server and PLG stack: +$ zarf init --components=git-server,logging - # Initializing w/ an internal registry but with a different nodeport: - zarf init --nodeport=30333 +# Initializing w/ an internal registry but with a different nodeport: +$ zarf init --nodeport=30333 - # Initializing w/ an external registry: - zarf init --registry-push-password={PASSWORD} --registry-push-username={USERNAME} --registry-url={URL} +# Initializing w/ an external registry: +$ zarf init --registry-push-password={PASSWORD} --registry-push-username={USERNAME} --registry-url={URL} - # Initializing w/ an external git server: - zarf init --git-push-password={PASSWORD} --git-push-username={USERNAME} --git-url={URL} +# Initializing w/ an external git server: +$ zarf init --git-push-password={PASSWORD} --git-push-username={USERNAME} --git-url={URL} - # Initializing w/ an external artifact server: - zarf init --artifact-push-password={PASSWORD} --artifact-push-username={USERNAME} --artifact-url={URL} +# Initializing w/ an external artifact server: +$ zarf init --artifact-push-password={PASSWORD} --artifact-push-username={USERNAME} --artifact-url={URL} - # NOTE: Not specifying a pull username/password will use the push user for pulling as well. +# NOTE: Not specifying a pull username/password will use the push user for pulling as well. ``` diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_package_mirror-resources.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_package_mirror-resources.md index 90147b839b..32b7ffc4ae 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_package_mirror-resources.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_package_mirror-resources.md @@ -12,6 +12,30 @@ image registries and git repositories within the target environment zarf package mirror-resources [ PACKAGE_SOURCE ] [flags] ``` +## Examples + +``` + +# Mirror resources to internal Zarf resources +$ zarf package mirror-resources \ + --registry-url 127.0.0.1:31999 \ + --registry-push-username zarf-push \ + --registry-push-password \ + --git-url http://zarf-gitea-http.zarf.svc.cluster.local:3000 \ + --git-push-username zarf-git-user \ + --git-push-password + +# Mirror resources to external resources +$ zarf package mirror-resources \ + --registry-url registry.enterprise.corp \ + --registry-push-username \ + --registry-push-password \ + --git-url https://git.enterprise.corp \ + --git-push-username \ + --git-push-password + +``` + ## Options ``` diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_package_publish.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_package_publish.md index 4f413e7485..cd82887e16 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_package_publish.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_package_publish.md @@ -11,11 +11,11 @@ zarf package publish { PACKAGE_SOURCE | SKELETON DIRECTORY } REPOSITORY [flags] ``` - # Publish a package to a remote registry - zarf package publish my-package.tar oci://my-registry.com/my-namespace +# Publish a package to a remote registry +$ zarf package publish my-package.tar oci://my-registry.com/my-namespace - # Publish a skeleton package to a remote registry - zarf package publish ./path/to/dir oci://my-registry.com/my-namespace +# Publish a skeleton package to a remote registry +$ zarf package publish ./path/to/dir oci://my-registry.com/my-namespace ``` diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_package_pull.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_package_pull.md index 1c7a561d0d..7693c9d7b3 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_package_pull.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_package_pull.md @@ -10,7 +10,7 @@ zarf package pull PACKAGE_SOURCE [flags] ## Examples ``` - zarf package pull oci://my-registry.com/my-namespace/my-package:0.0.1-arm64 +$ zarf package pull oci://my-registry.com/my-namespace/my-package:0.0.1-arm64 ``` ## Options diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_get-creds.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_get-creds.md index 4cc33b76b3..457acc4756 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_get-creds.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_get-creds.md @@ -15,16 +15,16 @@ zarf tools get-creds [flags] ``` - # Print all Zarf credentials: - zarf tools get-creds - - # Get specific Zarf credentials: - zarf tools get-creds registry - zarf tools get-creds registry-readonly - zarf tools get-creds git - zarf tools get-creds git-readonly - zarf tools get-creds artifact - zarf tools get-creds logging +# Print all Zarf credentials: +$ zarf tools get-creds + +# Get specific Zarf credentials: +$ zarf tools get-creds registry +$ zarf tools get-creds registry-readonly +$ zarf tools get-creds git +$ zarf tools get-creds git-readonly +$ zarf tools get-creds artifact +$ zarf tools get-creds logging ``` diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_monitor.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_monitor.md index de97f8bae6..b61e613d40 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_monitor.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_monitor.md @@ -10,7 +10,31 @@ zarf tools monitor [flags] ## Options ``` - -h, --help help for monitor + -A, --all-namespaces Launch K9s in all namespaces + --as string Username to impersonate for the operation + --as-group stringArray Group to impersonate for the operation + --certificate-authority string Path to a cert file for the certificate authority + --client-certificate string Path to a client certificate file for TLS + --client-key string Path to a client key file for TLS + --cluster string The name of the kubeconfig cluster to use + -c, --command string Overrides the default resource to load when the application launches + --context string The name of the kubeconfig context to use + --crumbsless Turn K9s crumbs off + --headless Turn K9s header off + -h, --help help for monitor + --insecure-skip-tls-verify If true, the server's caCertFile will not be checked for validity + --kubeconfig string Path to the kubeconfig file to use for CLI requests + --logFile string Specify the log file + -l, --logLevel string Specify a log level (info, warn, debug, trace, error) + --logoless Turn K9s logo off + -n, --namespace string If present, the namespace scope for this CLI request + --readonly Sets readOnly mode by overriding readOnly configuration setting + -r, --refresh int Specify the default refresh rate as an integer (sec) (default 2) + --request-timeout string The length of time to wait before giving up on a single server request + --screen-dump-dir string Sets a path to a dir for a screen dumps + --token string Bearer token for authentication to the API server + --user string The name of the kubeconfig user to use + --write Sets write mode by overriding the readOnly configuration setting ``` ## SEE ALSO diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_catalog.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_catalog.md index 6a65a2d342..5a785a7255 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_catalog.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_catalog.md @@ -11,11 +11,11 @@ zarf tools registry catalog REGISTRY [flags] ``` - # list the repos internal to Zarf - $ zarf tools registry catalog +# List the repos internal to Zarf +$ zarf tools registry catalog - # list the repos for reg.example.com - $ zarf tools registry catalog reg.example.com +# List the repos for reg.example.com +$ zarf tools registry catalog reg.example.com ``` diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_delete.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_delete.md index 8dd6179a01..6616899151 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_delete.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_delete.md @@ -11,10 +11,10 @@ zarf tools registry delete IMAGE [flags] ``` -# delete an image digest from an internal repo in Zarf +# Delete an image digest from an internal repo in Zarf $ zarf tools registry delete 127.0.0.1:31999/stefanprodan/podinfo@sha256:57a654ace69ec02ba8973093b6a786faa15640575fbf0dbb603db55aca2ccec8 -# delete an image digest from a repo hosted at reg.example.com +# Delete an image digest from a repo hosted at reg.example.com $ zarf tools registry delete reg.example.com/stefanprodan/podinfo@sha256:57a654ace69ec02ba8973093b6a786faa15640575fbf0dbb603db55aca2ccec8 ``` diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_digest.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_digest.md index f2e82135ef..3870d5ba01 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_digest.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_digest.md @@ -11,10 +11,10 @@ zarf tools registry digest IMAGE [flags] ``` -# return an image digest for an internal repo in Zarf +# Return an image digest for an internal repo in Zarf $ zarf tools registry digest 127.0.0.1:31999/stefanprodan/podinfo:6.4.0 -# return an image digest from a repo hosted at reg.example.com +# Return an image digest from a repo hosted at reg.example.com $ zarf tools registry digest reg.example.com/stefanprodan/podinfo:6.4.0 ``` diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_ls.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_ls.md index df988ac44b..8bd1407532 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_ls.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_ls.md @@ -11,11 +11,11 @@ zarf tools registry ls REPO [flags] ``` - # list the tags for a repo internal to Zarf - $ zarf tools registry ls 127.0.0.1:31999/stefanprodan/podinfo +# List the tags for a repo internal to Zarf +$ zarf tools registry ls 127.0.0.1:31999/stefanprodan/podinfo - # list the tags for a repo hosted at reg.example.com - $ zarf tools registry ls reg.example.com/stefanprodan/podinfo +# List the tags for a repo hosted at reg.example.com +$ zarf tools registry ls reg.example.com/stefanprodan/podinfo ``` diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_pull.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_pull.md index 87cf6362eb..10edb65252 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_pull.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_pull.md @@ -11,11 +11,11 @@ zarf tools registry pull IMAGE TARBALL [flags] ``` - # pull an image from an internal repo in Zarf to a local tarball - $ zarf tools registry pull 127.0.0.1:31999/stefanprodan/podinfo:6.4.0 image.tar +# Pull an image from an internal repo in Zarf to a local tarball +$ zarf tools registry pull 127.0.0.1:31999/stefanprodan/podinfo:6.4.0 image.tar - # pull an image from a repo hosted at reg.example.com to a local tarball - $ zarf tools registry pull reg.example.com/stefanprodan/podinfo:6.4.0 image.tar +# Pull an image from a repo hosted at reg.example.com to a local tarball +$ zarf tools registry pull reg.example.com/stefanprodan/podinfo:6.4.0 image.tar ``` diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_push.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_push.md index 052f28abde..66fe292655 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_push.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_registry_push.md @@ -15,11 +15,11 @@ zarf tools registry push PATH IMAGE [flags] ``` - # push an image into an internal repo in Zarf - $ zarf tools registry push image.tar 127.0.0.1:31999/stefanprodan/podinfo:6.4.0 +# Push an image into an internal repo in Zarf +$ zarf tools registry push image.tar 127.0.0.1:31999/stefanprodan/podinfo:6.4.0 - # push an image into an repo hosted at reg.example.com - $ zarf tools registry push image.tar reg.example.com/stefanprodan/podinfo:6.4.0 +# Push an image into an repo hosted at reg.example.com +$ zarf tools registry push image.tar reg.example.com/stefanprodan/podinfo:6.4.0 ``` diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_update-creds.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_update-creds.md index 86689b7f78..8dd9cd1610 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_update-creds.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_update-creds.md @@ -15,30 +15,30 @@ zarf tools update-creds [flags] ``` - # Autogenerate all Zarf credentials at once: - zarf tools update-creds - - # Autogenerate specific Zarf service credentials: - zarf tools update-creds registry - zarf tools update-creds git - zarf tools update-creds artifact - zarf tools update-creds agent - - # Update all Zarf credentials w/external services at once: - zarf tools update-creds \ - --registry-push-username={USERNAME} --registry-push-password={PASSWORD} \ - --git-push-username={USERNAME} --git-push-password={PASSWORD} \ - --artifact-push-username={USERNAME} --artifact-push-token={PASSWORD} - - # NOTE: Any credentials omitted from flags without a service key specified will be autogenerated - URLs will only change if specified. - # Config options can also be set with the 'init' section of a Zarf config file. - - # Update specific Zarf credentials w/external services: - zarf tools update-creds registry --registry-push-username={USERNAME} --registry-push-password={PASSWORD} - zarf tools update-creds git --git-push-username={USERNAME} --git-push-password={PASSWORD} - zarf tools update-creds artifact --artifact-push-username={USERNAME} --artifact-push-token={PASSWORD} - - # NOTE: Not specifying a pull username/password will keep the previous pull username/password. +# Autogenerate all Zarf credentials at once: +$ zarf tools update-creds + +# Autogenerate specific Zarf service credentials: +$ zarf tools update-creds registry +$ zarf tools update-creds git +$ zarf tools update-creds artifact +$ zarf tools update-creds agent + +# Update all Zarf credentials w/external services at once: +$ zarf tools update-creds \ + --registry-push-username={USERNAME} --registry-push-password={PASSWORD} \ + --git-push-username={USERNAME} --git-push-password={PASSWORD} \ + --artifact-push-username={USERNAME} --artifact-push-token={PASSWORD} + +# NOTE: Any credentials omitted from flags without a service key specified will be autogenerated - URLs will only change if specified. +# Config options can also be set with the 'init' section of a Zarf config file. + +# Update specific Zarf credentials w/external services: +$ zarf tools update-creds registry --registry-push-username={USERNAME} --registry-push-password={PASSWORD} +$ zarf tools update-creds git --git-push-username={USERNAME} --git-push-password={PASSWORD} +$ zarf tools update-creds artifact --artifact-push-username={USERNAME} --artifact-push-token={PASSWORD} + +# NOTE: Not specifying a pull username/password will keep the previous pull username/password. ``` diff --git a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_wait-for.md b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_wait-for.md index 0adace0386..507a7e5aae 100644 --- a/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_wait-for.md +++ b/docs/2-the-zarf-cli/100-cli-commands/zarf_tools_wait-for.md @@ -19,22 +19,22 @@ zarf tools wait-for { KIND | PROTOCOL } { NAME | SELECTOR | URI } { CONDITION | ``` - # Wait for Kubernetes resources: - zarf tools wait-for pod my-pod-name ready -n default # wait for pod my-pod-name in namespace default to be ready - zarf tools wait-for p cool-pod-name ready -n cool # wait for pod (using p alias) cool-pod-name in namespace cool to be ready - zarf tools wait-for deployment podinfo available -n podinfo # wait for deployment podinfo in namespace podinfo to be available - zarf tools wait-for pod app=podinfo ready -n podinfo # wait for pod with label app=podinfo in namespace podinfo to be ready - zarf tools wait-for svc zarf-docker-registry exists -n zarf # wait for service zarf-docker-registry in namespace zarf to exist - zarf tools wait-for svc zarf-docker-registry -n zarf # same as above, except exists is the default condition - zarf tools wait-for crd addons.k3s.cattle.io # wait for crd addons.k3s.cattle.io to exist - zarf tools wait-for sts test-sts '{.status.availableReplicas}'=23 # wait for statefulset test-sts to have 23 available replicas - - # Wait for network endpoints: - zarf tools wait-for http localhost:8080 200 # wait for a 200 response from http://localhost:8080 - zarf tools wait-for tcp localhost:8080 # wait for a connection to be established on localhost:8080 - zarf tools wait-for https 1.1.1.1 200 # wait for a 200 response from https://1.1.1.1 - zarf tools wait-for http google.com # wait for any 2xx response from http://google.com - zarf tools wait-for http google.com success # wait for any 2xx response from http://google.com +# Wait for Kubernetes resources: +$ zarf tools wait-for pod my-pod-name ready -n default # wait for pod my-pod-name in namespace default to be ready +$ zarf tools wait-for p cool-pod-name ready -n cool # wait for pod (using p alias) cool-pod-name in namespace cool to be ready +$ zarf tools wait-for deployment podinfo available -n podinfo # wait for deployment podinfo in namespace podinfo to be available +$ zarf tools wait-for pod app=podinfo ready -n podinfo # wait for pod with label app=podinfo in namespace podinfo to be ready +$ zarf tools wait-for svc zarf-docker-registry exists -n zarf # wait for service zarf-docker-registry in namespace zarf to exist +$ zarf tools wait-for svc zarf-docker-registry -n zarf # same as above, except exists is the default condition +$ zarf tools wait-for crd addons.k3s.cattle.io # wait for crd addons.k3s.cattle.io to exist +$ zarf tools wait-for sts test-sts '{.status.availableReplicas}'=23 # wait for statefulset test-sts to have 23 available replicas + +# Wait for network endpoints: +$ zarf tools wait-for http localhost:8080 200 # wait for a 200 response from http://localhost:8080 +$ zarf tools wait-for tcp localhost:8080 # wait for a connection to be established on localhost:8080 +$ zarf tools wait-for https 1.1.1.1 200 # wait for a 200 response from https://1.1.1.1 +$ zarf tools wait-for http google.com # wait for any 2xx response from http://google.com +$ zarf tools wait-for http google.com success # wait for any 2xx response from http://google.com ``` diff --git a/packages/gitea/gitea-values.yaml b/packages/gitea/gitea-values.yaml index a917782bac..d8b4aa8c22 100644 --- a/packages/gitea/gitea-values.yaml +++ b/packages/gitea/gitea-values.yaml @@ -25,7 +25,7 @@ gitea: security: INSTALL_LOCK: true service: - DISABLE_REGISTRATION: "###ZARF_VAR_GIT_SERVER_DISABLE_REGISTRATION###" + DISABLE_REGISTRATION: ###ZARF_VAR_GIT_SERVER_DISABLE_REGISTRATION### repository: ENABLE_PUSH_CREATE_USER: true FORCE_PRIVATE: true diff --git a/packages/gitea/zarf.yaml b/packages/gitea/zarf.yaml index be2fc36143..62ab2b0497 100644 --- a/packages/gitea/zarf.yaml +++ b/packages/gitea/zarf.yaml @@ -34,10 +34,10 @@ variables: - name: GIT_SERVER_REPLICA_COUNT description: The number of git server replicas to deploy default: "1" - + - name: GIT_SERVER_DISABLE_REGISTRATION description: Disables the ability to register new users - default: true + default: "true" constants: - name: GITEA_IMAGE diff --git a/src/cmd/common/vendor.go b/src/cmd/common/vendor.go index 625196c644..29694c3967 100644 --- a/src/cmd/common/vendor.go +++ b/src/cmd/common/vendor.go @@ -22,6 +22,7 @@ var vendorCmds = []string{ "s", "k9s", "monitor", + "m", "wait-for", "wait", "w", diff --git a/src/cmd/internal.go b/src/cmd/internal.go index a8e6e2ff64..ba066b7e88 100644 --- a/src/cmd/internal.go +++ b/src/cmd/internal.go @@ -92,6 +92,14 @@ var generateCLIDocs = &cobra.Command{ } } } + + if toolCmd.Use == "monitor" { + toolCmd.Flags().VisitAll(func(flag *pflag.Flag) { + if flag.Value.Type() == "string" { + flag.DefValue = "" + } + }) + } } } } diff --git a/src/cmd/package.go b/src/cmd/package.go index 3afb9aba35..0d0d003a6f 100644 --- a/src/cmd/package.go +++ b/src/cmd/package.go @@ -108,6 +108,7 @@ var packageMirrorCmd = &cobra.Command{ Aliases: []string{"mr"}, Short: lang.CmdPackageMirrorShort, Long: lang.CmdPackageMirrorLong, + Example: lang.CmdPackageMirrorExample, Args: cobra.MaximumNArgs(1), Run: func(cmd *cobra.Command, args []string) { pkgConfig.PkgOpts.PackageSource = choosePackage(args) diff --git a/src/cmd/tools/k9s.go b/src/cmd/tools/k9s.go index 3791667e10..d38992ead9 100644 --- a/src/cmd/tools/k9s.go +++ b/src/cmd/tools/k9s.go @@ -10,22 +10,27 @@ import ( "github.com/defenseunicorns/zarf/src/config/lang" k9s "github.com/derailed/k9s/cmd" "github.com/spf13/cobra" + + // This allows for go linkname to be used in this file. Go linkname is used so that we can pull the CLI flags from k9s and generate proper docs for the vendored tool. + _ "unsafe" ) +//go:linkname k9sRootCmd github.com/derailed/k9s/cmd.rootCmd +var k9sRootCmd *cobra.Command + func init() { k9sCmd := &cobra.Command{ - Use: "monitor", - Aliases: []string{"m", "k9s"}, - Short: lang.CmdToolsMonitorShort, - DisableFlagParsing: true, + Use: "monitor", + Aliases: []string{"m", "k9s"}, + Short: lang.CmdToolsMonitorShort, Run: func(cmd *cobra.Command, args []string) { // Hack to make k9s think it's all alone os.Args = []string{os.Args[0]} - // Pass the rest of the arguments to k9s - os.Args = append(os.Args, args...) k9s.Execute() }, } + k9sCmd.Flags().AddFlagSet(k9sRootCmd.Flags()) + toolsCmd.AddCommand(k9sCmd) } diff --git a/src/config/lang/english.go b/src/config/lang/english.go index 7c4b21c94f..9c5ace02ba 100644 --- a/src/config/lang/english.go +++ b/src/config/lang/english.go @@ -118,28 +118,28 @@ const ( "that the Zarf binary is located in.\n\n\n\n" CmdInitExample = ` - # Initializing without any optional components: - zarf init +# Initializing without any optional components: +$ zarf init - # Initializing w/ Zarfs internal git server: - zarf init --components=git-server +# Initializing w/ Zarfs internal git server: +$ zarf init --components=git-server - # Initializing w/ Zarfs internal git server and PLG stack: - zarf init --components=git-server,logging +# Initializing w/ Zarfs internal git server and PLG stack: +$ zarf init --components=git-server,logging - # Initializing w/ an internal registry but with a different nodeport: - zarf init --nodeport=30333 +# Initializing w/ an internal registry but with a different nodeport: +$ zarf init --nodeport=30333 - # Initializing w/ an external registry: - zarf init --registry-push-password={PASSWORD} --registry-push-username={USERNAME} --registry-url={URL} +# Initializing w/ an external registry: +$ zarf init --registry-push-password={PASSWORD} --registry-push-username={USERNAME} --registry-url={URL} - # Initializing w/ an external git server: - zarf init --git-push-password={PASSWORD} --git-push-username={USERNAME} --git-url={URL} +# Initializing w/ an external git server: +$ zarf init --git-push-password={PASSWORD} --git-push-username={USERNAME} --git-url={URL} - # Initializing w/ an external artifact server: - zarf init --artifact-push-password={PASSWORD} --artifact-push-username={USERNAME} --artifact-url={URL} +# Initializing w/ an external artifact server: +$ zarf init --artifact-push-password={PASSWORD} --artifact-push-username={USERNAME} --artifact-url={URL} - # NOTE: Not specifying a pull username/password will use the push user for pulling as well. +# NOTE: Not specifying a pull username/password will use the push user for pulling as well. ` CmdInitErrFlags = "Invalid command flags were provided." @@ -230,6 +230,25 @@ const ( CmdPackageMirrorShort = "Mirrors a Zarf package's internal resources to specified image registries and git repositories" CmdPackageMirrorLong = "Unpacks resources and dependencies from a Zarf package archive and mirrors them into the specified \n" + "image registries and git repositories within the target environment" + CmdPackageMirrorExample = ` +# Mirror resources to internal Zarf resources +$ zarf package mirror-resources \ + --registry-url 127.0.0.1:31999 \ + --registry-push-username zarf-push \ + --registry-push-password \ + --git-url http://zarf-gitea-http.zarf.svc.cluster.local:3000 \ + --git-push-username zarf-git-user \ + --git-push-password + +# Mirror resources to external resources +$ zarf package mirror-resources \ + --registry-url registry.enterprise.corp \ + --registry-push-username \ + --registry-push-password \ + --git-url https://git.enterprise.corp \ + --git-push-username \ + --git-push-password +` CmdPackageInspectShort = "Displays the definition of a Zarf package (runs offline)" CmdPackageInspectLong = "Displays the 'zarf.yaml' definition for the specified package and optionally allows SBOMs to be viewed" @@ -285,18 +304,18 @@ const ( CmdPackagePublishShort = "Publishes a Zarf package to a remote registry" CmdPackagePublishExample = ` - # Publish a package to a remote registry - zarf package publish my-package.tar oci://my-registry.com/my-namespace +# Publish a package to a remote registry +$ zarf package publish my-package.tar oci://my-registry.com/my-namespace - # Publish a skeleton package to a remote registry - zarf package publish ./path/to/dir oci://my-registry.com/my-namespace +# Publish a skeleton package to a remote registry +$ zarf package publish ./path/to/dir oci://my-registry.com/my-namespace ` CmdPackagePublishFlagSigningKey = "Path to a private key file for signing or re-signing packages with a new key" CmdPackagePublishFlagSigningKeyPassword = "Password to the private key file used for publishing packages" CmdPackagePublishErr = "Failed to publish package: %s" CmdPackagePullShort = "Pulls a Zarf package from a remote registry and save to the local file system" - CmdPackagePullExample = " zarf package pull oci://my-registry.com/my-namespace/my-package:0.0.1-arm64" + CmdPackagePullExample = "$ zarf package pull oci://my-registry.com/my-namespace/my-package:0.0.1-arm64" CmdPackagePullFlagOutputDirectory = "Specify the output directory for the pulled Zarf package" CmdPackagePullErr = "Failed to pull package: %s" @@ -353,49 +372,49 @@ const ( CmdToolsRegistryTunnel = "Opening a tunnel from %s locally to %s in the cluster" CmdToolsRegistryCatalogExample = ` - # list the repos internal to Zarf - $ zarf tools registry catalog +# List the repos internal to Zarf +$ zarf tools registry catalog - # list the repos for reg.example.com - $ zarf tools registry catalog reg.example.com +# List the repos for reg.example.com +$ zarf tools registry catalog reg.example.com ` CmdToolsRegistryListExample = ` - # list the tags for a repo internal to Zarf - $ zarf tools registry ls 127.0.0.1:31999/stefanprodan/podinfo +# List the tags for a repo internal to Zarf +$ zarf tools registry ls 127.0.0.1:31999/stefanprodan/podinfo - # list the tags for a repo hosted at reg.example.com - $ zarf tools registry ls reg.example.com/stefanprodan/podinfo +# List the tags for a repo hosted at reg.example.com +$ zarf tools registry ls reg.example.com/stefanprodan/podinfo ` CmdToolsRegistryPushExample = ` - # push an image into an internal repo in Zarf - $ zarf tools registry push image.tar 127.0.0.1:31999/stefanprodan/podinfo:6.4.0 +# Push an image into an internal repo in Zarf +$ zarf tools registry push image.tar 127.0.0.1:31999/stefanprodan/podinfo:6.4.0 - # push an image into an repo hosted at reg.example.com - $ zarf tools registry push image.tar reg.example.com/stefanprodan/podinfo:6.4.0 +# Push an image into an repo hosted at reg.example.com +$ zarf tools registry push image.tar reg.example.com/stefanprodan/podinfo:6.4.0 ` CmdToolsRegistryPullExample = ` - # pull an image from an internal repo in Zarf to a local tarball - $ zarf tools registry pull 127.0.0.1:31999/stefanprodan/podinfo:6.4.0 image.tar +# Pull an image from an internal repo in Zarf to a local tarball +$ zarf tools registry pull 127.0.0.1:31999/stefanprodan/podinfo:6.4.0 image.tar - # pull an image from a repo hosted at reg.example.com to a local tarball - $ zarf tools registry pull reg.example.com/stefanprodan/podinfo:6.4.0 image.tar +# Pull an image from a repo hosted at reg.example.com to a local tarball +$ zarf tools registry pull reg.example.com/stefanprodan/podinfo:6.4.0 image.tar ` CmdToolsRegistryDeleteExample = ` -# delete an image digest from an internal repo in Zarf +# Delete an image digest from an internal repo in Zarf $ zarf tools registry delete 127.0.0.1:31999/stefanprodan/podinfo@sha256:57a654ace69ec02ba8973093b6a786faa15640575fbf0dbb603db55aca2ccec8 -# delete an image digest from a repo hosted at reg.example.com +# Delete an image digest from a repo hosted at reg.example.com $ zarf tools registry delete reg.example.com/stefanprodan/podinfo@sha256:57a654ace69ec02ba8973093b6a786faa15640575fbf0dbb603db55aca2ccec8 ` CmdToolsRegistryDigestExample = ` -# return an image digest for an internal repo in Zarf +# Return an image digest for an internal repo in Zarf $ zarf tools registry digest 127.0.0.1:31999/stefanprodan/podinfo:6.4.0 -# return an image digest from a repo hosted at reg.example.com +# Return an image digest from a repo hosted at reg.example.com $ zarf tools registry digest reg.example.com/stefanprodan/podinfo:6.4.0 ` @@ -454,22 +473,22 @@ $ zarf tools registry digest reg.example.com/stefanprodan/podinfo:6.4.0 "This command can be used to wait for a Kubernetes resources to exist and be ready that may be created by a Gitops tool or a Kubernetes operator.\n" + "You can also wait for arbitrary network endpoints using REST or TCP checks.\n\n" CmdToolsWaitForExample = ` - # Wait for Kubernetes resources: - zarf tools wait-for pod my-pod-name ready -n default # wait for pod my-pod-name in namespace default to be ready - zarf tools wait-for p cool-pod-name ready -n cool # wait for pod (using p alias) cool-pod-name in namespace cool to be ready - zarf tools wait-for deployment podinfo available -n podinfo # wait for deployment podinfo in namespace podinfo to be available - zarf tools wait-for pod app=podinfo ready -n podinfo # wait for pod with label app=podinfo in namespace podinfo to be ready - zarf tools wait-for svc zarf-docker-registry exists -n zarf # wait for service zarf-docker-registry in namespace zarf to exist - zarf tools wait-for svc zarf-docker-registry -n zarf # same as above, except exists is the default condition - zarf tools wait-for crd addons.k3s.cattle.io # wait for crd addons.k3s.cattle.io to exist - zarf tools wait-for sts test-sts '{.status.availableReplicas}'=23 # wait for statefulset test-sts to have 23 available replicas - - # Wait for network endpoints: - zarf tools wait-for http localhost:8080 200 # wait for a 200 response from http://localhost:8080 - zarf tools wait-for tcp localhost:8080 # wait for a connection to be established on localhost:8080 - zarf tools wait-for https 1.1.1.1 200 # wait for a 200 response from https://1.1.1.1 - zarf tools wait-for http google.com # wait for any 2xx response from http://google.com - zarf tools wait-for http google.com success # wait for any 2xx response from http://google.com +# Wait for Kubernetes resources: +$ zarf tools wait-for pod my-pod-name ready -n default # wait for pod my-pod-name in namespace default to be ready +$ zarf tools wait-for p cool-pod-name ready -n cool # wait for pod (using p alias) cool-pod-name in namespace cool to be ready +$ zarf tools wait-for deployment podinfo available -n podinfo # wait for deployment podinfo in namespace podinfo to be available +$ zarf tools wait-for pod app=podinfo ready -n podinfo # wait for pod with label app=podinfo in namespace podinfo to be ready +$ zarf tools wait-for svc zarf-docker-registry exists -n zarf # wait for service zarf-docker-registry in namespace zarf to exist +$ zarf tools wait-for svc zarf-docker-registry -n zarf # same as above, except exists is the default condition +$ zarf tools wait-for crd addons.k3s.cattle.io # wait for crd addons.k3s.cattle.io to exist +$ zarf tools wait-for sts test-sts '{.status.availableReplicas}'=23 # wait for statefulset test-sts to have 23 available replicas + +# Wait for network endpoints: +$ zarf tools wait-for http localhost:8080 200 # wait for a 200 response from http://localhost:8080 +$ zarf tools wait-for tcp localhost:8080 # wait for a connection to be established on localhost:8080 +$ zarf tools wait-for https 1.1.1.1 200 # wait for a 200 response from https://1.1.1.1 +$ zarf tools wait-for http google.com # wait for any 2xx response from http://google.com +$ zarf tools wait-for http google.com success # wait for any 2xx response from http://google.com ` CmdToolsWaitForFlagTimeout = "Specify the timeout duration for the wait command." CmdToolsWaitForErrTimeoutString = "Invalid timeout duration '%s'. Please use a valid duration string (e.g. 1s, 2m, 3h)." @@ -483,45 +502,45 @@ $ zarf tools registry digest reg.example.com/stefanprodan/podinfo:6.4.0 CmdToolsGetCredsShort = "Displays a table of credentials for deployed Zarf services. Pass a service key to get a single credential" CmdToolsGetCredsLong = "Display a table of credentials for deployed Zarf services. Pass a service key to get a single credential. i.e. 'zarf tools get-creds registry'" CmdToolsGetCredsExample = ` - # Print all Zarf credentials: - zarf tools get-creds - - # Get specific Zarf credentials: - zarf tools get-creds registry - zarf tools get-creds registry-readonly - zarf tools get-creds git - zarf tools get-creds git-readonly - zarf tools get-creds artifact - zarf tools get-creds logging +# Print all Zarf credentials: +$ zarf tools get-creds + +# Get specific Zarf credentials: +$ zarf tools get-creds registry +$ zarf tools get-creds registry-readonly +$ zarf tools get-creds git +$ zarf tools get-creds git-readonly +$ zarf tools get-creds artifact +$ zarf tools get-creds logging ` CmdToolsUpdateCredsShort = "Updates the credentials for deployed Zarf services. Pass a service key to update credentials for a single service" CmdToolsUpdateCredsLong = "Updates the credentials for deployed Zarf services. Pass a service key to update credentials for a single service. i.e. 'zarf tools update-creds registry'" CmdToolsUpdateCredsExample = ` - # Autogenerate all Zarf credentials at once: - zarf tools update-creds - - # Autogenerate specific Zarf service credentials: - zarf tools update-creds registry - zarf tools update-creds git - zarf tools update-creds artifact - zarf tools update-creds agent - - # Update all Zarf credentials w/external services at once: - zarf tools update-creds \ - --registry-push-username={USERNAME} --registry-push-password={PASSWORD} \ - --git-push-username={USERNAME} --git-push-password={PASSWORD} \ - --artifact-push-username={USERNAME} --artifact-push-token={PASSWORD} - - # NOTE: Any credentials omitted from flags without a service key specified will be autogenerated - URLs will only change if specified. - # Config options can also be set with the 'init' section of a Zarf config file. - - # Update specific Zarf credentials w/external services: - zarf tools update-creds registry --registry-push-username={USERNAME} --registry-push-password={PASSWORD} - zarf tools update-creds git --git-push-username={USERNAME} --git-push-password={PASSWORD} - zarf tools update-creds artifact --artifact-push-username={USERNAME} --artifact-push-token={PASSWORD} - - # NOTE: Not specifying a pull username/password will keep the previous pull username/password. +# Autogenerate all Zarf credentials at once: +$ zarf tools update-creds + +# Autogenerate specific Zarf service credentials: +$ zarf tools update-creds registry +$ zarf tools update-creds git +$ zarf tools update-creds artifact +$ zarf tools update-creds agent + +# Update all Zarf credentials w/external services at once: +$ zarf tools update-creds \ + --registry-push-username={USERNAME} --registry-push-password={PASSWORD} \ + --git-push-username={USERNAME} --git-push-password={PASSWORD} \ + --artifact-push-username={USERNAME} --artifact-push-token={PASSWORD} + +# NOTE: Any credentials omitted from flags without a service key specified will be autogenerated - URLs will only change if specified. +# Config options can also be set with the 'init' section of a Zarf config file. + +# Update specific Zarf credentials w/external services: +$ zarf tools update-creds registry --registry-push-username={USERNAME} --registry-push-password={PASSWORD} +$ zarf tools update-creds git --git-push-username={USERNAME} --git-push-password={PASSWORD} +$ zarf tools update-creds artifact --artifact-push-username={USERNAME} --artifact-push-token={PASSWORD} + +# NOTE: Not specifying a pull username/password will keep the previous pull username/password. ` CmdToolsUpdateCredsConfirmFlag = "Confirm updating credentials without prompting" CmdToolsUpdateCredsConfirmProvided = "Confirm flag specified, continuing without prompting."