On this page
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
# 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. This triggers offline translation.
-i, --interactive Run in interactive mode (default true)
--output-snapshot string JSON file containing the output snapshot. When used with --input-snapshot, this triggers offline translation.
--skip-detect-resource-changes Skip Indicates which resources have changed from the given input snapshot and given output snapshot.
--skip-input-resource-diff Skip Shows the diff between the input resources and the latest input snapshot.
--skip-load-resources Skip Loads input and output resources, either from local snapshot files or from a management cluster.
--skip-output-resource-diff Skip Shows the diff between the output resources and the latest output snapshot.
--skip-schema-validation Skip Validates the schema of individual resources.
--skip-translation Skip Translates the input resources into output resources, and displays any errors or 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.