Skip to main content
版本:v1.4

vela kube apply

Apply resources in Kubernetes YAML file to clusters.

Synopsis

Apply Kubernetes objects in clusters

Apply Kubernetes objects in multiple clusters. Use --clusters to specify which clusters to apply. If -n/--namespace is used, the original object namespace will be overridden.

You can use -f/--file to specify the object file to apply. Multiple file inputs are allowed. Directory input and web url input is supported as well.

vela kube apply [flags]

Examples

  # Apply single object file in managed cluster
vela kube apply -f my.yaml --cluster cluster-1

# Apply multiple object files in multiple managed clusters
vela kube apply -f my-1.yaml -f my-2.yaml --cluster cluster-1 --cluster cluster-2

# Apply object file with web url in control plane
vela kube apply -f https://raw.githubusercontent.com/kubevela/kubevela/master/docs/examples/app-with-probe/app-with-probe.yaml

# Apply object files in directory to specified namespace in managed clusters
vela kube apply -f ./resources -n demo --cluster cluster-1 --cluster cluster-2

Options

  -c, --cluster strings    The cluster to apply objects. Setting multiple clusters will apply objects in order. (default [local])
--dryrun Setting this flag will not apply resources in clusters. It will print out the resource to be applied.
-f, --file strings Files that include native Kubernetes objects to apply.
-h, --help help for apply
-n, --namespace string The namespace to apply objects. If empty, the namespace declared in the YAML will be used.

Options inherited from parent commands

  -y, --yes   Assume yes for all user prompts

SEE ALSO

  • vela kube - Managing native Kubernetes resources across clusters.

Go Back to CLI Commands Homepage.

Auto generated by spf13/cobra script in KubeVela.