meshctl experimental validate resources
meshctl experimental validate resources
Validate Gloo custom resources.
Synopsis
Validate the configuration of one or more Gloo custom resources before you apply the CRs to your environment. To see the fields that are validated and the accepted values for each field, check the API reference for each custom resource.
meshctl experimental validate resources [flags]
Examples
# Validate RetryTimeoutPolicy from a file:
meshctl x validate resources resource.yaml
# Validate multiple RetryTimeoutPolicy resources from STDIN:
meshctl x validate resources --interactive=false - <<EOF
apiVersion: resilience.policy.gloo.solo.io/v2
kind: RetryTimeoutPolicy
metadata:
name: test1
namespace: default
spec:
applyToRoutes:
- route:
labels:
app: test
config:
retries:
attempts: 1
---
apiVersion: resilience.policy.gloo.solo.io/v2
kind: RetryTimeoutPolicy
metadata:
name: test2
namespace: default
spec:
applyToRoutes:
- route:
labels:
app: test
config:
retries:
attempts: -1
EOF
# Validate resources without connecting to the management cluster by using downloaded snapshots of resources:
meshctl x validate resources transformation-policy.yaml --input-snapshot offline-translation/input-snapshot-plain.json --output-snapshot offline-translation/output-snapshot-plain.json --mgmt-cluster-name=mgmt-cluster
# Skip validation stages without using the interactive CLI:
meshctl x validate resources transformation-policy.yaml --interactive=false --skip-schema-validation --skip-input-resources-changed
Options
--concurrency uint16 Number of concurrent translations (default 1) (default 8)
-h, --help help for resources
--input-snapshot string JSON file containing the input snapshot; triggers offline translation
-i, --interactive Run in interactive mode (default true)
--mgmt-cluster-name string The name of the management cluster. In online mode this will be found dynamically
--output-snapshot string JSON file containing the output snapshot; when used with --input-snapshot, triggers offline translation
--skip-detect-resource-changes Skip indicates which resources have changed from the given input snapshot
--skip-input-resource-diff Skip diff the input resources against the latest input snapshot
--skip-load-resources Skip load input and output resources, either from local snapshot files or from a management cluster
--skip-output-resource-diff Skip diff the output resources against the latest output snapshot
--skip-schema-validation Skip schema validation on individual resources
--skip-translation Skip translate input resources to output resources and display errors/warnings
--timeout duration Timeout for each phase in minutes (default 5m) (default 5m0s)
Options inherited from parent commands
--kubeconfig string Path to the kubeconfig file for the cluster.
--kubecontext string Kubernetes context for the cluster to run the command in.
-n, --namespace string Namespace to run the command in. (default "gloo-mesh")
--plain Disable styling for terminal output.
-v, --verbose Enable verbose logging.
SEE ALSO
- meshctl experimental validate - Perform validations
- meshctl experimental validate resources clean - Clean up validation logs.