Skip to main content
版本:v1.6

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/folder to apply. Multiple file inputs are allowed. Directory input and web url input is supported as well. File format can be in YAML, JSON or CUE.

vela kube apply [flags]

Examples

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

# Apply object in CUE, the whole CUE file MUST follow the kubernetes API and contain only one object.
vela kube apply -f my.cue --cluster cluster-1

# Apply object in JSON, the whole JSON file MUST follow the kubernetes API and contain only one object.
vela kube apply -f my.json --cluster cluster-1

# Apply multiple object files in multiple managed clusters
vela kube apply -f my-1.yaml -f my-2.cue --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

# Use dry-run to see what will be rendered out in YAML
vela kube apply -f my.cue --cluster cluster-1 --dry-run

Options

  -c, --cluster strings    The cluster to apply objects. Setting multiple clusters will apply objects in order. (default [local])
--dry-run 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.