Skip to main content

wf apply

wf apply

Allows you to apply a set of resources from files

Synopsis

Applies a set of Wayfinder configuration objects from the provided files / directories.

This allows you to maintain your platform or workspace configuration in a file structure which can be stored in a source repository and applied using a CI process.

Providing an optional --owner flag marks the objects as read-only through the UI and CLI. They can then only be amended when specifying the same owner. Note that ownership does not confer any security control - any user who has write access to the objects can provide the owner flag to set the values. To provide secure access control, use Wayfinder and workspace groups.

If an --owner is specified, you can additionally supply --prune. USE WITH CARE: this will remove every object owned by the specified owner which is not present in the provided fileset. --prune must be combined with --owner (and --prune-scope unless operating in a workspace).

The prune scope controls the behaviour of --prune:

  • 'platform': prunes platform-wide non-workspaced resources only (such as cluster plans, global DNS zones, etc)
  • 'workspace': prunes workspace-scoped resources (such as clusters, apps, etc) from the current workspace only. This is the default when running in the context of a workspace.
  • 'all': prunes both platform-wide and workspace-scoped resources in all workspaces
wf apply [flags]

Examples


# Apply a folder of files to workspace wsp1:
$ wf apply -w wsp1 -f ./manifests/workspace/

# Apply a folder of files and wait up to 30 seconds for the resources to be ready:
$ wf apply -f ./manifests/ --wait-for-ready 30s

# Apply a folder of files and mark them as owned by 'teaminfra-ci':
$ wf apply -f ./manifests/ --owner teaminfra-ci

# Apply a folder of files for workspace wsp1, mark them owned by teaminfra-ci, and prune any
# resources owned by teaminfra-ci but NOT present in the applied files from the workspace - this is
# a good example for fully managing workspace configuration from a CI process:
# 1. Review the resources that would be applied and pruned:
$ wf apply -w wsp1 -f ./manifests/workspace/ --owner teaminfra-ci --prune --dry-run server
# 2. Apply the resources and prune those now orphaned:
$ wf apply -w wsp1 -f ./manifests/workspace/ --owner teaminfra-ci --prune --confirm

# Review and apply a folder of files representing platform configuration, mark them owned by
# platform-ci, and prune any resources NOT present in the applied files from the platform:
$ wf apply -f ./manifests/platform/ --owner platform-ci --prune --prune-scope platform --dry-run server
$ wf apply -f ./manifests/platform/ --owner platform-ci --prune --prune-scope platform --confirm

# Review and apply a folder of files representing platform and multiple workspace configuration,
# mark them owned by platform-ci, and prune any resources owned by platform-ci and NOT present in
# the applied files from the platform and from any workspaces:
$ wf apply -f ./manifests/platformandworkspaces/ --owner platform-ci --prune --prune-scope all --dry-run server
$ wf apply -f ./manifests/platformandworkspaces/ --owner platform-ci --prune --prune-scope all --confirm

Options

      --confirm                   Skips prompting for confirmation when using --prune without --dry-run
--dry-run string Validates resources without persisting - 'client' performs limited local schema checks and prints the resources, 'server' performs full validation of each resource with the API. Default: 'none' (default "none")
-f, --file PATH path to file containing resource definition/s ('-' for stdin) PATH
--force Overrides read-only (ignored unless you are a Wayfinder admin)
-h, --help help for apply
--non-interactive Will fail instead of prompting if user interaction required (e.g. to confirm a --prune without --confirm)
-o, --output string Outputs the resources being applied to your terminal in the specified format (supports json, yaml).
--owner string Sets the owner on the applied resources to the provided value
--prune When specified with --owner, removes any owned resources NOT specified in the provided fileset. If used outside the scope of a workspace, must be combined with --prune-scope.
--prune-scope string Must be specified when using --prune without --workspace. Valid values are 'platform' (prunes non-workspaced objects) or 'all' (prunes objects in all workspaces and non-workspaced objects)
--wait-for-ready DURATION Wait for up to the provided time for all resources to become ready after applying, e.g. 30s DURATION

Options inherited from parent commands

      --debug              Indicates we should use debug / trace logging (default: false)
--no-wait Indicates we should not wait for resources to provision
--profile string Use a profile other than your default for this command
--show-headers Indicates we should display headers on table out (default true)
--verbose Enables verbose logging for debugging purposes (default: false)
-w, --workspace string The workspace you are operating within

SEE ALSO

  • wf - wf provides a cli for Wayfinder