Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Get a high-level view of Grey Matter's features.
Learn about Grey Matter: the intelligent hybrid mesh.
Gain real-time insight into the performance of your microservices.
Learn about the major components in the Grey Matter ecosystem.
Explore Grey Matter's design and learn how it works.
Use policies to securely manage services across platforms and between private and public clouds.
Make sure only the right users and secure devices can access applications.
Walkthroughs of common operations.
This guide will help you install and set up the Grey Matter CLI.
Follow along with this guide to configure SPIRE in Grey Matter.
This guide will help you enable and disable Grey Matter Sidecar filters.
{ "zone_key": "default-zone", "cluster_key": "catalog-proxy", "name": "catalog", "instances": [], "circuit_breakers": { "max_connections": 500, "max_requests": 500 }, "outlier_detection": null, "health_checks": []}{ "cluster_key": "catalog-proxy", "zone_key": "default-zone", "name": "catalog", "secret": { "secret_key": "", "secret_name": "", "secret_validation_name": "", "subject_names": null, "ecdh_curves": null, "set_current_client_cert_details": { "uri": false }, "checksum": "" }, "instances": [ { "host": "10.128.2.183", "port": 9080, "metadata": [ { "key": "pod-template-hash", "value": "2000163809" }, { "key": "gm_k8s_host_ip", "value": "10.0.2.132" }, { "key": "gm_k8s_node_name", "value": "ip-10-0-2-132.ec2.internal" } ] }, { "host": "10.128.2.140", "port": 9080, "metadata": [ { "key": "pod-template-hash", "value": "475497808" }, { "key": "gm_k8s_host_ip", "value": "10.0.2.82" }, { "key": "gm_k8s_node_name", "value": "ip-10-0-2-82.ec2.internal" } ] } ], "circuit_breakers": { "max_connections": 500, "max_pending_requests": null, "max_retries": null, "max_requests": 500 }, "outlier_detection": null, "health_checks": [], "checksum": "2b6d2a8a6886eb30574f16480b0f99b90e11484d9ddb10fb7970c3ce37d945ab"}XDS_CLUSTER=catalogXDS_REGION=default-zone{ "proxy_key": "catalog-proxy", "zone_key": "default-zone", "name": "catalog", "domain_keys": [ "catalog" ], "listener_keys": [ "catalog-listener" ], "listeners": null, "active_proxy_filters": [ "gm.metrics" ], "proxy_filters": { "gm_impersonation": {}, "gm_observables": {}, "gm_oauth": {}, "gm_inheaders": {}, "gm_listauth": {}, "gm_metrics": { "metrics_port": 8081, "metrics_host": "0.0.0.0", "metrics_dashboard_uri_path": "/metrics", "metrics_prometheus_uri_path": "/prometheus", "prometheus_system_metrics_interval_seconds": 15, "metrics_ring_buffer_size": 4096, "metrics_key_function": "depth" } }}kubectl or oc setup with access to the clusteredge$ kubectl get pods | grep edge
edge-7d7bf848b9-xjs5l 1/1 Running 0 114m$ kubectl exec -it edge-7d7bf848b9-xjs5l -- sh
/app $/app $ curl localhost:8001/help
admin commands are:
/: Admin home page
/certs: print certs on machine
/clusters: upstream cluster status
/config_dump: dump current Envoy configs (experimental)
/contention: dump current Envoy mutex contention stats (if enabled)
/cpuprofiler: enable/disable the CPU profiler
/drain_listeners: drain listeners
/healthcheck/fail: cause the server to fail health checks
/healthcheck/ok: cause the server to pass health checks
/heapprofiler: enable/disable the heap profiler
/help: print out list of admin commands
/hot_restart_version: print the hot restart compatibility version
/listeners: print listener info
/logging: query/change logging levels
/memory: print current allocation/heap usage
/quitquitquit: exit the server
/ready: print server state, return 200 if LIVE, otherwise return 503
/reset_counters: reset all counters to zero
/runtime: print runtime values
/runtime_modify: modify runtime values
/server_info: print server version/status information
/stats: print server stats
/stats/prometheus: print server stats in prometheus format
/stats/recentlookups: Show recent stat-name lookups
/stats/recentlookups/clear: clear list of stat-name lookups and counter
/stats/recentlookups/disable: disable recording of reset stat-name lookup names
/stats/recentlookups/enable: enable recording of reset stat-name lookup names/app $ curl localhost:8001/stats
cluster.catalog.assignment_stale: 0
cluster.catalog.assignment_timeout_received: 0
cluster.catalog.bind_errors: 0
cluster.catalog.circuit_breakers.default.cx_open: 0
cluster.catalog.circuit_breakers.default.cx_pool_open: 0
cluster.catalog.circuit_breakers.default.rq_open: 0
cluster.catalog.circuit_breakers.default.rq_pending_open: 0
cluster.catalog.circuit_breakers.default.rq_retry_open: 0
cluster.catalog.circuit_breakers.high.cx_open: 0
cluster.catalog.circuit_breakers.high.cx_pool_open: 0
cluster.catalog.circuit_breakers.high.rq_open: 0
cluster.catalog.circuit_breakers.high.rq_pending_open: 0
cluster.catalog.circuit_breakers.high.rq_retry_open: 0
cluster.catalog.client_ssl_socket_factory.downstream_context_secrets_not_ready: 0
cluster.catalog.client_ssl_socket_factory.ssl_context_update_by_sds: 7
cluster.catalog.client_ssl_socket_factory.upstream_context_secrets_not_ready: 0
cluster.catalog.control_plane.connected_state: 1
cluster.catalog.control_plane.pending_requests: 0
cluster.catalog.control_plane.rate_limit_enforced: 0
cluster.catalog.default.total_match_count: 0
cluster.catalog.external.upstream_rq_503: 6
cluster.catalog.external.upstream_rq_5xx: 6
cluster.catalog.external.upstream_rq_completed: 6
cluster.catalog.init_fetch_timeout: 0
cluster.catalog.lb_healthy_panic: 6
.../app $ curl localhost:8001/stats?filter=cluster.prometheus
cluster.prometheus.assignment_stale: 0
cluster.prometheus.assignment_timeout_received: 0
cluster.prometheus.bind_errors: 0
cluster.prometheus.circuit_breakers.default.cx_open: 0
cluster.prometheus.circuit_breakers.default.cx_pool_open: 0
cluster.prometheus.circuit_breakers.default.rq_open: 0
cluster.prometheus.circuit_breakers.default.rq_pending_open: 0
cluster.prometheus.circuit_breakers.default.rq_retry_open: 0
cluster.prometheus.circuit_breakers.high.cx_open: 0
cluster.prometheus.circuit_breakers.high.cx_pool_open: 0
cluster.prometheus.circuit_breakers.high.rq_open: 0
cluster.prometheus.circuit_breakers.high.rq_pending_open: 0
cluster.prometheus.circuit_breakers.high.rq_retry_open: 0
cluster.prometheus.client_ssl_socket_factory.downstream_context_secrets_not_ready: 0
cluster.prometheus.client_ssl_socket_factory.ssl_context_update_by_sds: 9
cluster.prometheus.client_ssl_socket_factory.upstream_context_secrets_not_ready: 0
cluster.prometheus.control_plane.connected_state: 1
cluster.prometheus.control_plane.pending_requests: 0
cluster.prometheus.control_plane.rate_limit_enforced: 0
cluster.prometheus.default.total_match_count: 2
cluster.prometheus.external.upstream_rq_200: 26
cluster.prometheus.external.upstream_rq_2xx: 26
cluster.prometheus.external.upstream_rq_301: 1
cluster.prometheus.external.upstream_rq_302: 1
cluster.prometheus.external.upstream_rq_3xx: 2
.../app $ curl localhost:8001/stats?filter=ssl.handshake
cluster.catalog.ssl.handshake: 0
cluster.control-api.ssl.handshake: 0
cluster.dashboard.ssl.handshake: 5
cluster.data-internal.ssl.handshake: 0
cluster.internal-jwt-security.ssl.handshake: 0
cluster.jwt-security.ssl.handshake: 1
cluster.prometheus.ssl.handshake: 6
cluster.slo.ssl.handshake: 1
listener.0.0.0.0_10808.ssl.handshake: 6/app $ curl localhost:8001/config_dump
{
"configs": [
{
"@type": "type.googleapis.com/envoy.admin.v3.BootstrapConfigDump",
"bootstrap": {
"node": {
"id": "default",
"cluster": "edge",
"locality": {
"region": "default-region",
"zone": "zone-default-zone"
},
"hidden_envoy_deprecated_build_version": "a8507f67225cdd912712971bf72d41f219eb74ed/1.13.3/Modified/DEBUG/BoringSSL",
"user_agent_name": "envoy",
"user_agent_build_version": {
"version": {
"major_number": 1,
"minor_number": 13,
"patch": 3
},
"metadata": {
"revision.status": "Modified",
"revision.sha": "a8507f67225cdd912712971bf72d41f219eb74ed",
"build.type": "DEBUG",
"ssl.version": "BoringSSL"
}
},
"extensions": [
{
"name": "envoy.grpc_credentials.aws_iam",
"category": "envoy.grpc_credentials"
},
{
"name": "envoy.grpc_credentials.default",
"category": "envoy.grpc_credentials"
},
{
"name": "envoy.grpc_credentials.file_based_metadata",
"category": "envoy.grpc_credentials"
},
{
"name": "envoy.health_checkers.redis",
"category": "envoy.health_checkers"
},
{
"name": "envoy.dog_statsd",
"category": "envoy.stats_sinks"
},
{
"name": "envoy.metrics_service",
"category": "envoy.stats_sinks"
},
{
"name": "envoy.stat_sinks.hystrix",
"category": "envoy.stats_sinks"
},
{
.../app $ exitcurl -X DELETE \
-k --cacert ./certs/ca.pem \
--cert ./certs/client.pem \
--key ./certs/client.key \
https://{YOUR_AWS_ELB_HOSTNAME}:10808/services/catalog/latest/clusters/fibonacci?zoneName=zone-default-zone{"deleted": "fibonacci"}greymatter delete cluster edge-to-fibonacci-clustergreymatter delete --deep=true route edge-to-fibonacci-route
greymatter delete route edge-to-fibonacci-route-slashkubectl delete deployment fibonaccigreymatter delete cluster fibonacci-clustergreymatter delete --deep domain fibonacci-domaingreymatter delete listener fibonacci-listenergreymatter delete --deep route fibonacci-local-routegreymatter delete proxy fibonacci-proxy---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: ratelimit
name: ratelimit
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: ratelimit
template:
metadata:
labels:
app: ratelimit
spec:
serviceAccountName: default
containers:
- name: ratelimit
image: "envoyproxy/ratelimit:v1.4.0"
imagePullPolicy: IfNotPresent
env:
- name: USE_STATSD
value: "false"
- name: LOG_LEVEL
value: "debug"
- name: REDIS_SOCKET_TYPE
value: "tcp"
- name: REDIS_URL
value: "redis.default.svc:6379"
- name: RUNTIME_ROOT
value: "/"
- name: RUNTIME_SUBDIRECTORY
value: "ratelimit"
- name: REDIS_AUTH
valueFrom:
secretKeyRef:
name: redis-password
key: password
command: ["/bin/sh","-c"]
args: ["mkdir -p /ratelimit/config && cp /data/ratelimit/config/config.yaml /ratelimit/config/config.yaml && cat /ratelimit/config/config.yaml && /bin/ratelimit"]
ports:
- name: server
containerPort: 8081
- name: debug
containerPort: 6070
volumeMounts:
- name: ratelimit-config
mountPath: /data/ratelimit/config
readOnly: true
volumes:
- name: ratelimit-config
configMap:
name: ratelimit
---
kind: Service
apiVersion: v1
metadata:
name: ratelimit
labels:
app: ratelimit
spec:
ports:
- name: server
port: 8081
protocol: TCP
targetPort: 8081
- name: debug
port: 6070
protocol: TCP
targetPort: 6070
selector:
app: ratelimit
sessionAffinity: None
type: ClusterIP
---
apiVersion: v1
kind: ConfigMap
metadata:
name: ratelimit
namespace: default
data:
config.yaml: |-
---
domain: edge
descriptors:
- key: path
value: "/"
rate_limit:
unit: second
requests_per_unit: 1...
tcp_cluster:
type: 'value'
value: 'ratelimit'
tcp_host:
type: 'value'
value: 'ratelimit.default.svc.cluster.local'
tcp_port:
type: 'value'
value: '8081'
......
"active_network_filters": [
"envoy.rate_limit"
],
"network_filters": {
"envoy_rate_limit": {
"stat_prefix": "edge",
"domain": "edge",
"failure_mode_deny": true,
"descriptors": [
{
"entries": [
{
"key": "path",
"value": "/"
}
]
}
],
"rate_limit_service": {
"grpc_service": {
"envoy_grpc": {
"cluster_name": "ratelimit"
}
}
}
}
},
...time="2020-09-03T21:54:40Z" level=debug msg="returning normal response"
time="2020-09-03T21:54:40Z" level=debug msg="cache key: edge_path_/_1599170080 current: 1"
time="2020-09-03T21:54:40Z" level=debug msg="returning normal response"
time="2020-09-03T21:54:40Z" level=debug msg="starting get limit lookup"
time="2020-09-03T21:54:40Z" level=debug msg="looking up key: path_/"
time="2020-09-03T21:54:40Z" level=debug msg="found rate limit: path_/"
time="2020-09-03T21:54:40Z" level=debug msg="starting cache lookup"
time="2020-09-03T21:54:40Z" level=debug msg="looking up cache key: edge_path_/_1599170080"
time="2020-09-03T21:54:40Z" level=debug msg="cache key: edge_path_/_1599170080 current: 3"- name: SPIRE_PATH
value: "/run/spire/socket/agent.sock"volumes:
- name: spire-socket
hostPath:
path: /run/spire/socket
type: DirectoryOrCreatevolumeMounts:
- name: spire-socket
mountPath: /run/spire/socket
readOnly: false"secret": {
"secret_key": "{service-name}-secret",
"secret_name": "spiffe://quickstart.greymatter.io/{service-name}",
"secret_validation_name": "spiffe://quickstart.greymatter.io",
"subject_names": [
"spiffe://quickstart.greymatter.io/edge"
],
"ecdh_curves": [
"X25519:P-256:P-521:P-384"
]
}"secret": {
"secret_key": "secret-edge-secret",
"secret_name": "spiffe://quickstart.greymatter.io/edge",
"secret_validation_name": "spiffe://quickstart.greymatter.io",
"subject_names": [
"spiffe://quickstart.greymatter.io/{service-name}"
],
"ecdh_curves": [
"X25519:P-256:P-521:P-384"
]
}kubectl exec -it data-internal-0 -c data-internal -- /bin/shopenssl s_client --connect {IP}:10808openssl s_client --connect {IP}:10808 | openssl x509 -text --nooutgreymatter edit proxy proxy-example "active_proxy_filters": [
"gm.metrics",
"gm.observables"
], "gm_observables": {
"emitFullResponse": false,
"useKafka": false,
"topic": "proxy-example",
"eventTopic": "proxy-example-topic",
"kafkaZKDiscover": false,
"kafkaServerConnection": ""
}docker logs -f gmfabric_example-proxy_1global.rbac.edge to false. This turns off the default RBAC configuration and allows for more granular RBAC rules at the service level.require_tlssidecarOverview of how Grey Matter handles audits and observables.
eksctl create cluster \
--name production \
--version 1.17 \
--nodegroup-name workers \
--node-type m4.2xlarge \
--nodes=2 \
--node-ami auto \
--region us-east-1 \
--zones us-east-1a,us-east-1b \
--profile default[ℹ] using region us-east-1
[ℹ] subnets for us-east-1a - public:192.168.0.0/19 private:192.168.64.0/19
[ℹ] subnets for us-east-1b - public:192.168.32.0/19 private:192.168.96.0/19
[ℹ] nodegroup "workers" will use "ami-0d373fa5015bc43be" [AmazonLinux2/1.15]
[ℹ] using Kubernetes version 1.15
[ℹ] creating EKS cluster "production" in "us-east-1" region
[ℹ] will create 2 separate CloudFormation stacks for cluster itself and the initial nodegroup
[ℹ] if you encounter any issues, check CloudFormation console or try 'eksctl utils describe-stacks --region=us-east-1 --name=production'
[ℹ] CloudWatch logging will not be enabled for cluster "production" in "us-east-1"
[ℹ] you can enable it with 'eksctl utils update-cluster-logging --region=us-east-1 --name=production'
[ℹ] 2 sequential tasks: { create cluster control plane "production", create nodegroup "workers" }
[ℹ] building cluster stack "eksctl-production-cluster"
[ℹ] deploying stack "eksctl-production-cluster"
[ℹ] building nodegroup stack "eksctl-production-nodegroup-workers"
[ℹ] --nodes-min=2 was set automatically for nodegroup workers
[ℹ] --nodes-max=2 was set automatically for nodegroup workers
[ℹ] deploying stack "eksctl-production-nodegroup-workers"
[✔] all EKS cluster resource for "production" had been created
[✔] saved kubeconfig as "/home/user/.kube/config"
[ℹ] adding role "arn:aws:iam::828920212949:role/eksctl-production-nodegroup-worke-NodeInstanceRole-EJWJY28O2JJ" to auth ConfigMap
[ℹ] nodegroup "workers" has 0 node(s)
[ℹ] waiting for at least 2 node(s) to become ready in "workers"
[ℹ] nodegroup "workers" has 2 node(s)
[ℹ] node "ip-192-168-29-248.ec2.internal" is ready
[ℹ] node "ip-192-168-36-13.ec2.internal" is ready
[ℹ] kubectl command should work with "/home/user/.kube/config", try 'kubectl get nodes'
[✔] EKS cluster "production" in "us-east-1" region is readyeksctl get cluster --region us-east-1 --profile default
eksctl get nodegroup --region us-east-1 --profile default --cluster productiongit clone --single-branch --branch release-2.2 https://github.com/greymatter-io/helm-charts.git && cd ./helm-chartsCloning into 'helm-charts'...
remote: Enumerating objects: 337, done.
remote: Counting objects: 100% (337/337), done.
remote: Compressing objects: 100% (210/210), done.
remote: Total 4959 (delta 225), reused 143 (delta 126), pack-reused 4622
Receiving objects: 100% (4959/4959), 1.09 MiB | 2.50 MiB/s, done.
Resolving deltas: 100% (3637/3637), done.make credentials./ci/scripts/build-credentials.sh
decipher email:
first.lastname@company.io
password:
Do you wish to configure S3 credentials for gm-data backing [yn] n
Setting S3 to false
"decipher" has been added to your repositoriesError: looks like "https://nexus.greymatter.io/repository/helm" is not a valid chart repository or cannot be reached: failed to fetch https://nexus.greymatter.io/repository/helm/index.yaml : 401 Unauthorized helm dep up spire
helm dep up edge
helm dep up data
helm dep up fabric
helm dep up sense
make secrets
helm install server spire/server -f global.yaml kubectl get pod -n spire -w NAME READY STATUS RESTARTS AGE
server-0 2/2 Running 1 30s$ kubectl get svc edge
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
edge LoadBalancer 10.100.197.77 a2832d300724811eaac960a7ca83e992-749721369.us-east-1.elb.amazonaws.com 10808:32623/TCP,8081:31433/TCP 2m4sexport GREYMATTER_API_HOST=<EDGE-EXTERNAL-IP>:10808
export GREYMATTER_API_PREFIX=/services/control-api/latest
export GREYMATTER_API_SSL=true
export GREYMATTER_API_INSECURE=true
export GREYMATTER_API_SSLCERT=</path/to/helm-charts>/certs/quickstart.crt
export GREYMATTER_API_SSLKEY=</path/to/helm-charts>/certs/quickstart.key
export EDITOR=vim # or your preferred editormake uninstalleksctl delete cluster --name production[ℹ] using region us-east-1
[ℹ] deleting EKS cluster "production"
[✔] kubeconfig has been updated
[ℹ] cleaning up LoadBalancer services
[ℹ] 2 sequential tasks: { delete nodegroup "workers", delete cluster control plane "prod" [async] }
[ℹ] will delete stack "eksctl-production-nodegroup-workers"
[ℹ] waiting for stack "eksctl-production-nodegroup-workers" to get deleted
[ℹ] will delete stack "eksctl-production-cluster"
[✔] all cluster resources were deleted helm install agent spire/agent -f global.yaml
helm install fabric fabric --set=global.environment=eks -f global.yaml
helm install edge edge --set=global.environment=eks --set=edge.ingress.type=LoadBalancer -f global.yaml
helm install data data --set=global.environment=eks --set=global.waiter.service_account.create=false -f global.yaml
helm install sense sense --set=global.environment=eks --set=global.waiter.service_account.create=false -f global.yaml kubectl get pods NAME READY STATUS RESTARTS AGE
catalog-5b54979554-hs98q 2/2 Running 2 91s
catalog-init-k29j2 0/1 Completed 0 91s
control-887b76d54-gbtq4 1/1 Running 0 18m
control-api-0 2/2 Running 0 18m
control-api-init-6nk2f 0/1 Completed 0 18m
dashboard-7847d5b9fd-t5lr7 2/2 Running 0 91s
data-0 2/2 Running 0 17m
data-internal-0 2/2 Running 0 17m
data-mongo-0 1/1 Running 0 17m
edge-6f8cdcd8bb-plqsj 1/1 Running 0 18m
internal-data-mongo-0 1/1 Running 0 17m
internal-jwt-security-dd788459d-jt7rk 2/2 Running 2 17m
internal-redis-5f7c4c7697-6mmtv 1/1 Running 0 17m
jwt-security-859d474bc6-hwhbr 2/2 Running 2 17m
postgres-slo-0 1/1 Running 0 91s
prometheus-0 2/2 Running 0 59s
redis-5f5c68c467-j5mwt 1/1 Running 0 17m
slo-7c475d8597-7gtfq 2/2 Running 0 91s---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: fibonacci
greymatter.io/control: fibonacci
name: fibonacci
spec:
replicas: 1
selector:
matchLabels:
app: fibonacci
greymatter.io/control: fibonacci
template:
metadata:
labels:
app: fibonacci
greymatter.io/control: fibonacci
spec:
containers:
- name: fibonacci
image: docker.greymatter.io/internal/fibonacci:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
- name: sidecar
image: "docker.greymatter.io/release/gm-proxy:1.4.5"
imagePullPolicy: IfNotPresent
ports:
- name: metrics
containerPort: 8081
- name: proxy
containerPort: 10808
env:
- name: ENVOY_ADMIN_LOG_PATH
value: "/dev/stdout"
- name: PROXY_DYNAMIC
value: "true"
- name: SPIRE_PATH
value: "/run/spire/socket/agent.sock"
- name: XDS_CLUSTER
value: "fibonacci"
- name: XDS_HOST
value: "control.default.svc"
- name: XDS_NODE_ID
value: "default"
- name: XDS_PORT
value: "50000"
- name: XDS_ZONE
value: "zone-default-zone"
volumeMounts:
- name: spire-socket
mountPath: /run/spire/socket
readOnly: false
imagePullSecrets:
- name: docker.secret
volumes:
- name: spire-socket
hostPath:
path: /run/spire/socket
type: DirectoryOrCreatekubectl apply -f deployment.yaml{
"zone_key": "zone-default-zone",
"domain_key": "fibonacci-domain",
"name": "*",
"port": 10808,
"force_https": true
}greymatter create domain < domain.json{
"zone_key": "zone-default-zone",
"listener_key": "fibonacci-listener",
"domain_keys": [
"fibonacci-domain"
],
"name": "ingress",
"ip": "0.0.0.0",
"port": 10808,
"protocol": "http_auto",
"secret": {
"secret_key": "fibonacci.identity",
"secret_name": "spiffe://quickstart.greymatter.io/fibonacci",
"secret_validation_name": "spiffe://quickstart.greymatter.io",
"subject_names": [
"spiffe://quickstart.greymatter.io/edge"
],
"ecdh_curves": [
"X25519:P-256:P-521:P-384"
]
}
}greymatter create listener < listener.json{
"zone_key": "zone-default-zone",
"proxy_key": "fibonacci-proxy",
"domain_keys": [
"fibonacci-domain"
],
"listener_keys": [
"fibonacci-listener"
],
"name": "fibonacci",
"listeners": null
}greymatter create proxy < proxy.json{
"zone_key": "zone-default-zone",
"cluster_key": "fibonacci-cluster",
"name": "local",
"instances": [
{
"host": "localhost",
"port": 8080
}
],
"require_tls": false
}greymatter create cluster < fibonacci-local-cluster.json{
"zone_key": "zone-default-zone",
"shared_rules_key": "fibonacci-local-rules",
"name": "local",
"default": {
"light": [
{
"constraint_key": "",
"cluster_key": "fibonacci-cluster",
"metadata": null,
"properties": null,
"response_data": {},
"weight": 1
}
],
"dark": null,
"tap": null
}
}greymatter create shared_rules < fibonacci-local-rules.json{
"zone_key": "zone-default-zone",
"domain_key": "fibonacci-domain",
"route_key": "fibonacci-local-route",
"path": "/",
"prefix_rewrite": "",
"shared_rules_key": "fibonacci-local-rules"
}greymatter create route < fibonacci-local-route.json{
"zone_key": "zone-default-zone",
"cluster_key": "edge-to-fibonacci-cluster",
"name": "fibonacci",
"instances": [],
"require_tls": true,
"secret": {
"secret_key": "edge.identity",
"secret_name": "spiffe://quickstart.greymatter.io/edge",
"secret_validation_name": "spiffe://quickstart.greymatter.io",
"subject_names": [
"spiffe://quickstart.greymatter.io/fibonacci"
],
"ecdh_curves": [
"X25519:P-256:P-521:P-384"
]
}
}greymatter create cluster < edge-to-fibonacci-cluster.json{
"zone_key": "zone-default-zone",
"shared_rules_key": "edge-to-fibonacci-rules",
"name": "edge-to-fibonacci",
"default": {
"light": [
{
"constraint_key": "",
"cluster_key": "edge-to-fibonacci-cluster",
"metadata": null,
"properties": null,
"response_data": {},
"weight": 1
}
],
"dark": null,
"tap": null
}
}greymatter create shared_rules < edge-to-fibonacci-rules.json{
"zone_key": "zone-default-zone",
"domain_key": "edge",
"route_key": "edge-to-fibonacci-route",
"path": "/services/fibonacci",
"prefix_rewrite": "/",
"shared_rules_key": "edge-to-fibonacci-rules"
}{
"zone_key": "zone-default-zone",
"domain_key": "edge",
"route_key": "edge-to-fibonacci-route-slash",
"path": "/services/fibonacci/",
"prefix_rewrite": "/",
"shared_rules_key": "edge-to-fibonacci-rules"
}greymatter create route < edge-to-fibonacci-route.json
greymatter create route < edge-to-fibonacci-route-slash.jsonkubectl get svc edge{
"clusterName": "fibonacci",
"zoneName": "zone-default-zone",
"name": "Fibonacci",
"version": "1.0",
"owner": "Decipher",
"capability": "Tutorial",
"runtime": "GO",
"documentation": "/services/fibonacci/",
"prometheusJob": "fibonacci",
"minInstances": 1,
"maxInstances": 2,
"authorized": true,
"enableInstanceMetrics": true,
"enableHistoricalMetrics": true,
"metricsPort": 8081
}curl -k -XPOST --cert <path>/<to>/<certs>/quickstart.crt --key <path>/<to>/<certs>/quickstart.key https:///{your-gm-ingress-url}:{your-gm-ingress-port}/services/catalog/latest/clusters -d "@fibonacci-catalog.json"{"added": "fibonacci"}tar -xvzf greymatter-v1.4.2.tar.gzx ./greymatter.linux
x ./greymatter.exe
x ./greymatter.osx
...sudo mv ./greymatter.linux /usr/bin/greymattercurl https://nexus.greymatter.io/repository/raw/release/gm-cli/greymatter-v1.4.2.tar.gz -u user.name@organization.com > greymatter-v1.4.2.tar.gz$ greymatter --version
Grey Matter CLI
Command Name: greymatter
Version: v1.4.2
Branch: release-1.4
Commit: 455e5fc
Built: Wed, 08 Jul 2020 18:47:07 UTC by justincely
Grey Matter Control API
Version: v1.4.2-devexport GREYMATTER_API_HOST=services.greymatter.io:443
export GREYMATTER_API_PREFIX=/services/control-api/latest
export GREYMATTER_API_SSL=true
export GREYMATTER_API_INSECURE=true
export GREYMATTER_API_SSLCERT=/path/to/my.crt
export GREYMATTER_API_SSLKEY=/path/to/my.key
export EDITOR=vim # or your preferred editor greymatter create --api.host=services.greymatter.io:443 --api.prefix=/services/control-api/latest --api.ssl=true route < route.json$ greymatter list zone
[
{
"zone_key": "zone-default-zone",
"name": "default-zone",
"checksum": "6883b95eb2dbd05e15c54fcd0e5414bcb5a6aee1d3b91ab2d1c6493e4945ff74"
}
]---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: simple-service
greymatter.io/control: simple-service
name: simple-service
spec:
replicas: 1
selector:
matchLabels:
app: simple-service
greymatter.io/control: simple-service
template:
metadata:
labels:
app: simple-service
greymatter.io/control: simple-service
spec:
containers:
- name: service
image: "zoemccormick/simple-service:latest"
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
env:
- name: EGRESS_ROUTE
value: http://localhost:10909/catalog/summary
- name: sidecar
image: "docker.greymatter.io/release/gm-proxy:1.4.5"
imagePullPolicy: IfNotPresent
ports:
- name: metrics
containerPort: 8081
- name: proxy
containerPort: 10808
env:
- name: ENVOY_ADMIN_LOG_PATH
value: "/dev/stdout"
- name: PROXY_DYNAMIC
value: "true"
- name: SPIRE_PATH
value: "/run/spire/socket/agent.sock"
- name: XDS_CLUSTER
value: "simple-service"
- name: XDS_HOST
value: "control.default.svc"
- name: XDS_NODE_ID
value: "default"
- name: XDS_PORT
value: "50000"
- name: XDS_ZONE
value: "zone-default-zone"
volumeMounts:
- name: spire-socket
mountPath: /run/spire/socket
readOnly: false
imagePullSecrets:
- name: docker.greymatter.io
volumes:
- name: spire-socket
hostPath:
path: /run/spire/socket
type: DirectoryOrCreatekubectl apply -f deployment.yaml{
"zone_key": "zone-default-zone",
"domain_key": "simple-service-domain",
"name": "*",
"port": 10808,
"force_https": true
}greymatter create domain < ingress-domain.json{
"zone_key": "zone-default-zone",
"listener_key": "simple-service-listener",
"domain_keys": [
"simple-service-domain"
],
"name": "ingress",
"ip": "0.0.0.0",
"port": 10808,
"protocol": "http_auto",
"secret": {
"secret_key": "simple-service.identity",
"secret_name": "spiffe://quickstart.greymatter.io/simple-service",
"secret_validation_name": "spiffe://quickstart.greymatter.io",
"subject_names": [
"spiffe://quickstart.greymatter.io/edge"
],
"ecdh_curves": [
"X25519:P-256:P-521:P-384"
]
}
}greymatter create listener < ingress-listener.json{
"zone_key": "zone-default-zone",
"proxy_key": "simple-service-proxy",
"domain_keys": [
"simple-service-domain"
],
"listener_keys": [
"simple-service-listener"
],
"name": "simple-service",
"listeners": null
}greymatter create proxy < proxy.json{
"zone_key": "zone-default-zone",
"cluster_key": "edge-to-simple-service-cluster",
"name": "simple-service",
"instances": [],
"require_tls": true,
"secret": {
"secret_key": "edge.identity",
"secret_name": "spiffe://quickstart.greymatter.io/edge",
"secret_validation_name": "spiffe://quickstart.greymatter.io",
"subject_names": [
"spiffe://quickstart.greymatter.io/simple-service"
],
"ecdh_curves": [
"X25519:P-256:P-521:P-384"
]
}
}{
"zone_key": "zone-default-zone",
"cluster_key": "simple-service-cluster",
"name": "service",
"instances": [
{
"host": "localhost",
"port": 8080
}
],
"require_tls": false
}greymatter create cluster < edge-to-simple-service-cluster.json
greymatter create cluster < simple-service-cluster.json{
"zone_key": "zone-default-zone",
"shared_rules_key": "edge-to-simple-service-rules",
"name": "edge-to-simple-service",
"default": {
"light": [
{
"constraint_key": "",
"cluster_key": "edge-to-simple-service-cluster",
"metadata": null,
"properties": null,
"response_data": {},
"weight": 1
}
],
"dark": null,
"tap": null
}
}{
"zone_key": "zone-default-zone",
"shared_rules_key": "simple-service-rules",
"name": "service",
"default": {
"light": [
{
"constraint_key": "",
"cluster_key": "simple-service-cluster",
"metadata": null,
"properties": null,
"response_data": {},
"weight": 1
}
],
"dark": null,
"tap": null
}
}greymatter create cluster < edge-to-simple-service-rules.json
greymatter create cluster < simple-service-rules.json{
"zone_key": "zone-default-zone",
"domain_key": "edge",
"route_key": "edge-to-simple-service-route",
"path": "/services/simple-service/",
"prefix_rewrite": "/",
"shared_rules_key": "edge-to-simple-service-rules"
}{
"zone_key": "zone-default-zone",
"domain_key": "edge",
"route_key": "edge-to-simple-service-route-slash",
"path": "/services/simple-service",
"prefix_rewrite": "/services/simple-service/",
"shared_rules_key": "edge-to-simple-service-rules"
}{
"zone_key": "zone-default-zone",
"domain_key": "simple-service-domain",
"route_key": "simple-service-route",
"path": "/",
"prefix_rewrite": "",
"shared_rules_key": "simple-service-rules"
}greymatter create route < edge-route.json
greymatter create route < edge-route-slash.json
greymatter create route < service-route.json{
"zone_key": "zone-default-zone",
"domain_key": "simple-service-domain-egress",
"name": "*",
"port": 10909,
"force_https": false,
"custom_headers": [
{
"key": "x-forwarded-proto",
"value": "https"
}
]
}greymatter create domain < egress-domain.json{
"zone_key": "zone-default-zone",
"listener_key": "simple-service-listener-egress",
"domain_keys": [
"simple-service-domain-egress"
],
"name": "egress",
"ip": "0.0.0.0",
"port": 10909,
"protocol": "http_auto"
}greymatter create listener < egress-listener.json{
"zone_key": "zone-default-zone",
"cluster_key": "simple-service-to-catalog-cluster",
"name": "catalog",
"instances": [],
"require_tls": true,
"secret": {
"secret_key": "simple-service.identity",
"secret_name": "spiffe://quickstart.greymatter.io/simple-service",
"secret_validation_name": "spiffe://quickstart.greymatter.io",
"subject_names": [
"spiffe://quickstart.greymatter.io/catalog"
],
"ecdh_curves": [
"X25519:P-256:P-521:P-384"
]
}
}greymatter create cluster < simple-service-to-catalog-cluster.json{
"zone_key": "zone-default-zone",
"shared_rules_key": "simple-service-to-catalog-rules",
"name": "simple-service-to-catalog",
"default": {
"light": [
{
"constraint_key": "",
"cluster_key": "simple-service-to-catalog-cluster",
"metadata": null,
"properties": null,
"response_data": {},
"weight": 1
}
],
"dark": null,
"tap": null
}
}greymatter create shared_rules < simple-service-to-catalog-rules.json{
"zone_key": "zone-default-zone",
"domain_key": "simple-service-domain-egress",
"route_key": "simple-service-to-catalog-egress-route",
"path": "/catalog/",
"prefix_rewrite": "/",
"shared_rules_key": "simple-service-to-catalog-rules"
}greymatter create route < simple-service-to-catalog-route.jsongreymatter edit listener listener-catalog "subject_names": [
"spiffe://quickstart.greymatter.io/edge",
"spiffe://quickstart.greymatter.io/simple-service"
],greymatter edit proxy simple-service-proxy{
"zone_key": "zone-default-zone",
"proxy_key": "simple-service-proxy",
"domain_keys": [
"simple-service-domain",
"simple-service-domain-egress"
],
"listener_keys": [
"simple-service-listener",
"simple-service-listener-egress"
],
"name": "simple-service",
"listeners": null
}apiVersion: v1
kind: Service
metadata:
name: jaeger
labels:
app: jaeger
spec:
ports:
- port: 9411
targetPort: 9411
name: trace
- port: 16686
targetPort: 16686
name: ui
selector:
app: jaeger
type: NodePort
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jaeger
spec:
selector:
matchLabels:
app: jaeger
replicas: 1
template:
metadata:
labels:
app: jaeger
spec:
containers:
- name: jaeger
image: jaegertracing/all-in-one
imagePullPolicy: Always
ports:
- name: trace
containerPort: 9411
- name: ui
containerPort: 16686
env:
- name: COLLECTOR_ZIPKIN_HTTP_PORT
value: "9411"
- name: QUERY_BASE_PATH
value: "/apps/trace"
- name: LOG_LEVEL
value: "debug"kubectl apply -f ./jaeger.yamlkubectl edit deployment edge- name: TRACING_ENABLED
value: "true"
- name: TRACING_ADDRESS
value: "jaeger"
- name: TRACING_PORT
value: "9411"greymatter edit listener edge-listener"tracing_config": {
"ingress": true
}kubectl logs -f jaeger-5dc85d4bbd-7whzl{"level":"debug","ts":1588867245.6727643,"caller":"handler/thrift_span_handler.go:130","msg":"Zipkin span batch processed by the collector.","span-count":1}
{"level":"debug","ts":1588867245.6729214,"caller":"app/span_processor.go:148","msg":"Span written to the storage by the collector","trace-id":"e6681bca2d0b0bac","span-id":"e6681bca2d0b0bac"}
{"level":"debug","ts":1588867250.6756654,"caller":"handler/thrift_span_handler.go:130","msg":"Zipkin span batch processed by the collector.","span-count":1}
{"level":"debug","ts":1588867250.6758242,"caller":"app/span_processor.go:148","msg":"Span written to the storage by the collector","trace-id":"25cb6d784522de88","span-id":"25cb6d784522de88"}
{"level":"debug","ts":1588867255.6768801,"caller":"handler/thrift_span_handler.go:130","msg":"Zipkin span batch processed by the collector.","span-count":1}
{"level":"debug","ts":1588867255.67703,"caller":"app/span_processor.go:148","msg":"Span written to the storage by the collector","trace-id":"615a316d024c403c","span-id":"615a316d024c403c"}
{"level":"debug","ts":1588867260.6802413,"caller":"handler/thrift_span_handler.go:130","msg":"Zipkin span batch processed by the collector.","span-count":1}kubectl port-forward $(kubectl get pod | grep jaeger | cut -d" " -f1) 16686gm-control <command> --helpGM_CONTROL_<COMMAND>_<FLAG>--namespacekubernetesGM_CONTROL_KUBERNETES_NAMESPACE{your-gm-ingress-url}./services/fibonacci/1.0/) then a missing route configuration is the most likely cause. Check that the response from control when you did your greymatter create route < 2_sidecar/route.json looks correct. - EMIT_EVENTS=true
- EMIT_FULL_RESPONSE=true
- USE_KAFKA=true
- ENFORCE_AUDIT=true
- KAFKA_TOPIC="hello-service-tests"
- KAFKA_ENABLED=true
- OBS_ENFORCE=true
- OBS_ENABLED=true
- OBS_FULL_RESPONSE=true
- KAFKA_ZK_DISCOVER=true
- INHEADERS_ENABLED=truekafka:
hostname: kafka
image: wurstmeister/kafka:0.10.2.1
networks:
- mesh
environment:
- KAFKA_HEAP_OPTS="-Xmx1G -Xms500M"
- KAFKA_ADVERTISED_HOST=kafka
- KAFKA_ADVERTISED_PORT=9092
- KAFKA_ZOOKEEPER_CONNECT=zk
- KAFKA_CREATE_TOPICS=hello-service-tests
ports:
- "22181:2181"
- "29092:9092"
- "9092:9092"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- zk{
"action": "GET",
"eventChain": [
"9308cf66-8218-11e9-a159-0242ac1c0005"
],
"eventId": "9308cf66-8218-11e9-a159-0242ac1c0005",
"eventType": "",
"originatorToken": null,
"payload": {
"isSuccessful": true,
"request": {
"endpoint": "/services/hello-service/0.1/",
"headers": {
":authority": "localhost:8080",
":method": "GET",
":path": "/services/hello-service/0.1/",
"accept": "*/*",
"user-agent": "curl/7.54.0",
"x-envoy-internal": "true",
"x-forwarded-for": "172.28.0.1",
"x-forwarded-proto": "https",
"x-request-id": "d9e69795-3fc8-41c3-a0f2-7775822340c5"
}
},
"response": {
"body": "Hello World!",
"code": 200,
"headers": {
":status": "200",
"content-length": "12",
"content-type": "text/html; charset=utf-8",
"date": "Wed, 29 May 2019 13:49:26 GMT",
"server": "envoy",
"x-envoy-upstream-service-time": "7"
}
}
},
"schemaVersion": "1.0",
"systemIp": "172.28.0.5",
"timestamp": 1559137766,
"xForwardedForIp": "172.28.0.1"
}kafka-console-consumer --bootstrap-server localhost:9092 --topic hello-service-tests --from-beginning{
"eventId":"a83bd73a-afc2-11e9-bf98-0242ac130006",
"eventChain":[
"a83bd73a-afc2-11e9-bf98-0242ac130006"
],
"schemaVersion":"1.0",
"originatorToken":[
"CN=localuser,OU=Engineering,O=Decipher Technology Studios,=Alexandria,=Virginia,C=US",
"",
"CN=localuser,OU=Engineering,O=Decipher Technology Studios,=Alexandria,=Virginia,C=US"
],
"eventType":"",
"timestamp":1564158619,
"xForwardedForIp":"172.19.0.1,172.19.0.1,172.19.0.6",
"systemIp":"172.19.0.6",
"action":"GET",
"payload":{
"isSuccessful":true,
"request":{
"endpoint":"/",
"headers":{
":authority":"localhost:8080",
":method":"GET",
":path":"/",
"accept":"*/*",
"content-length":"0",
"external_sys_dn":"",
"ssl_client_s_dn":"CN=localuser,OU=Engineering,O=Decipher Technology Studios,=Alexandria,=Virginia,C=US",
"user-agent":"curl/7.54.0",
"user_dn":"CN=localuser,OU=Engineering,O=Decipher Technology Studios,=Alexandria,=Virginia,C=US",
"x-envoy-external-address":"172.19.0.6",
"x-envoy-original-path":"/services/hello-service/0.1/",
"x-forwarded-for":"172.19.0.1,172.19.0.1,172.19.0.6",
"x-forwarded-proto":"https",
"x-real-ip":"172.19.0.1",
"x-request-id":"9bbada13-3916-43c2-a59d-f1076a373a19"
}
},
"response":{
"code":200,
"headers":{
":status":"200",
"content-length":"12",
"content-type":"text/html; charset=utf-8",
"date":"Fri, 26 Jul 2019 16:30:19 GMT",
"server":"Werkzeug/0.15.5 Python/3.6.6",
"x-envoy-upstream-service-time":"6"
},
"body":"Hello World!"
}
}
}{
"_index": "audit",
"_type": "_doc",
"_id": "FvUJ2GsBQetsYfWuW1Ab",
"_score": 1,
"_source": {
"eventId": "00f4b3e4-a279-11e9-b433-0a580a82025d",
"eventChain": [
"00f4b3e4-a279-11e9-b433-0a580a82025d"
],
"schemaVersion": "1.0",
"originatorToken": [
"cn=minos.kepheus, dc=hellas, dc=com",
"CN=*.greymatter.svc.cluster.local,OU=Engineering,O=Decipher Technology Studios,=Alexandria,=Virginia,C=US",
"CN=*.greymatter.svc.cluster.local,OU=Engineering,O=Decipher Technology Studios,=Alexandria,=Virginia,C=US"
],
"eventType": "fibonacci",
"timestamp": 1562697620,
"xForwardedForIp": "15.188.27.135,10.129.2.140",
"systemIp": "10.130.2.93",
"action": "GET",
"payload": {
"isSuccessful": true,
"request": {
"endpoint": "/fibonacci/18",
"headers": {
":authority": "demo-oauth.production.deciphernow.com",
":method": "GET",
":path": "/fibonacci/18",
"accept-encoding": "gzip",
"content-length": "0",
"cookie": "OauthExpires=1562757619; OauthSignature=0OgHLzHBxSUdNk557aKWeYW9jrg; OauthUserDN=cn%3Dminos.kepheus%2C+dc%3Dhellas%2C+dc%3Dcom",
"external_sys_dn": "CN=*.greymatter.svc.cluster.local,OU=Engineering,O=Decipher Technology Studios,=Alexandria,=Virginia,C=US",
"forwarded": "for=15.188.27.135;host=demo-oauth.production.deciphernow.com;proto=https;proto-version=",
"ssl_client_s_dn": "CN=*.greymatter.svc.cluster.local,OU=Engineering,O=Decipher Technology Studios,=Alexandria,=Virginia,C=US",
"user-agent": "Go-http-client/1.1",
"user_dn": "cn=minos.kepheus, dc=hellas, dc=com",
"x-envoy-original-path": "/services/fibonacci/1.0.0/fibonacci/18",
"x-forwarded-for": "15.188.27.135,10.129.2.140",
"x-forwarded-host": "demo-oauth.production.deciphernow.com",
"x-forwarded-port": "443",
"x-forwarded-proto": "https",
"x-real-ip": "10.129.2.140",
"x-request-id": "234aff6f-e376-41d5-89b8-1aa6dd0bbf4f"
}
},
"response": {
"code": 200,
"headers": {
":status": "200",
"content-length": "5",
"content-type": "text/plain; charset=utf-8",
"date": "Tue, 09 Jul 2019 18:40:20 GMT",
"x-envoy-upstream-service-time": "0"
},
"body": "2584\n"
}
},
"event_mapping": {
"type": "EventAccess",
"action": "ACCESS"
},
"time_audited": "20190709T184020.249380",
"geo_ip": {
"accuracy_radius": 1000,
"latitude": 48.8607,
"longitude": 2.3281,
"time_zone": "Europe/Paris"
},
"location": {
"lat": 48.8607,
"lon": 2.3281
}
},
"fields": {
"payload.response.headers.date": [
"2019-07-09T18:40:20.000Z"
],
"time_audited": [
"2019-07-09T18:40:20.249Z"
]
}
}greymatter edit listener fibonacci-listener "active_http_filters": [
"gm.observables"
],
"http_filters": {
"gm_observables": {
"topic": "fibonacci-topic",
"eventTopic": "fibonacci-event-topic",
"logLevel": "debug"
}
}6:05PM DBG Message publishing to STDOUT; emitFullResponse = false
Encryption= EncryptionKeyID=0 Filter=Observables Topic=fibonacci-topic{
"zone_key": "zone-default-zone",
"domain_key": "fibonacci-domain",
"route_key": "fibonacci-route-37",
"route_match": {
"path": "/fibonacci/37",
"match_type": "exact"
},
"filter_metadata": {
"gm.observables": [
{
"key": "emitFullResponse",
"value": "true"
}
]
},
"prefix_rewrite": "",
"shared_rules_key": "fibonacci-rules"
}greymatter create route < mesh/fibonacci-route-37.json6:46PM DBG Message publishing to STDOUT; emitFullResponse = false
Encryption= EncryptionKeyID=0 Filter=Observables Topic=fibonacci-topic6:47PM DBG DecodeHeaders: route based config: changing emitFullResponse from false to true Encryption= EncryptionKeyID=0 Filter=Observables Topic=fibonacci-topic
6:47PM DBG Message publishing to STDOUT; emitFullResponse = true
Encryption= EncryptionKeyID=0 Filter=Observables Topic=fibonacci-topic{
"circuit_breakers": {
"max_connections": 500
}
}greymatter get cluster cluster-slo-service > cluster-slo-service.json
jq -s '.[0] * .[1]' cluster-slo-service.json update.json > merged.json
# this is what will be appplied
cat merged.json
...
# try applying the change
greymatter edit cluster cluster-slo-service < merged.json#!/bin/sh
for key in $(greymatter list cluster | jq -r '.[] | .cluster_key'); do
greymatter get cluster $key > $key.json
jq -s '.[0] * .[1]' $key.json update.json > merged.json
greymatter edit cluster $key < merged.json
rm $key.json merged.json
done{
"active_proxy_filters": [
"gm.metrics",
"gm.observables"
],
"proxy_filters": {
"gm_observables": {
"emitFullResponse": true,
"useKafka": true,
"eventTopic": "observables",
"enforceAudit": false,
"kafkaZKDiscover": false,
"topic": "__REPLACE_WITH_TOPIC_NAME__",
"kafkaServerConnection": "kafka-default.fabric.svc:9092"
}
}
}#!/bin/sh
for key in $(greymatter list proxy | jq -r '.[] | .proxy_key'); do
greymatter get proxy $key > $key.json
# fill in topic name with the name of the proxy
name=$(cat $key.json | jq -r '.name')
sed 's/__REPLACE_WITH_TOPIC_NAME__/'"$name"'/g' update.json > update-$key.json
jq -s '.[0] * .[1]' $key.json update-$key.json > merged.json
greymatter edit proxy $key < merged.json
rm $key.json merged.json update-$key.json
done#!/bin/sh
for key in $(greymatter list proxy | jq -r '.[] | .proxy_key'); do
greymatter get proxy $key > $key.json
matches=$(cat $key.json | jq '.proxy_filters.gm_observables.eventTopic == "fabric"')
if [ $matches = "true" ]; then
jq -s '.[0] * .[1]' $key.json update.json > merged.json
greymatter edit proxy $key < merged.json
fi
rm -rf $key.json merged.json
done{
"health_checks": [
{
"timeout_msec": 1000,
"interval_msec": 60000,
"interval_jitter_msec": 1000,
"unhealthy_threshold": 3,
"healthy_threshold": 3
}
]
}{
"outlier_detection": {
"consecutive_5xx": 3,
"base_ejection_time_msec": 30000
}
}#!/bin/sh
for key in $(greymatter list cluster | jq -r '.[] | .cluster_key'); do
greymatter get cluster $key > $key.json
jq -s '.[0] * .[1]' $key.json update.json > $key-merged.json
greymatter edit cluster $key < $key-merged.json
rm $key.json $key-merged.json
done#!/bin/sh
for key in $(greymatter list cluster | jq -r '.[] | .cluster_key'); do
greymatter get cluster $key > $key.json
GREYMATTER_CONSOLE_LEVEL="none"
possibleOutlier=$(cat $key.json | jq '.name == "" or .zone_key == "" or .instances == []')
if [ $possibleOutlier = "true" ]; then
echo "------ POSSIBLY UNNEEDED ------ $key "
else
echo "--------------OK -------------- $key "
fi
rm -rf $key.json merged.json
done{"GET": "ACCESS",
"POST": "CREATE",
"DELETE": "REMOVE",
"PUT": "MODIFY"}EVENT_TYPE_MAPPINGS:
GET:
- uri: "/activities"
eventType: "EventSearchQry"
POST:
- uri: "/analyses/pos"
eventType: "EventAccess"my-service::default_priority::max_connections::1024
my-service::default_priority::max_pending_requests::1024
my-service::default_priority::max_requests::1024
my-service::default_priority::max_retries::3
my-service::high_priority::max_connections::1024
my-service::high_priority::max_pending_requests::1024
my-service::high_priority::max_requests::1024
my-service::high_priority::max_retries::3
my-service::added_via_api::true$ ./gm-control aws --help
NAME
aws - aws collector
USAGE
gm-control [GLOBAL OPTIONS] aws [OPTIONS]
VERSION
1.0.3-dev
DESCRIPTION
Connects to the AWS API in a given region and updates Clusters stored in the Greymatter API at startup and periodically thereafter.
EC2 instance tags are used to determine to which clusters an instance belongs. An EC2 instance may belong to multiple clusters, serving traffic on multiple ports. Cluster membership on a port is declared with a tag, of the form:
"<namespace>:<cluster-name>:<port>"=""
The port must be numeric, and the cluster name cannot contain the delimiter. The delimiter is ":" and the default namespace is "gm:cluster".
Tags of the following form will be added to the Instance in the appropriate Cluster, as "<key>"="<value>":
"<namespace>:<cluster-name>:<port>:<key>"="<value>"
If key/value tags are included, the cluster membership tag is optional.
Tags without the namespaced cluster/port prefix will be added to all Instances in all Clusters to which the EC2 Instance belongs.
By default, all EC2 Instances in the VPC are examined, but additional filters can be specified (see -filters).
Additionally, by default if AWS credentials are not passed via cli then the AWS's Go SDK will fall back to its default credential chain. This first pulls from the environment then falls back to the task role and finally the instance profile role.
GLOBAL OPTIONS
--api.header=header
Specifies a custom header to send with every gm-control request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--api.host=host:port
(default: localhost:80)
The address (host:port) for gm-control requests. If no port is given, it defaults to port 443 if --api.ssl is true and port 80 otherwise.
--api.insecure
(default: false)
If true, don't validate server cert when using SSL for gm-control requests
--api.key=string
(default: "none")
[SENSITIVE] The auth key for gm-control requests
--api.prefix=value
The url prefix for gm-control requests. Forms the path part of <host>:<port><path>
--api.ssl
(default: true)
If true, use SSL for gm-control requests
--api.sslCert=value
Specifies the SSL cert to use for every gm-control request.
--api.sslKey=value
Specifies the SSL key to use for every gm-control request.
--api.zone-name=string
The name of the API Zone for gm-control requests.
--console.level=level
(default: "info")
(valid values: "debug", "info", "error", or "none")
Selects the log level for console logs messages.
--delay=duration
(default: 30s)
Sets the minimum time between API updates. If the discovery data changes more frequently than this duration, updates are delayed to maintain the minimum time.
--diff.dry-run
(default: false)
Log changes at the info level rather than submitting them to the API
--diff.ignore-create
(default: false)
If true, do not create new Clusters in the API
--diff.include-delete
(default: false)
If true, delete missing Clusters from the API
--help (default: false)
Show a list of commands or help for one command
--stats.api.header=header
Specifies a custom header to send with every stats API request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--stats.api.host=host:port
(default: localhost:80)
The address (host:port) for stats API requests. If no port is given, it defaults to port 443 if --stats.api.ssl is true and port 80 otherwise.
--stats.api.insecure
(default: false)
If true, don't validate server cert when using SSL for stats API requests
--stats.api.prefix=value
The url prefix for stats API requests. Forms the path part of <host>:<port><path>
--stats.api.ssl
(default: true)
If true, use SSL for stats API requests
--stats.api.sslCert=value
Specifies the SSL cert to use for every stats API request.
--stats.api.sslKey=value
Specifies the SSL key to use for every stats API request.
--stats.backends=value
(valid values: "dogstatsd", "prometheus", "statsd", or "wavefront")
Selects which stats backend(s) to use.
--stats.batch
(default: true)
If true, stats requests are batched together for performance.
--stats.dogstatsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.dogstatsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.dogstatsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.dogstatsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.dogstatsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.dogstatsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.dogstatsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.dogstatsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.dogstatsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.dogstatsd.scope=string
If specified, prepends the given scope to metric names.
--stats.dogstatsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.event-backends=value
(valid values: "console" or "honeycomb")
Selects which stats backend(s) to use for structured events.
--stats.exec.attempt-timeout=duration
(default: 1s)
Specifies the default timeout for individual action attempts. A timeout of 0 means no timeout.
--stats.exec.delay=duration
(default: 100ms)
Specifies the initial delay for the exponential delay type. Specifies the delay for constant delay type.
--stats.exec.delay-type=value
(default: "exponential")
(valid values: "constant" or "exponential")
Specifies the retry delay type.
--stats.exec.max-attempts=int
(default: 8)
Specifies the maximum number of attempts made, inclusive of the original attempt.
--stats.exec.max-delay=duration
(default: 30s)
Specifies the maximum delay for the exponential delay type. Ignored for the constant delay type.
--stats.exec.parallelism=int
(default: 8)
Specifies the maximum number of concurrent attempts running.
--stats.exec.timeout=duration
(default: 10s)
Specifies the default timeout for actions. A timeout of 0 means no timeout.
--stats.honeycomb.api-host=string
(default: "https://api.honeycomb.io")
The Honeycomb API host to send messages to
--stats.honeycomb.batchSize=uint
(default: 50)
The Honeycomb batch size to use
--stats.honeycomb.dataset=string
They Honeycomb dataset to send messages to.
--stats.honeycomb.sample-rate=uint
(default: 1)
The Honeycomb sample rate to use. Specified as 1 event sent per Sample Rate
--stats.honeycomb.write-key=string
They Honeycomb write key used to send messages.
--stats.max-batch-delay=duration
(default: 1s)
If batching is enabled, the maximum amount of time requests are held before transmission
--stats.max-batch-size=int
(default: 100)
If batching is enabled, the maximum number of requests that will be combined.
--stats.node=string
If set, specifies the node to use when submitting stats to backends. Equivalent to adding "--stats.tags=node=value" to the command line.
--stats.prometheus.addr=value
(default: 0.0.0.0:9102)
Specifies the listener address for Prometheus scraping.
--stats.prometheus.scope=string
If specified, prepends the given scope to metric names.
--stats.source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. In either case, a UUID is appended to the value to insure that it is unique across proxies. Cannot be combined
with --stats.unique-source.
--stats.statsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.statsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.statsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.statsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.statsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.statsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.statsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.statsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.statsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.statsd.scope=string
If specified, prepends the given scope to metric names.
--stats.statsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.tags=value
Tags to be included with every stat. May be comma-delimited or specified more than once. Should be of the form "<key>=<value>" or "tag"
--stats.unique-source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. Unlike --stats.source, failing to specify a unique value may prevent stats from being recorded correctly. Cannot
be combined with --stats.source.
--stats.wavefront.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.wavefront.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.wavefront.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.wavefront.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.wavefront.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.wavefront.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.wavefront.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.wavefront.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.wavefront.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.wavefront.scope=string
If specified, prepends the given scope to metric names.
--stats.wavefront.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--version
(default: false)
Print the version and exit
--xds.addr=value
(default: :50000)
The address on which to serve the envoy API server.
--xds.ads-enabled
(default: true)
If false, turn off ads discovery mode
--xds.ca-file=string
Path to a file (on the Envoy host's file system) containing CA certificates for TLS.
--xds.default-timeout=duration
(default: 1m0s)
The default request timeout, if none is specified in the RetryPolicy for a Route
--xds.disabled
(default: false)
Disables the xDS listener.
--xds.enable-tls
(default: false)
Enable grpc xDS TLS
--xds.grpc-log-top=int
(default: 0)
When gRPC logging is enabled and this value is greater than 1, logs of non-success Envoy responses are tracked and periodically reported. This flag controls how many unique response code & request path combinations are tracked. When the number of
tracked combinations in the reporting period is exceeded, uncommon paths are evicted.
--xds.grpc-log-top-interval=duration
(default: 5m0s)
See the grpc-log-top flag. Controls the interval at which top logs are generated.
--xds.interval=duration
(default: 1s)
The interval for polling the Greymatter API. Minimium value is 500ms
--xds.resolve-dns
(default: true)
If true, resolve EDS hostnames to IP addresses.
--xds.server-auth-type=string
TLS client authentication type
--xds.server-cert=string
URL containing the server certificate for the grpc ADS server
--xds.server-key=string
URL containing the server certificate key for the grpc ADS server
--xds.server-trusts=string
Comma-delimited URLs containing truststores for the grpc ADS server
--xds.standalone-cluster=string
(default: "default-cluster")
The name of the cluster for the Envoys consuming the standalone xDS server. Should match the --service-cluster flag for the envoy binary, or the ENVOY_NODE_CLUSTER value for the envoy-simple Docker image.
--xds.standalone-port=int
(default: 80)
The port on which Envoys consuming the standalone xDS server should listen. Ignored if --api.key is specified.
--xds.standalone-zone=string
(default: "default-zone")
The name of the zone for the Envoys consuming the standalone xDS server. Should match the --service-zone flag for the envoy binary, or the ENVOY_NODE_ZONE value for the envoy-simple Docker image.
--xds.static-resources.conflict-behavior=value
(default: "merge")
(valid values: "overwrite" or "merge")
How to handle conflicts between configuration types. If "overwrite" configuration types overwrite defaults. For example, if one were to include "listeners" in the static resources configuration file, all existing listeners would be overwritten. If the
value is "merge", listeners would be merged together, with collisions favoring the statically configured listener. Clusters are differentiated by name, while listeners are differentiated by IP/port. Listeners on 0.0.0.0 (or ::) on a given port will
collide with any other IP with the same port. Specifying colliding static resources will produce a startup error.
--xds.static-resources.filename=string
Path to a file containing static resources. The contents of the file should be either a JSON or YAML fragment (as configured by the corresponding --format flag) containing any combination of "clusters" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/cluster.proto), "cluster_template" (a single cluster, which will be used as the prototype for all clusters not specified statically), and/or listeners" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/listener.proto). The file is read once at startup. Only the v2 API is parsed. Enum strings such as "ROUND_ROBIN" must be capitalized.
--xds.static-resources.format=value
(default: "yaml")
(valid values: "json" or "yaml")
The format of the static resources file
Global options can also be configured via upper-case, underscore-delimited environment variables prefixed with "GM_CONTROL_". For example, "--some-flag" becomes "GM_CONTROL_SOME_FLAG". Command-line flags take precedence over environment variables.
OPTIONS
--aws.access-key-id=string
[SENSITIVE] The AWS API access key ID
--aws.region=string
[REQUIRED] The AWS region in which the binary is running
--aws.secret-access-key=string
[SENSITIVE] The AWS API secret access key
--cluster-tag-namespace=string
(default: "gm:cluster")
The namespace for cluster tags
--filters="<key>=<value>,..."
A comma-delimited list of key/value pairs, used to specify additional EC2 Instances filters. Of the form "<key>=<value>,...". See http://goo.gl/kSCOHS for a discussion of available filters.
--help (default: false)
Show a list of commands or help for one command
--version
(default: false)
Print the version and exit
--vpc-id=string
[REQUIRED] The ID of the VPC in which gm-control is running
Options can also be configured via upper-case, underscore-delimited environment variables prefixed with "GM_CONTROL_AWS_". For example, "--some-flag" becomes "GM_CONTROL_AWS_SOME_FLAG". Command-line flags take precedence over environment variables.package envoy.authz # Use envoy package
import input.attributes.request.http as http_request # Shorten HTTP request info as 'http_request'
default allow = true # Initialize allow variable, allow requests by default
allow = false { # Do not allow HTTP requests with that are true of all the conditions set in 'action_denied'
action_denied
}
action_denied { # If all of the conditions in this block are true, block the request. If any of these conditions are false, don't block request
any({http_request.method == "PUT", http_request.method == "POST"}) # If request method is PUT or POST
input.parsed_body.threshold < 20 # If threshold is less than
input.parsed_body.threshold != null # When threshold is set to nothing
input.parsed_body.metricKey == "mem" # Ensuring its a memory value
input.parsed_body.operator == "gte" # If greater than or equal operator
}kubectl create secret generic opa-policy --from-file slo-policy.regokubectl get deployment -o yaml slo > slo.yaml spec:
containers:
- name: opa
image: openpolicyagent/opa:latest-istio
volumeMounts:
- readOnly: true
mountPath: /policy
name: opa-policy
args:
- "run"
- "--server"
- "--addr=localhost:8181"
- "--log-level=debug"
- "--diagnostic-addr=0.0.0.0:8282"
- "--set=plugins.envoy_ext_authz_grpc.addr=:9191"
- "--set=plugins.envoy_ext_authz_grpc.query=data.envoy.authz.allow"
- "--set=decision_logs.console=true"
- "--ignore=.*"
- "/policy/slo-policy.rego" volumes:
- name: opa-policy
secret:
secretName: opa-policykubectl apply -f ./slo.yamlgreymatter edit listener listener-slo "active_http_filters": [
"gm.metrics",
"envoy.ext_authz"
],
"http_filters": {
"envoy_ext_authz": {
"with_request_body": {
"max_request_bytes": 8192,
"allow_partial_message": true
},
"failure_mode_allow": false,
"grpc_service": {
"google_grpc": {
"target_uri": "127.0.0.1:9191",
"stat_prefix": "ext_authz"
},
"timeout": "10s"
}
},$ gm-control
NAME
gm-control - Collects cluster instance data and updates the Greymatter API. A variety of service discovery backends are supported via sub-commands, each with their own configuration options. The file collector can be used as a bridge for unsupported backends.
USAGE
gm-control [GLOBAL OPTIONS] <command> [COMMAND OPTIONS] [arguments...]
VERSION
1.0.3-dev
COMMANDS
aws aws collector
consul Consul collector
exp-envoy-cds-v1
envoy CDS v1 collector [EXPERIMENTAL]
exp-envoy-cds-v1-file
envoy CDS v1 file collector [EXPERIMENTAL]
exp-envoy-cds-v2
envoy CDS v2 collector [EXPERIMENTAL]
file file-based collector
kubernetes
kubernetes collector
marathon
marathon collector
xds-only
Run the collector as only an xDS server and request logging sink.
GLOBAL OPTIONS
--api.header=header
Specifies a custom header to send with every gm-control request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--api.host=host:port
(default: localhost:80)
The address (host:port) for gm-control requests. If no port is given, it defaults to port 443 if --api.ssl is true and port 80 otherwise.
--api.insecure
(default: false)
If true, don't validate server cert when using SSL for gm-control requests
--api.key=string
(default: "none")
[SENSITIVE] The auth key for gm-control requests
--api.prefix=value
The url prefix for gm-control requests. Forms the path part of <host>:<port><path>
--api.ssl
(default: true)
If true, use SSL for gm-control requests
--api.sslCert=value
Specifies the SSL cert to use for every gm-control request.
--api.sslKey=value
Specifies the SSL key to use for every gm-control request.
--api.zone-name=string
The name of the API Zone for gm-control requests.
--console.level=level
(default: "info")
(valid values: "debug", "info", "error", or "none")
Selects the log level for console logs messages.
--delay=duration
(default: 30s)
Sets the minimum time between API updates. If the discovery data changes more frequently than this duration, updates are delayed to maintain the minimum time.
--diff.dry-run
(default: false)
Log changes at the info level rather than submitting them to the API
--diff.ignore-create
(default: false)
If true, do not create new Clusters in the API
--diff.include-delete
(default: false)
If true, delete missing Clusters from the API
--help (default: false)
Show a list of commands or help for one command
--stats.api.header=header
Specifies a custom header to send with every stats API request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--stats.api.host=host:port
(default: localhost:80)
The address (host:port) for stats API requests. If no port is given, it defaults to port 443 if --stats.api.ssl is true and port 80 otherwise.
--stats.api.insecure
(default: false)
If true, don't validate server cert when using SSL for stats API requests
--stats.api.prefix=value
The url prefix for stats API requests. Forms the path part of <host>:<port><path>
--stats.api.ssl
(default: true)
If true, use SSL for stats API requests
--stats.api.sslCert=value
Specifies the SSL cert to use for every stats API request.
--stats.api.sslKey=value
Specifies the SSL key to use for every stats API request.
--stats.backends=value
(valid values: "dogstatsd", "prometheus", "statsd", or "wavefront")
Selects which stats backend(s) to use.
--stats.batch
(default: true)
If true, stats requests are batched together for performance.
--stats.dogstatsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.dogstatsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.dogstatsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.dogstatsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.dogstatsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.dogstatsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.dogstatsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.dogstatsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.dogstatsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.dogstatsd.scope=string
If specified, prepends the given scope to metric names.
--stats.dogstatsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.event-backends=value
(valid values: "console" or "honeycomb")
Selects which stats backend(s) to use for structured events.
--stats.exec.attempt-timeout=duration
(default: 1s)
Specifies the default timeout for individual action attempts. A timeout of 0 means no timeout.
--stats.exec.delay=duration
(default: 100ms)
Specifies the initial delay for the exponential delay type. Specifies the delay for constant delay type.
--stats.exec.delay-type=value
(default: "exponential")
(valid values: "constant" or "exponential")
Specifies the retry delay type.
--stats.exec.max-attempts=int
(default: 8)
Specifies the maximum number of attempts made, inclusive of the original attempt.
--stats.exec.max-delay=duration
(default: 30s)
Specifies the maximum delay for the exponential delay type. Ignored for the constant delay type.
--stats.exec.parallelism=int
(default: 8)
Specifies the maximum number of concurrent attempts running.
--stats.exec.timeout=duration
(default: 10s)
Specifies the default timeout for actions. A timeout of 0 means no timeout.
--stats.honeycomb.api-host=string
(default: "https://api.honeycomb.io")
The Honeycomb API host to send messages to
--stats.honeycomb.batchSize=uint
(default: 50)
The Honeycomb batch size to use
--stats.honeycomb.dataset=string
They Honeycomb dataset to send messages to.
--stats.honeycomb.sample-rate=uint
(default: 1)
The Honeycomb sample rate to use. Specified as 1 event sent per Sample Rate
--stats.honeycomb.write-key=string
They Honeycomb write key used to send messages.
--stats.max-batch-delay=duration
(default: 1s)
If batching is enabled, the maximum amount of time requests are held before transmission
--stats.max-batch-size=int
(default: 100)
If batching is enabled, the maximum number of requests that will be combined.
--stats.node=string
If set, specifies the node to use when submitting stats to backends. Equivalent to adding "--stats.tags=node=value" to the command line.
--stats.prometheus.addr=value
(default: 0.0.0.0:9102)
Specifies the listener address for Prometheus scraping.
--stats.prometheus.scope=string
If specified, prepends the given scope to metric names.
--stats.source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. In either case, a UUID is appended to the value to insure that it is unique across proxies. Cannot be combined
with --stats.unique-source.
--stats.statsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.statsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.statsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.statsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.statsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.statsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.statsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.statsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.statsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.statsd.scope=string
If specified, prepends the given scope to metric names.
--stats.statsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.tags=value
Tags to be included with every stat. May be comma-delimited or specified more than once. Should be of the form "<key>=<value>" or "tag"
--stats.unique-source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. Unlike --stats.source, failing to specify a unique value may prevent stats from being recorded correctly. Cannot
be combined with --stats.source.
--stats.wavefront.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.wavefront.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.wavefront.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.wavefront.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.wavefront.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.wavefront.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.wavefront.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.wavefront.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.wavefront.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.wavefront.scope=string
If specified, prepends the given scope to metric names.
--stats.wavefront.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--version
(default: false)
Print the version and exit
--xds.addr=value
(default: :50000)
The address on which to serve the envoy API server.
--xds.ads-enabled
(default: true)
If false, turn off ads discovery mode
--xds.ca-file=string
Path to a file (on the Envoy host's file system) containing CA certificates for TLS.
--xds.default-timeout=duration
(default: 1m0s)
The default request timeout, if none is specified in the RetryPolicy for a Route
--xds.disabled
(default: false)
Disables the xDS listener.
--xds.enable-tls
(default: false)
Enable grpc xDS TLS
--xds.grpc-log-top=int
(default: 0)
When gRPC logging is enabled and this value is greater than 1, logs of non-success Envoy responses are tracked and periodically reported. This flag controls how many unique response code & request path combinations are tracked. When the number of
tracked combinations in the reporting period is exceeded, uncommon paths are evicted.
--xds.grpc-log-top-interval=duration
(default: 5m0s)
See the grpc-log-top flag. Controls the interval at which top logs are generated.
--xds.interval=duration
(default: 1s)
The interval for polling the Greymatter API. Minimium value is 500ms
--xds.resolve-dns
(default: true)
If true, resolve EDS hostnames to IP addresses.
--xds.server-auth-type=string
TLS client authentication type
--xds.server-cert=string
URL containing the server certificate for the grpc ADS server
--xds.server-key=string
URL containing the server certificate key for the grpc ADS server
--xds.server-trusts=string
Comma-delimited URLs containing truststores for the grpc ADS server
--xds.standalone-cluster=string
(default: "default-cluster")
The name of the cluster for the Envoys consuming the standalone xDS server. Should match the --service-cluster flag for the envoy binary, or the ENVOY_NODE_CLUSTER value for the envoy-simple Docker image.
--xds.standalone-port=int
(default: 80)
The port on which Envoys consuming the standalone xDS server should listen. Ignored if --api.key is specified.
--xds.standalone-zone=string
(default: "default-zone")
The name of the zone for the Envoys consuming the standalone xDS server. Should match the --service-zone flag for the envoy binary, or the ENVOY_NODE_ZONE value for the envoy-simple Docker image.
--xds.static-resources.conflict-behavior=value
(default: "merge")
(valid values: "overwrite" or "merge")
How to handle conflicts between configuration types. If "overwrite" configuration types overwrite defaults. For example, if one were to include "listeners" in the static resources configuration file, all existing listeners would be overwritten. If the
value is "merge", listeners would be merged together, with collisions favoring the statically configured listener. Clusters are differentiated by name, while listeners are differentiated by IP/port. Listeners on 0.0.0.0 (or ::) on a given port will
collide with any other IP with the same port. Specifying colliding static resources will produce a startup error.
--xds.static-resources.filename=string
Path to a file containing static resources. The contents of the file should be either a JSON or YAML fragment (as configured by the corresponding --format flag) containing any combination of "clusters" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/cluster.proto), "cluster_template" (a single cluster, which will be used as the prototype for all clusters not specified statically), and/or listeners" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/listener.proto). The file is read once at startup. Only the v2 API is parsed. Enum strings such as "ROUND_ROBIN" must be capitalized.
--xds.static-resources.format=value
(default: "yaml")
(valid values: "json" or "yaml")
The format of the static resources file
Global options can also be configured via upper-case, underscore-delimited environment variables prefixed with "GM_CONTROL_". For example, "--some-flag" becomes "GM_CONTROL_SOME_FLAG". Command-line flags take precedence over environment variables.
Run "gm-control help <command>" for more details on a specific command.Installation of greymatter v1.4.2 successful. To make this your default version, run 'gmenv use 1.4.2'Switching default version to v1.4.2
Switching completed






/app $ curl -X POST localhost:8001/logging
active loggers:
admin: info
assert: info
backtrace: info
client: info
config: info
connection: info
dubbo: info
file: info
filter: debug
grpc: info
hc: info
health_checker: info
http: info
http2: info
hystrix: info
lua: info
main: info
misc: info
mongo: info
quic: info
pool: info
rbac: info
redis: info
router: info
runtime: info
stats: info
secret: info
tap: info
testing: info
thrift: info
tracing: info
upstream: info$ ./gm-control consul --help
NAME
consul - Consul collector
USAGE
gm-control [GLOBAL OPTIONS] consul [OPTIONS]
VERSION
1.0.3-dev
DESCRIPTION
Connects to a Consul agent via HTTP API and updates Clusters stored in the Greymatter API at startup and periodically thereafter.
A service is marked for import using tags, by default "gm-cluster" is used but it may be customized through the command line (see --cluster-tag). Each identified service will be imported as a Greymatter Cluster and the nodes that are marked with the configured
tag are added as instances for that Cluster. For each instance within a Cluster, metadata is populated from a combination of service tags, node metadata, service metadata and health checks.
Service Tags
Service tags, excluding the cluster tag itself, are added with a "tag:" prefix. By default, they are treated as single value entries and are imported with empty values. The --tag-delimiter flag can be used to treat tags as key value pairs, and they will be
parsed as such. Tags that have the delimiter as a suffix or that do not contain it at all are added with empty values, while tags that use it as a prefix are ignored and logged.
Node Metadata
Node metadata is added as instance metadata with a "node:" prefix for each key.
Service Metadata
Service metadata is passed through and is added as instance metadata without any namespacing.
Health Checks
Node health checks will be added as instance metadata named following the pattern "check:<check-id>" with the check status as value. Additionally "node-health" is added for an instance within each cluster to aggregate all the other health checks on that node
that either are 1) not bound to a service or 2) bound to the service this cluster represents. The value for this aggregate metadata will be:
passing if all Consul health checks have a "passing" value
mixed if any Consul health check has a "passing" value
failed if no Consul health check has the value of "passing"
GLOBAL OPTIONS
--api.header=header
Specifies a custom header to send with every gm-control request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--api.host=host:port
(default: localhost:80)
The address (host:port) for gm-control requests. If no port is given, it defaults to port 443 if --api.ssl is true and port 80 otherwise.
--api.insecure
(default: false)
If true, don't validate server cert when using SSL for gm-control requests
--api.key=string
(default: "none")
[SENSITIVE] The auth key for gm-control requests
--api.prefix=value
The url prefix for gm-control requests. Forms the path part of <host>:<port><path>
--api.ssl
(default: true)
If true, use SSL for gm-control requests
--api.sslCert=value
Specifies the SSL cert to use for every gm-control request.
--api.sslKey=value
Specifies the SSL key to use for every gm-control request.
--api.zone-name=string
The name of the API Zone for gm-control requests.
--console.level=level
(default: "info")
(valid values: "debug", "info", "error", or "none")
Selects the log level for console logs messages.
--delay=duration
(default: 30s)
Sets the minimum time between API updates. If the discovery data changes more frequently than this duration, updates are delayed to maintain the minimum time.
--diff.dry-run
(default: false)
Log changes at the info level rather than submitting them to the API
--diff.ignore-create
(default: false)
If true, do not create new Clusters in the API
--diff.include-delete
(default: false)
If true, delete missing Clusters from the API
--help (default: false)
Show a list of commands or help for one command
--stats.api.header=header
Specifies a custom header to send with every stats API request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--stats.api.host=host:port
(default: localhost:80)
The address (host:port) for stats API requests. If no port is given, it defaults to port 443 if --stats.api.ssl is true and port 80 otherwise.
--stats.api.insecure
(default: false)
If true, don't validate server cert when using SSL for stats API requests
--stats.api.prefix=value
The url prefix for stats API requests. Forms the path part of <host>:<port><path>
--stats.api.ssl
(default: true)
If true, use SSL for stats API requests
--stats.api.sslCert=value
Specifies the SSL cert to use for every stats API request.
--stats.api.sslKey=value
Specifies the SSL key to use for every stats API request.
--stats.backends=value
(valid values: "dogstatsd", "prometheus", "statsd", or "wavefront")
Selects which stats backend(s) to use.
--stats.batch
(default: true)
If true, stats requests are batched together for performance.
--stats.dogstatsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.dogstatsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.dogstatsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.dogstatsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.dogstatsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.dogstatsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.dogstatsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.dogstatsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.dogstatsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.dogstatsd.scope=string
If specified, prepends the given scope to metric names.
--stats.dogstatsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.event-backends=value
(valid values: "console" or "honeycomb")
Selects which stats backend(s) to use for structured events.
--stats.exec.attempt-timeout=duration
(default: 1s)
Specifies the default timeout for individual action attempts. A timeout of 0 means no timeout.
--stats.exec.delay=duration
(default: 100ms)
Specifies the initial delay for the exponential delay type. Specifies the delay for constant delay type.
--stats.exec.delay-type=value
(default: "exponential")
(valid values: "constant" or "exponential")
Specifies the retry delay type.
--stats.exec.max-attempts=int
(default: 8)
Specifies the maximum number of attempts made, inclusive of the original attempt.
--stats.exec.max-delay=duration
(default: 30s)
Specifies the maximum delay for the exponential delay type. Ignored for the constant delay type.
--stats.exec.parallelism=int
(default: 8)
Specifies the maximum number of concurrent attempts running.
--stats.exec.timeout=duration
(default: 10s)
Specifies the default timeout for actions. A timeout of 0 means no timeout.
--stats.honeycomb.api-host=string
(default: "https://api.honeycomb.io")
The Honeycomb API host to send messages to
--stats.honeycomb.batchSize=uint
(default: 50)
The Honeycomb batch size to use
--stats.honeycomb.dataset=string
They Honeycomb dataset to send messages to.
--stats.honeycomb.sample-rate=uint
(default: 1)
The Honeycomb sample rate to use. Specified as 1 event sent per Sample Rate
--stats.honeycomb.write-key=string
They Honeycomb write key used to send messages.
--stats.max-batch-delay=duration
(default: 1s)
If batching is enabled, the maximum amount of time requests are held before transmission
--stats.max-batch-size=int
(default: 100)
If batching is enabled, the maximum number of requests that will be combined.
--stats.node=string
If set, specifies the node to use when submitting stats to backends. Equivalent to adding "--stats.tags=node=value" to the command line.
--stats.prometheus.addr=value
(default: 0.0.0.0:9102)
Specifies the listener address for Prometheus scraping.
--stats.prometheus.scope=string
If specified, prepends the given scope to metric names.
--stats.source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. In either case, a UUID is appended to the value to insure that it is unique across proxies. Cannot be combined
with --stats.unique-source.
--stats.statsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.statsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.statsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.statsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.statsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.statsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.statsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.statsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.statsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.statsd.scope=string
If specified, prepends the given scope to metric names.
--stats.statsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.tags=value
Tags to be included with every stat. May be comma-delimited or specified more than once. Should be of the form "<key>=<value>" or "tag"
--stats.unique-source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. Unlike --stats.source, failing to specify a unique value may prevent stats from being recorded correctly. Cannot
be combined with --stats.source.
--stats.wavefront.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.wavefront.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.wavefront.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.wavefront.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.wavefront.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.wavefront.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.wavefront.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.wavefront.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.wavefront.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.wavefront.scope=string
If specified, prepends the given scope to metric names.
--stats.wavefront.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--version
(default: false)
Print the version and exit
--xds.addr=value
(default: :50000)
The address on which to serve the envoy API server.
--xds.ads-enabled
(default: true)
If false, turn off ads discovery mode
--xds.ca-file=string
Path to a file (on the Envoy host's file system) containing CA certificates for TLS.
--xds.default-timeout=duration
(default: 1m0s)
The default request timeout, if none is specified in the RetryPolicy for a Route
--xds.disabled
(default: false)
Disables the xDS listener.
--xds.enable-tls
(default: false)
Enable grpc xDS TLS
--xds.grpc-log-top=int
(default: 0)
When gRPC logging is enabled and this value is greater than 1, logs of non-success Envoy responses are tracked and periodically reported. This flag controls how many unique response code & request path combinations are tracked. When the number of
tracked combinations in the reporting period is exceeded, uncommon paths are evicted.
--xds.grpc-log-top-interval=duration
(default: 5m0s)
See the grpc-log-top flag. Controls the interval at which top logs are generated.
--xds.interval=duration
(default: 1s)
The interval for polling the Greymatter API. Minimium value is 500ms
--xds.resolve-dns
(default: true)
If true, resolve EDS hostnames to IP addresses.
--xds.server-auth-type=string
TLS client authentication type
--xds.server-cert=string
URL containing the server certificate for the grpc ADS server
--xds.server-key=string
URL containing the server certificate key for the grpc ADS server
--xds.server-trusts=string
Comma-delimited URLs containing truststores for the grpc ADS server
--xds.standalone-cluster=string
(default: "default-cluster")
The name of the cluster for the Envoys consuming the standalone xDS server. Should match the --service-cluster flag for the envoy binary, or the ENVOY_NODE_CLUSTER value for the envoy-simple Docker image.
--xds.standalone-port=int
(default: 80)
The port on which Envoys consuming the standalone xDS server should listen. Ignored if --api.key is specified.
--xds.standalone-zone=string
(default: "default-zone")
The name of the zone for the Envoys consuming the standalone xDS server. Should match the --service-zone flag for the envoy binary, or the ENVOY_NODE_ZONE value for the envoy-simple Docker image.
--xds.static-resources.conflict-behavior=value
(default: "merge")
(valid values: "overwrite" or "merge")
How to handle conflicts between configuration types. If "overwrite" configuration types overwrite defaults. For example, if one were to include "listeners" in the static resources configuration file, all existing listeners would be overwritten. If the
value is "merge", listeners would be merged together, with collisions favoring the statically configured listener. Clusters are differentiated by name, while listeners are differentiated by IP/port. Listeners on 0.0.0.0 (or ::) on a given port will
collide with any other IP with the same port. Specifying colliding static resources will produce a startup error.
--xds.static-resources.filename=string
Path to a file containing static resources. The contents of the file should be either a JSON or YAML fragment (as configured by the corresponding --format flag) containing any combination of "clusters" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/cluster.proto), "cluster_template" (a single cluster, which will be used as the prototype for all clusters not specified statically), and/or listeners" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/listener.proto). The file is read once at startup. Only the v2 API is parsed. Enum strings such as "ROUND_ROBIN" must be capitalized.
--xds.static-resources.format=value
(default: "yaml")
(valid values: "json" or "yaml")
The format of the static resources file
Global options can also be configured via upper-case, underscore-delimited environment variables prefixed with "GM_CONTROL_". For example, "--some-flag" becomes "GM_CONTROL_SOME_FLAG". Command-line flags take precedence over environment variables.
OPTIONS
--cluster-tag=string
(default: "gm-cluster")
The tag used to indicate that a service should be imported as a Cluster. If used in conjunction with 'tag-delimiter' its value can be used to override the cluster name from the default value of the name of the service in consul.
--console.level=level
(default: "info")
(valid values: "debug", "info", "error", or "none")
Selects the log level for console logs messages.
--dc=string
[REQUIRED] Collect Consul services only from this DC.
--help (default: false)
Show a list of commands or help for one command
--hostport=[host]:port
(default: "localhost:8500")
The [host]:port for the Consul API.
--tag-delimiter=string
The delimiter used to split key/value pairs stored in Consul service tags.
--use-ssl
(default: false)
If set will instruct communications to the Consul API to be done via SSL.
--version
(default: false)
Print the version and exit
Options can also be configured via upper-case, underscore-delimited environment variables prefixed with "GM_CONTROL_CONSUL_". For example, "--some-flag" becomes "GM_CONTROL_CONSUL_SOME_FLAG". Command-line flags take precedence over environment variables.$ gm-control xds-only --help
NAME
xds-only - Run the collector as only an xDS server and request logging sink.
USAGE
gm-control [GLOBAL OPTIONS] xds-only
VERSION
1.0.3-dev
DESCRIPTION
Run the collector as only an xDS server and request logging sink. Commonly used when running a pool of gm-control as standalone xDS servers, or when co-locating gm-control as an xDS sidecar.
GLOBAL OPTIONS
--api.header=header
Specifies a custom header to send with every gm-control request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--api.host=host:port
(default: localhost:80)
The address (host:port) for gm-control requests. If no port is given, it defaults to port 443 if --api.ssl is true and port 80 otherwise.
--api.insecure
(default: false)
If true, don't validate server cert when using SSL for gm-control requests
--api.key=string
(default: "none")
[SENSITIVE] The auth key for gm-control requests
--api.prefix=value
The url prefix for gm-control requests. Forms the path part of <host>:<port><path>
--api.ssl
(default: true)
If true, use SSL for gm-control requests
--api.sslCert=value
Specifies the SSL cert to use for every gm-control request.
--api.sslKey=value
Specifies the SSL key to use for every gm-control request.
--api.zone-name=string
The name of the API Zone for gm-control requests.
--console.level=level
(default: "info")
(valid values: "debug", "info", "error", or "none")
Selects the log level for console logs messages.
--delay=duration
(default: 30s)
Sets the minimum time between API updates. If the discovery data changes more frequently than this duration, updates are delayed to maintain the minimum time.
--diff.dry-run
(default: false)
Log changes at the info level rather than submitting them to the API
--diff.ignore-create
(default: false)
If true, do not create new Clusters in the API
--diff.include-delete
(default: false)
If true, delete missing Clusters from the API
--help (default: false)
Show a list of commands or help for one command
--stats.api.header=header
Specifies a custom header to send with every stats API request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--stats.api.host=host:port
(default: localhost:80)
The address (host:port) for stats API requests. If no port is given, it defaults to port 443 if --stats.api.ssl is true and port 80 otherwise.
--stats.api.insecure
(default: false)
If true, don't validate server cert when using SSL for stats API requests
--stats.api.prefix=value
The url prefix for stats API requests. Forms the path part of <host>:<port><path>
--stats.api.ssl
(default: true)
If true, use SSL for stats API requests
--stats.api.sslCert=value
Specifies the SSL cert to use for every stats API request.
--stats.api.sslKey=value
Specifies the SSL key to use for every stats API request.
--stats.backends=value
(valid values: "dogstatsd", "prometheus", "statsd", or "wavefront")
Selects which stats backend(s) to use.
--stats.batch
(default: true)
If true, stats requests are batched together for performance.
--stats.dogstatsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.dogstatsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.dogstatsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.dogstatsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.dogstatsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.dogstatsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.dogstatsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.dogstatsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.dogstatsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.dogstatsd.scope=string
If specified, prepends the given scope to metric names.
--stats.dogstatsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.event-backends=value
(valid values: "console" or "honeycomb")
Selects which stats backend(s) to use for structured events.
--stats.exec.attempt-timeout=duration
(default: 1s)
Specifies the default timeout for individual action attempts. A timeout of 0 means no timeout.
--stats.exec.delay=duration
(default: 100ms)
Specifies the initial delay for the exponential delay type. Specifies the delay for constant delay type.
--stats.exec.delay-type=value
(default: "exponential")
(valid values: "constant" or "exponential")
Specifies the retry delay type.
--stats.exec.max-attempts=int
(default: 8)
Specifies the maximum number of attempts made, inclusive of the original attempt.
--stats.exec.max-delay=duration
(default: 30s)
Specifies the maximum delay for the exponential delay type. Ignored for the constant delay type.
--stats.exec.parallelism=int
(default: 8)
Specifies the maximum number of concurrent attempts running.
--stats.exec.timeout=duration
(default: 10s)
Specifies the default timeout for actions. A timeout of 0 means no timeout.
--stats.honeycomb.api-host=string
(default: "https://api.honeycomb.io")
The Honeycomb API host to send messages to
--stats.honeycomb.batchSize=uint
(default: 50)
The Honeycomb batch size to use
--stats.honeycomb.dataset=string
They Honeycomb dataset to send messages to.
--stats.honeycomb.sample-rate=uint
(default: 1)
The Honeycomb sample rate to use. Specified as 1 event sent per Sample Rate
--stats.honeycomb.write-key=string
They Honeycomb write key used to send messages.
--stats.max-batch-delay=duration
(default: 1s)
If batching is enabled, the maximum amount of time requests are held before transmission
--stats.max-batch-size=int
(default: 100)
If batching is enabled, the maximum number of requests that will be combined.
--stats.node=string
If set, specifies the node to use when submitting stats to backends. Equivalent to adding "--stats.tags=node=value" to the command line.
--stats.prometheus.addr=value
(default: 0.0.0.0:9102)
Specifies the listener address for Prometheus scraping.
--stats.prometheus.scope=string
If specified, prepends the given scope to metric names.
--stats.source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. In either case, a UUID is appended to the value to insure that it is unique across proxies. Cannot be combined
with --stats.unique-source.
--stats.statsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.statsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.statsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.statsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.statsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.statsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.statsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.statsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.statsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.statsd.scope=string
If specified, prepends the given scope to metric names.
--stats.statsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.tags=value
Tags to be included with every stat. May be comma-delimited or specified more than once. Should be of the form "<key>=<value>" or "tag"
--stats.unique-source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. Unlike --stats.source, failing to specify a unique value may prevent stats from being recorded correctly. Cannot
be combined with --stats.source.
--stats.wavefront.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.wavefront.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.wavefront.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.wavefront.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.wavefront.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.wavefront.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.wavefront.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.wavefront.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.wavefront.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.wavefront.scope=string
If specified, prepends the given scope to metric names.
--stats.wavefront.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--version
(default: false)
Print the version and exit
--xds.addr=value
(default: :50000)
The address on which to serve the envoy API server.
--xds.ads-enabled
(default: true)
If false, turn off ads discovery mode
--xds.ca-file=string
Path to a file (on the Envoy host's file system) containing CA certificates for TLS.
--xds.default-timeout=duration
(default: 1m0s)
The default request timeout, if none is specified in the RetryPolicy for a Route
--xds.disabled
(default: false)
Disables the xDS listener.
--xds.enable-tls
(default: false)
Enable grpc xDS TLS
--xds.grpc-log-top=int
(default: 0)
When gRPC logging is enabled and this value is greater than 1, logs of non-success Envoy responses are tracked and periodically reported. This flag controls how many unique response code & request path combinations are tracked. When the number of
tracked combinations in the reporting period is exceeded, uncommon paths are evicted.
--xds.grpc-log-top-interval=duration
(default: 5m0s)
See the grpc-log-top flag. Controls the interval at which top logs are generated.
--xds.interval=duration
(default: 1s)
The interval for polling the Greymatter API. Minimium value is 500ms
--xds.resolve-dns
(default: true)
If true, resolve EDS hostnames to IP addresses.
--xds.server-auth-type=string
TLS client authentication type
--xds.server-cert=string
URL containing the server certificate for the grpc ADS server
--xds.server-key=string
URL containing the server certificate key for the grpc ADS server
--xds.server-trusts=string
Comma-delimited URLs containing truststores for the grpc ADS server
--xds.standalone-cluster=string
(default: "default-cluster")
The name of the cluster for the Envoys consuming the standalone xDS server. Should match the --service-cluster flag for the envoy binary, or the ENVOY_NODE_CLUSTER value for the envoy-simple Docker image.
--xds.standalone-port=int
(default: 80)
The port on which Envoys consuming the standalone xDS server should listen. Ignored if --api.key is specified.
--xds.standalone-zone=string
(default: "default-zone")
The name of the zone for the Envoys consuming the standalone xDS server. Should match the --service-zone flag for the envoy binary, or the ENVOY_NODE_ZONE value for the envoy-simple Docker image.
--xds.static-resources.conflict-behavior=value
(default: "merge")
(valid values: "overwrite" or "merge")
How to handle conflicts between configuration types. If "overwrite" configuration types overwrite defaults. For example, if one were to include "listeners" in the static resources configuration file, all existing listeners would be overwritten. If the
value is "merge", listeners would be merged together, with collisions favoring the statically configured listener. Clusters are differentiated by name, while listeners are differentiated by IP/port. Listeners on 0.0.0.0 (or ::) on a given port will
collide with any other IP with the same port. Specifying colliding static resources will produce a startup error.
--xds.static-resources.filename=string
Path to a file containing static resources. The contents of the file should be either a JSON or YAML fragment (as configured by the corresponding --format flag) containing any combination of "clusters" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/cluster.proto), "cluster_template" (a single cluster, which will be used as the prototype for all clusters not specified statically), and/or listeners" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/listener.proto). The file is read once at startup. Only the v2 API is parsed. Enum strings such as "ROUND_ROBIN" must be capitalized.
--xds.static-resources.format=value
(default: "yaml")
(valid values: "json" or "yaml")
The format of the static resources file
Global options can also be configured via upper-case, underscore-delimited environment variables prefixed with "GM_CONTROL_". For example, "--some-flag" becomes "GM_CONTROL_SOME_FLAG". Command-line flags take precedence over environment variables.
OPTIONS
--help (default: false)
Show a list of commands or help for one command
--version
(default: false)
Print the version and exit
Options can also be configured via upper-case, underscore-delimited environment variables prefixed with "GM_CONTROL_XDS_ONLY_". For example, "--some-flag" becomes "GM_CONTROL_XDS_ONLY_SOME_FLAG". Command-line flags take precedence over environment variables.$ gm-control file --help
NAME
file - file-based collector
USAGE
gm-control [GLOBAL OPTIONS] file [OPTIONS] <file>
VERSION
1.0.3-dev
DESCRIPTION
Watches the given JSON or YAML file and updates Clusters stored in the Greymatter API at startup and whenever the file changes.
The file can be specified as a flag or as the only argument (but not both).
The structure of the JSON and YAML formats is equivalent. Each contains 0 or more clusters identified by name, each containing 0 or more instances. For example, as YAML:
- cluster: c1
instances:
- host: h1
port: 8000
metadata:
- key: stage
value: prod
Alternatively as JSON:
[
{
"cluster": "c1",
"instances": [
{
"host": "h1",
"port": 8000,
"metadata": [
{ "key": "stage", "value": "prod" }
]
}
]
}
]
Note that when updating the file, care should be taken to make the modification atomic. In practice, this means writing the updated file to a temporary location and then moving/renaming the file to the watched path. Alternatively, the watched path may be a
symbolic link that is replaced with a reference to the updated file.
GLOBAL OPTIONS
--api.header=header
Specifies a custom header to send with every gm-control request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--api.host=host:port
(default: localhost:80)
The address (host:port) for gm-control requests. If no port is given, it defaults to port 443 if --api.ssl is true and port 80 otherwise.
--api.insecure
(default: false)
If true, don't validate server cert when using SSL for gm-control requests
--api.key=string
(default: "none")
[SENSITIVE] The auth key for gm-control requests
--api.prefix=value
The url prefix for gm-control requests. Forms the path part of <host>:<port><path>
--api.ssl
(default: true)
If true, use SSL for gm-control requests
--api.sslCert=value
Specifies the SSL cert to use for every gm-control request.
--api.sslKey=value
Specifies the SSL key to use for every gm-control request.
--api.zone-name=string
The name of the API Zone for gm-control requests.
--console.level=level
(default: "info")
(valid values: "debug", "info", "error", or "none")
Selects the log level for console logs messages.
--delay=duration
(default: 30s)
Sets the minimum time between API updates. If the discovery data changes more frequently than this duration, updates are delayed to maintain the minimum time.
--diff.dry-run
(default: false)
Log changes at the info level rather than submitting them to the API
--diff.ignore-create
(default: false)
If true, do not create new Clusters in the API
--diff.include-delete
(default: false)
If true, delete missing Clusters from the API
--help (default: false)
Show a list of commands or help for one command
--stats.api.header=header
Specifies a custom header to send with every stats API request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--stats.api.host=host:port
(default: localhost:80)
The address (host:port) for stats API requests. If no port is given, it defaults to port 443 if --stats.api.ssl is true and port 80 otherwise.
--stats.api.insecure
(default: false)
If true, don't validate server cert when using SSL for stats API requests
--stats.api.prefix=value
The url prefix for stats API requests. Forms the path part of <host>:<port><path>
--stats.api.ssl
(default: true)
If true, use SSL for stats API requests
--stats.api.sslCert=value
Specifies the SSL cert to use for every stats API request.
--stats.api.sslKey=value
Specifies the SSL key to use for every stats API request.
--stats.backends=value
(valid values: "dogstatsd", "prometheus", "statsd", or "wavefront")
Selects which stats backend(s) to use.
--stats.batch
(default: true)
If true, stats requests are batched together for performance.
--stats.dogstatsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.dogstatsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.dogstatsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.dogstatsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.dogstatsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.dogstatsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.dogstatsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.dogstatsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.dogstatsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.dogstatsd.scope=string
If specified, prepends the given scope to metric names.
--stats.dogstatsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.event-backends=value
(valid values: "console" or "honeycomb")
Selects which stats backend(s) to use for structured events.
--stats.exec.attempt-timeout=duration
(default: 1s)
Specifies the default timeout for individual action attempts. A timeout of 0 means no timeout.
--stats.exec.delay=duration
(default: 100ms)
Specifies the initial delay for the exponential delay type. Specifies the delay for constant delay type.
--stats.exec.delay-type=value
(default: "exponential")
(valid values: "constant" or "exponential")
Specifies the retry delay type.
--stats.exec.max-attempts=int
(default: 8)
Specifies the maximum number of attempts made, inclusive of the original attempt.
--stats.exec.max-delay=duration
(default: 30s)
Specifies the maximum delay for the exponential delay type. Ignored for the constant delay type.
--stats.exec.parallelism=int
(default: 8)
Specifies the maximum number of concurrent attempts running.
--stats.exec.timeout=duration
(default: 10s)
Specifies the default timeout for actions. A timeout of 0 means no timeout.
--stats.honeycomb.api-host=string
(default: "https://api.honeycomb.io")
The Honeycomb API host to send messages to
--stats.honeycomb.batchSize=uint
(default: 50)
The Honeycomb batch size to use
--stats.honeycomb.dataset=string
They Honeycomb dataset to send messages to.
--stats.honeycomb.sample-rate=uint
(default: 1)
The Honeycomb sample rate to use. Specified as 1 event sent per Sample Rate
--stats.honeycomb.write-key=string
They Honeycomb write key used to send messages.
--stats.max-batch-delay=duration
(default: 1s)
If batching is enabled, the maximum amount of time requests are held before transmission
--stats.max-batch-size=int
(default: 100)
If batching is enabled, the maximum number of requests that will be combined.
--stats.node=string
If set, specifies the node to use when submitting stats to backends. Equivalent to adding "--stats.tags=node=value" to the command line.
--stats.prometheus.addr=value
(default: 0.0.0.0:9102)
Specifies the listener address for Prometheus scraping.
--stats.prometheus.scope=string
If specified, prepends the given scope to metric names.
--stats.source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. In either case, a UUID is appended to the value to insure that it is unique across proxies. Cannot be combined
with --stats.unique-source.
--stats.statsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.statsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.statsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.statsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.statsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.statsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.statsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.statsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.statsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.statsd.scope=string
If specified, prepends the given scope to metric names.
--stats.statsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.tags=value
Tags to be included with every stat. May be comma-delimited or specified more than once. Should be of the form "<key>=<value>" or "tag"
--stats.unique-source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. Unlike --stats.source, failing to specify a unique value may prevent stats from being recorded correctly. Cannot
be combined with --stats.source.
--stats.wavefront.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.wavefront.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.wavefront.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.wavefront.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.wavefront.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.wavefront.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.wavefront.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.wavefront.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.wavefront.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.wavefront.scope=string
If specified, prepends the given scope to metric names.
--stats.wavefront.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--version
(default: false)
Print the version and exit
--xds.addr=value
(default: :50000)
The address on which to serve the envoy API server.
--xds.ads-enabled
(default: true)
If false, turn off ads discovery mode
--xds.ca-file=string
Path to a file (on the Envoy host's file system) containing CA certificates for TLS.
--xds.default-timeout=duration
(default: 1m0s)
The default request timeout, if none is specified in the RetryPolicy for a Route
--xds.disabled
(default: false)
Disables the xDS listener.
--xds.enable-tls
(default: false)
Enable grpc xDS TLS
--xds.grpc-log-top=int
(default: 0)
When gRPC logging is enabled and this value is greater than 1, logs of non-success Envoy responses are tracked and periodically reported. This flag controls how many unique response code & request path combinations are tracked. When the number of
tracked combinations in the reporting period is exceeded, uncommon paths are evicted.
--xds.grpc-log-top-interval=duration
(default: 5m0s)
See the grpc-log-top flag. Controls the interval at which top logs are generated.
--xds.interval=duration
(default: 1s)
The interval for polling the Greymatter API. Minimium value is 500ms
--xds.resolve-dns
(default: true)
If true, resolve EDS hostnames to IP addresses.
--xds.server-auth-type=string
TLS client authentication type
--xds.server-cert=string
URL containing the server certificate for the grpc ADS server
--xds.server-key=string
URL containing the server certificate key for the grpc ADS server
--xds.server-trusts=string
Comma-delimited URLs containing truststores for the grpc ADS server
--xds.standalone-cluster=string
(default: "default-cluster")
The name of the cluster for the Envoys consuming the standalone xDS server. Should match the --service-cluster flag for the envoy binary, or the ENVOY_NODE_CLUSTER value for the envoy-simple Docker image.
--xds.standalone-port=int
(default: 80)
The port on which Envoys consuming the standalone xDS server should listen. Ignored if --api.key is specified.
--xds.standalone-zone=string
(default: "default-zone")
The name of the zone for the Envoys consuming the standalone xDS server. Should match the --service-zone flag for the envoy binary, or the ENVOY_NODE_ZONE value for the envoy-simple Docker image.
--xds.static-resources.conflict-behavior=value
(default: "merge")
(valid values: "overwrite" or "merge")
How to handle conflicts between configuration types. If "overwrite" configuration types overwrite defaults. For example, if one were to include "listeners" in the static resources configuration file, all existing listeners would be overwritten. If the
value is "merge", listeners would be merged together, with collisions favoring the statically configured listener. Clusters are differentiated by name, while listeners are differentiated by IP/port. Listeners on 0.0.0.0 (or ::) on a given port will
collide with any other IP with the same port. Specifying colliding static resources will produce a startup error.
--xds.static-resources.filename=string
Path to a file containing static resources. The contents of the file should be either a JSON or YAML fragment (as configured by the corresponding --format flag) containing any combination of "clusters" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/cluster.proto), "cluster_template" (a single cluster, which will be used as the prototype for all clusters not specified statically), and/or listeners" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/listener.proto). The file is read once at startup. Only the v2 API is parsed. Enum strings such as "ROUND_ROBIN" must be capitalized.
--xds.static-resources.format=value
(default: "yaml")
(valid values: "json" or "yaml")
The format of the static resources file
Global options can also be configured via upper-case, underscore-delimited environment variables prefixed with "GM_CONTROL_". For example, "--some-flag" becomes "GM_CONTROL_SOME_FLAG". Command-line flags take precedence over environment variables.
OPTIONS
--filename=string
The file from which to collect
--format=string
(default: "json")
The I/O format (json or yaml)
--help (default: false)
Show a list of commands or help for one command
--version
(default: false)
Print the version and exit
Options can also be configured via upper-case, underscore-delimited environment variables prefixed with "GM_CONTROL_FILE_". For example, "--some-flag" becomes "GM_CONTROL_FILE_SOME_FLAG". Command-line flags take precedence over environment variables.$ gm-control kubernetes --help
NAME
kubernetes - kubernetes collector
USAGE
gm-control [GLOBAL OPTIONS] kubernetes [OPTIONS]
VERSION
1.0.3-dev
DESCRIPTION
Connects to a Kubernetes cluster API server and updates Clusters stored in the Greymatter API at startup and periodically thereafter. By default, the tool assumes that it is being run within the Kubernetes cluster and will automatically find the API server.
Pod labels are used to determine to which API cluster a particular pod belongs. The default label name is "gm_cluster", but it may be overridden by command line flags (see -cluster-label). By default all pods in the configured namespace(s) are watched, but you
may also provide a label selector (using the same format at the kubectl command) to specify a subset of pods to watch.
In each pod, all containers must be running before the pod is considered live and ready for inclusion in the API cluster's instance list. Each container is examined for ports. The first TCP port found is used as the API instance's port unless a port name is
specified (see -port-name), in which case the first port with that name becomes the API instance's port. Pods with no container port are ignored. All pod labels (except for the cluster label) are attached as instance metadata.
GLOBAL OPTIONS
--api.header=header
Specifies a custom header to send with every gm-control request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--api.host=host:port
(default: localhost:80)
The address (host:port) for gm-control requests. If no port is given, it defaults to port 443 if --api.ssl is true and port 80 otherwise.
--api.insecure
(default: false)
If true, don't validate server cert when using SSL for gm-control requests
--api.key=string
(default: "none")
[SENSITIVE] The auth key for gm-control requests
--api.prefix=value
The url prefix for gm-control requests. Forms the path part of <host>:<port><path>
--api.ssl
(default: true)
If true, use SSL for gm-control requests
--api.sslCert=value
Specifies the SSL cert to use for every gm-control request.
--api.sslKey=value
Specifies the SSL key to use for every gm-control request.
--api.zone-name=string
The name of the API Zone for gm-control requests.
--console.level=level
(default: "info")
(valid values: "debug", "info", "error", or "none")
Selects the log level for console logs messages.
--delay=duration
(default: 30s)
Sets the minimum time between API updates. If the discovery data changes more frequently than this duration, updates are delayed to maintain the minimum time.
--diff.dry-run
(default: false)
Log changes at the info level rather than submitting them to the API
--diff.ignore-create
(default: false)
If true, do not create new Clusters in the API
--diff.include-delete
(default: false)
If true, delete missing Clusters from the API
--help (default: false)
Show a list of commands or help for one command
--stats.api.header=header
Specifies a custom header to send with every stats API request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--stats.api.host=host:port
(default: localhost:80)
The address (host:port) for stats API requests. If no port is given, it defaults to port 443 if --stats.api.ssl is true and port 80 otherwise.
--stats.api.insecure
(default: false)
If true, don't validate server cert when using SSL for stats API requests
--stats.api.prefix=value
The url prefix for stats API requests. Forms the path part of <host>:<port><path>
--stats.api.ssl
(default: true)
If true, use SSL for stats API requests
--stats.api.sslCert=value
Specifies the SSL cert to use for every stats API request.
--stats.api.sslKey=value
Specifies the SSL key to use for every stats API request.
--stats.backends=value
(valid values: "dogstatsd", "prometheus", "statsd", or "wavefront")
Selects which stats backend(s) to use.
--stats.batch
(default: true)
If true, stats requests are batched together for performance.
--stats.dogstatsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.dogstatsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.dogstatsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.dogstatsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.dogstatsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.dogstatsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.dogstatsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.dogstatsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.dogstatsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.dogstatsd.scope=string
If specified, prepends the given scope to metric names.
--stats.dogstatsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.event-backends=value
(valid values: "console" or "honeycomb")
Selects which stats backend(s) to use for structured events.
--stats.exec.attempt-timeout=duration
(default: 1s)
Specifies the default timeout for individual action attempts. A timeout of 0 means no timeout.
--stats.exec.delay=duration
(default: 100ms)
Specifies the initial delay for the exponential delay type. Specifies the delay for constant delay type.
--stats.exec.delay-type=value
(default: "exponential")
(valid values: "constant" or "exponential")
Specifies the retry delay type.
--stats.exec.max-attempts=int
(default: 8)
Specifies the maximum number of attempts made, inclusive of the original attempt.
--stats.exec.max-delay=duration
(default: 30s)
Specifies the maximum delay for the exponential delay type. Ignored for the constant delay type.
--stats.exec.parallelism=int
(default: 8)
Specifies the maximum number of concurrent attempts running.
--stats.exec.timeout=duration
(default: 10s)
Specifies the default timeout for actions. A timeout of 0 means no timeout.
--stats.honeycomb.api-host=string
(default: "https://api.honeycomb.io")
The Honeycomb API host to send messages to
--stats.honeycomb.batchSize=uint
(default: 50)
The Honeycomb batch size to use
--stats.honeycomb.dataset=string
They Honeycomb dataset to send messages to.
--stats.honeycomb.sample-rate=uint
(default: 1)
The Honeycomb sample rate to use. Specified as 1 event sent per Sample Rate
--stats.honeycomb.write-key=string
They Honeycomb write key used to send messages.
--stats.max-batch-delay=duration
(default: 1s)
If batching is enabled, the maximum amount of time requests are held before transmission
--stats.max-batch-size=int
(default: 100)
If batching is enabled, the maximum number of requests that will be combined.
--stats.node=string
If set, specifies the node to use when submitting stats to backends. Equivalent to adding "--stats.tags=node=value" to the command line.
--stats.prometheus.addr=value
(default: 0.0.0.0:9102)
Specifies the listener address for Prometheus scraping.
--stats.prometheus.scope=string
If specified, prepends the given scope to metric names.
--stats.source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. In either case, a UUID is appended to the value to insure that it is unique across proxies. Cannot be combined
with --stats.unique-source.
--stats.statsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.statsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.statsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.statsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.statsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.statsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.statsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.statsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.statsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.statsd.scope=string
If specified, prepends the given scope to metric names.
--stats.statsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.tags=value
Tags to be included with every stat. May be comma-delimited or specified more than once. Should be of the form "<key>=<value>" or "tag"
--stats.unique-source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. Unlike --stats.source, failing to specify a unique value may prevent stats from being recorded correctly. Cannot
be combined with --stats.source.
--stats.wavefront.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.wavefront.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.wavefront.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.wavefront.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.wavefront.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.wavefront.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.wavefront.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.wavefront.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.wavefront.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.wavefront.scope=string
If specified, prepends the given scope to metric names.
--stats.wavefront.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--version
(default: false)
Print the version and exit
--xds.addr=value
(default: :50000)
The address on which to serve the envoy API server.
--xds.ads-enabled
(default: true)
If false, turn off ads discovery mode
--xds.ca-file=string
Path to a file (on the Envoy host's file system) containing CA certificates for TLS.
--xds.default-timeout=duration
(default: 1m0s)
The default request timeout, if none is specified in the RetryPolicy for a Route
--xds.disabled
(default: false)
Disables the xDS listener.
--xds.enable-tls
(default: false)
Enable grpc xDS TLS
--xds.grpc-log-top=int
(default: 0)
When gRPC logging is enabled and this value is greater than 1, logs of non-success Envoy responses are tracked and periodically reported. This flag controls how many unique response code & request path combinations are tracked. When the number of
tracked combinations in the reporting period is exceeded, uncommon paths are evicted.
--xds.grpc-log-top-interval=duration
(default: 5m0s)
See the grpc-log-top flag. Controls the interval at which top logs are generated.
--xds.interval=duration
(default: 1s)
The interval for polling the Greymatter API. Minimium value is 500ms
--xds.resolve-dns
(default: true)
If true, resolve EDS hostnames to IP addresses.
--xds.server-auth-type=string
TLS client authentication type
--xds.server-cert=string
URL containing the server certificate for the grpc ADS server
--xds.server-key=string
URL containing the server certificate key for the grpc ADS server
--xds.server-trusts=string
Comma-delimited URLs containing truststores for the grpc ADS server
--xds.standalone-cluster=string
(default: "default-cluster")
The name of the cluster for the Envoys consuming the standalone xDS server. Should match the --service-cluster flag for the envoy binary, or the ENVOY_NODE_CLUSTER value for the envoy-simple Docker image.
--xds.standalone-port=int
(default: 80)
The port on which Envoys consuming the standalone xDS server should listen. Ignored if --api.key is specified.
--xds.standalone-zone=string
(default: "default-zone")
The name of the zone for the Envoys consuming the standalone xDS server. Should match the --service-zone flag for the envoy binary, or the ENVOY_NODE_ZONE value for the envoy-simple Docker image.
--xds.static-resources.conflict-behavior=value
(default: "merge")
(valid values: "overwrite" or "merge")
How to handle conflicts between configuration types. If "overwrite" configuration types overwrite defaults. For example, if one were to include "listeners" in the static resources configuration file, all existing listeners would be overwritten. If the
value is "merge", listeners would be merged together, with collisions favoring the statically configured listener. Clusters are differentiated by name, while listeners are differentiated by IP/port. Listeners on 0.0.0.0 (or ::) on a given port will
collide with any other IP with the same port. Specifying colliding static resources will produce a startup error.
--xds.static-resources.filename=string
Path to a file containing static resources. The contents of the file should be either a JSON or YAML fragment (as configured by the corresponding --format flag) containing any combination of "clusters" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/cluster.proto), "cluster_template" (a single cluster, which will be used as the prototype for all clusters not specified statically), and/or listeners" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/listener.proto). The file is read once at startup. Only the v2 API is parsed. Enum strings such as "ROUND_ROBIN" must be capitalized.
--xds.static-resources.format=value
(default: "yaml")
(valid values: "json" or "yaml")
The format of the static resources file
Global options can also be configured via upper-case, underscore-delimited environment variables prefixed with "GM_CONTROL_". For example, "--some-flag" becomes "GM_CONTROL_SOME_FLAG". Command-line flags take precedence over environment variables.
OPTIONS
--ca-cert=path
The path to a trusted root certificate file for the Kubernetes API server. Only used if -kubernetes-host is set.
--client-cert=path
The path to a certificate file which the client will use to authenticate itself to the Kubernetes API server. Only used if -kubernetes-host is set.
--client-key=path
The path to a certificate key file which the client will use to authenticate itself to the Kubernetes API server. Only used if -kubernetes-host is set.
--cluster-label=name
(default: "gm_cluster")
The name of Kubernetes label that specifies to which cluster a pod belongs.
--help (default: false)
Show a list of commands or help for one command
--kubernetes-host=host
The host name for the kubernetes API server. Required if the collector is to run outside of the Kubernetes cluster.
--log-level=string
(default: "error")
The log level used for this discovery plugin
--namespaces=namespace
(default: "default")
A comma-delimited Kubernetes cluster namespace list to watch for pods.
--port-name=string
(default: "http")
The named container port assigned to cluster instances.
--selector=string
A Kubernetes label selector that selects which pods are polled.
--timeout=duration
(default: 2m0s)
The timeout used for Kubernetes API requests (converted to seconds).
--version
(default: false)
Print the version and exit
Options can also be configured via upper-case, underscore-delimited environment variables prefixed with "GM_CONTROL_KUBERNETES_". For example, "--some-flag" becomes "GM_CONTROL_KUBERNETES_SOME_FLAG". Command-line flags take precedence over environment
variables.[info] <timestamp> ALS: <number of requests>: <HTTP response code> <request path>[info] 2020/02/25 20:52:16 ALS: 1: 475 http://localhost:8080/errorcurl -X POST localhost:8001/logging?level=debugcurl -X POST localhost:8001/logging?filter=debugFROM docker.greymatter.io/release/gm-proxy:1.4.5
# Switch to root user, necessary for the following operations
USER root
ADD ./certs-override/ /usr/local/share/ca-certificates/
RUN update-ca-certificates
# Switch back to a non-root user for execution
USER gmproxy
CMD ./gm-proxy -c config.yamlexport DATA_S3_BUCKET=<data-bucket-name>
aws s3api create-bucket --bucket $DATA_S3_BUCKET
aws s3api put-public-access-block --bucket $DATA_S3_BUCKET --public-access-block-configuration "BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true"{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "DataReadWrite",
"Action": [
"s3:AbortMultipartUpload",
"s3:DeleteObject",
"s3:GetBucketAcl",
"s3:GetBucketPolicy",
"s3:GetObject",
"s3:GetObjectAcl",
"s3:ListBucket",
"s3:ListBucketMultipartUploads",
"s3:ListMultipartUploadParts",
"s3:PutObject",
"s3:PutObjectAcl"
],
"Effect": "Allow",
"Resource": [
"arn:aws:s3:::<data-bucket-name>/*",
"arn:aws:s3:::<data-bucket-name>"
]
}
]
}aws iam create-user --user-name gm-dataaws iam list-policies | grep -A 8 gmdata-s3 "PolicyName": "gmdata-s3",
"PolicyId": "<some-policy-id>",
"Arn": "arn:aws:iam::<user-id>:policy/gmdata-s3",
"Path": "/",
"DefaultVersionId": "v1",
"AttachmentCount": 0,
"PermissionsBoundaryUsageCount": 0,
"IsAttachable": true,
"CreateDate": "2020-11-25T14:48:36+00:00",
"UpdateDate": "2020-11-25T14:48:36+00:00"
},aws iam attach-user-policy --user-name gm-data --policy-arn <policy-arn>aws iam create-access-key --user-name gm-data





GM_CONTROL_API_ADDRESS="0.0.0.0:5555"
GM_CONTROL_API_ORG_KEY="deciphernow"
GM_CONTROL_API_PERSISTER_TYPE="file"
GM_CONTROL_API_PERSISTER_PATH="/control-plane/data/backend.json"
GM_CONTROL_API_ZONE_KEY="default-zone"
GM_CONTROL_API_ZONE_NAME="default-zone"GM_CONTROL_API_PERSISTER_TYPE=nullGM_CONTROL_API_PERSISTER_TYPE=fileGM_CONTROL_API_PERSISTER_TYPE=gmdata{
"timeout_msec": 1000,
"interval_msec": 60000,
"interval_jitter_msec": 1000,
"unhealthy_threshold": 3,
"healthy_threshold": 3
}










yourcompany.net is assumed to be setup for various things. Search the configuration templates for different instances of this.static_resources:
listeners:
- name: ingress
address:
socket_address:
address: 0.0.0.0
port_value: 8443
filter_chains:
- filters:
- name: envoy.http_connection_manager
config:
idle_timeout: 1s
forward_client_cert_details: sanitize_set
set_current_client_cert_details:
uri: true
codec_type: AUTO
access_log:
- name: envoy.file_access_log
config:
path: "/dev/stdout"
stat_prefix: ingress
route_config:
name: local
virtual_hosts:
- name: local
domains: ["*"]
routes:
- match:
prefix: "/"
route:
cluster: local
http_filters:
- name: gm.metrics
typed_config:
"@type": type.googleapis.com/foo.gm_proxy.filters.MetricsConfig
metrics_port: 8080
metrics_host: 0.0.0.0
metrics_dashboard_uri_path: /metrics
metrics_prometheus_uri_path: /prometheus
prometheus_system_metrics_interval_seconds: 15
metrics_ring_buffer_size: 4096
metrics_key_function: depth
metrics_key_depth: "2"
- name: envoy.router
tls_context:
common_tls_context:
tls_certificate_sds_secret_configs:
- name: "spiffe://foo.com/ns/fabric/sa/api"
sds_config:
api_config_source:
api_type: GRPC
grpc_services:
envoy_grpc:
cluster_name: spire
tls_params:
ecdh_curves:
- X25519:P-256:P-521:P-384
clusters:
- name: local
connect_timeout: 0.25s
type: STATIC
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: local
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 10080
- name: spire
connect_timeout: 0.25s
http2_protocol_options: {}
type: STATIC
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: spire
endpoints:
- lb_endpoints:
- endpoint:
address:
pipe:
path: /run/spire/sockets/agent.sock
admin:
access_log_path: /dev/stdout
address:
socket_address:
address: 127.0.0.1
port_value: 8001apiVersion: apps/v1
kind: StatefulSet
spec:
serviceName: api
template:
metadata:
...
spec:
serviceAccount: api
containers:
- name: sidecar
image: "docker.greymatter.io/release:1.4.5-alpine"
imagePullPolicy: IfNotPresent
args:
- -c
- /etc/greymatter/config.yaml
command:
- /app/gm-proxy
ports:
...
volumeMounts:
- name: sidecar-config
mountPath: /etc/greymatter
readOnly: true
...
volumes:
- name: sidecar-config
configMap:
name: api-sidecarPROXY_DYNAMIC="true"
XDS_CLUSTER="example"
XDS_HOST="gm-control.fabric.svc"
XDS_PORT="50000"HOST="0.0.0.0"
PORT=8080
SERVICE_HOST="localhost"
SERVICE_PORT=9080
METRICS_PORT=8081
OBS_ENABLED=truePROXY_DYNAMIC=true # To run in dynamic configuration mode
XDS_CLUSTER=example-service
XDS_ZONE=us-east-1
XDS_NODE_ID=an58xch3mf78gm-proxy -c ./config.yaml \
--service-cluster=example-service \
--service-zone=us-east-1 \
--service-node=an58xch3mf78node:
cluster: example-service
id: n48xng&9#dsfd9
locality:
zone: us-east-1PROXY_DYNAMIC=true # To run in dynamic configuration mode
XDS_HOST=<gm-control host>
XDS_PORT=<gm-control port>PROXY_DYNAMIC=true # To run in dynamic configuration mode
XDS_SERVER_CA_PATH-<gm-control trust path>
XDS_SERVER_CERT_PATH=<gm-control certificate path>
XDS_SERVER_KEY_PATH=<gm-control certificate key path>[2019-10-11 15:21:51.635][8][warning][config] [bazel-out/k8-fastbuild/bin/external/envoy/source/common/config/_virtual_includes/grpc_stream_lib/common/config/grpc_stream.h:102] gRPC config stream closed: 14, no healthy upstream
[2019-10-11 15:21:51.635][8][warning][config] [bazel-out/k8-fastbuild/bin/external/envoy/source/common/config/_virtual_includes/grpc_stream_lib/common/config/grpc_stream.h:56] Unable to establish new stream# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv4 remote connections for authenticated users
hostssl all www-data 0.0.0.0/0 cert clientcert=1
hostssl all postgres 0.0.0.0/0 cert clientcert=1 environment:
DATABASE_URI: postgres://postgres:mysecretpassword@postgres:5432/slo-db
SSL_ENABLED: "true"
SSL_SERVER_CA: /etc/gm-slo/certs/postgres/ca.crt
SSL_SERVER_CERT: /etc/gm-slo/certs/postgres/server.crt
SSL_SERVER_KEY: /etc/gm-slo/certs/postgres/server.key
# Uncomment the env vars below to serve over TLS
# SERVICE_SSL_ENABLED: "true"
# SERVICE_SSL_CA: /etc/gm-slo/certs/server/ca.crt
# SERVICE_SSL_CERT: /etc/gm-slo/certs/server/server.crt
# SERVICE_SSL_KEY: /etc/gm-slo/certs/server/server.key
volumes:
- ./docker/postgres/certs/:/etc/gm-slo/certs/postgres/
- ./docker/server/certs/:/etc/gm-slo/certs/server/$ gm-control marathon --help
NAME
marathon - marathon collector
USAGE
gm-control [GLOBAL OPTIONS] marathon [OPTIONS]
VERSION
1.0.3-dev
DESCRIPTION
Connects to a Marathon API server and updates Clusters stored in the Greymatter API at startup and periodically thereafter.
Application labels are used to determine which API cluster a particular task belongs to. The default label name is "gm_cluster", but can be overridden by a flag (see -cluster-label). By default all applications are watched, but you may also provide a label
selector.
Each task is examined for service ports. The first exposed TCP port is used. If no ports are exposed, the task is ignored.
All application labels besides the cluster label are captured as instance metadata for routing.
GLOBAL OPTIONS
--api.header=header
Specifies a custom header to send with every gm-control request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--api.host=host:port
(default: localhost:80)
The address (host:port) for gm-control requests. If no port is given, it defaults to port 443 if --api.ssl is true and port 80 otherwise.
--api.insecure
(default: false)
If true, don't validate server cert when using SSL for gm-control requests
--api.key=string
(default: "none")
[SENSITIVE] The auth key for gm-control requests
--api.prefix=value
The url prefix for gm-control requests. Forms the path part of <host>:<port><path>
--api.ssl
(default: true)
If true, use SSL for gm-control requests
--api.sslCert=value
Specifies the SSL cert to use for every gm-control request.
--api.sslKey=value
Specifies the SSL key to use for every gm-control request.
--api.zone-name=string
The name of the API Zone for gm-control requests.
--console.level=level
(default: "info")
(valid values: "debug", "info", "error", or "none")
Selects the log level for console logs messages.
--delay=duration
(default: 30s)
Sets the minimum time between API updates. If the discovery data changes more frequently than this duration, updates are delayed to maintain the minimum time.
--diff.dry-run
(default: false)
Log changes at the info level rather than submitting them to the API
--diff.ignore-create
(default: false)
If true, do not create new Clusters in the API
--diff.include-delete
(default: false)
If true, delete missing Clusters from the API
--help (default: false)
Show a list of commands or help for one command
--stats.api.header=header
Specifies a custom header to send with every stats API request. Headers are given as name:value pairs. Leading and trailing whitespace will be stripped from the name and value. For multiple headers, this flag may be repeated or multiple headers can be
delimited with commas.
--stats.api.host=host:port
(default: localhost:80)
The address (host:port) for stats API requests. If no port is given, it defaults to port 443 if --stats.api.ssl is true and port 80 otherwise.
--stats.api.insecure
(default: false)
If true, don't validate server cert when using SSL for stats API requests
--stats.api.prefix=value
The url prefix for stats API requests. Forms the path part of <host>:<port><path>
--stats.api.ssl
(default: true)
If true, use SSL for stats API requests
--stats.api.sslCert=value
Specifies the SSL cert to use for every stats API request.
--stats.api.sslKey=value
Specifies the SSL key to use for every stats API request.
--stats.backends=value
(valid values: "dogstatsd", "prometheus", "statsd", or "wavefront")
Selects which stats backend(s) to use.
--stats.batch
(default: true)
If true, stats requests are batched together for performance.
--stats.dogstatsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.dogstatsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.dogstatsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.dogstatsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.dogstatsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.dogstatsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.dogstatsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.dogstatsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.dogstatsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.dogstatsd.scope=string
If specified, prepends the given scope to metric names.
--stats.dogstatsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.event-backends=value
(valid values: "console" or "honeycomb")
Selects which stats backend(s) to use for structured events.
--stats.exec.attempt-timeout=duration
(default: 1s)
Specifies the default timeout for individual action attempts. A timeout of 0 means no timeout.
--stats.exec.delay=duration
(default: 100ms)
Specifies the initial delay for the exponential delay type. Specifies the delay for constant delay type.
--stats.exec.delay-type=value
(default: "exponential")
(valid values: "constant" or "exponential")
Specifies the retry delay type.
--stats.exec.max-attempts=int
(default: 8)
Specifies the maximum number of attempts made, inclusive of the original attempt.
--stats.exec.max-delay=duration
(default: 30s)
Specifies the maximum delay for the exponential delay type. Ignored for the constant delay type.
--stats.exec.parallelism=int
(default: 8)
Specifies the maximum number of concurrent attempts running.
--stats.exec.timeout=duration
(default: 10s)
Specifies the default timeout for actions. A timeout of 0 means no timeout.
--stats.honeycomb.api-host=string
(default: "https://api.honeycomb.io")
The Honeycomb API host to send messages to
--stats.honeycomb.batchSize=uint
(default: 50)
The Honeycomb batch size to use
--stats.honeycomb.dataset=string
They Honeycomb dataset to send messages to.
--stats.honeycomb.sample-rate=uint
(default: 1)
The Honeycomb sample rate to use. Specified as 1 event sent per Sample Rate
--stats.honeycomb.write-key=string
They Honeycomb write key used to send messages.
--stats.max-batch-delay=duration
(default: 1s)
If batching is enabled, the maximum amount of time requests are held before transmission
--stats.max-batch-size=int
(default: 100)
If batching is enabled, the maximum number of requests that will be combined.
--stats.node=string
If set, specifies the node to use when submitting stats to backends. Equivalent to adding "--stats.tags=node=value" to the command line.
--stats.prometheus.addr=value
(default: 0.0.0.0:9102)
Specifies the listener address for Prometheus scraping.
--stats.prometheus.scope=string
If specified, prepends the given scope to metric names.
--stats.source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. In either case, a UUID is appended to the value to insure that it is unique across proxies. Cannot be combined
with --stats.unique-source.
--stats.statsd.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.statsd.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.statsd.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.statsd.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.statsd.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.statsd.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.statsd.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.statsd.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.statsd.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.statsd.scope=string
If specified, prepends the given scope to metric names.
--stats.statsd.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--stats.tags=value
Tags to be included with every stat. May be comma-delimited or specified more than once. Should be of the form "<key>=<value>" or "tag"
--stats.unique-source=string
If set, specifies the source to use when submitting stats to backends. Equivalent to adding "--stats.tags=source=value" to the command line. Unlike --stats.source, failing to specify a unique value may prevent stats from being recorded correctly. Cannot
be combined with --stats.source.
--stats.wavefront.debug
(default: false)
If enabled, logs the stats data on stdout.
--stats.wavefront.flush-interval=duration
(default: 5s)
Specifies the duration between stats flushes.
--stats.wavefront.host=string
(default: "127.0.0.1")
Specifies the destination host for stats.
--stats.wavefront.latch
(default: false)
Specifies whether stats are accumulated over a window before being sent to the backend.
--stats.wavefront.latch.base-value=float
(default: 0.001)
Specifies the upper bound of the first bucket used for accumulating histograms. Each subsequent bucket's upper bound is double the previous bucket's. For timings this value is taken to be in units of seconds. Must be greater than 0.
--stats.wavefront.latch.buckets=int
(default: 20)
Specifies the number of buckets used for accumulating histograms. Must be greater than 1.
--stats.wavefront.latch.window=duration
(default: 1m0s)
Specifies the period of time over which stats are latched. Must be greater than 0.
--stats.wavefront.max-packet-len=bytes
(default: 8192)
Specifies the maximum number of payload bytes sent per flush. If necessary, flushes will occur before the flush interval to prevent payloads from exceeding this size. The size does not include IP and UDP header bytes. Stats may not be delivered if the
total size of the headers and payload exceeds the network's MTU.
--stats.wavefront.port=int
(default: 8125)
Specifies the destination port for stats.
--stats.wavefront.scope=string
If specified, prepends the given scope to metric names.
--stats.wavefront.transform-tags=string
Defines one or more transformations for tags. A tag with a specific name whose value matches a regular expression can be transformed into one or more tags with values extracted from subexpressions of the regular expression. Transformations are specified
as follows:
tag=/regex/,n1,n2...
where tag is the name of the tag to be transformed, regex is a regular expression with 1 or more subexpressions, and n1,n2... is a sequence of names for the tags formed from the regular expression's subexpressions (matching groups). Any character may be
used in place of the slashes (/) to delimit the regular expression. There must be at least one subexpression in the regular expression. There must be exactly as many names as subexpressions. If one of the names is the original tag name, the original tag
is replaced with the transformed value. Otherwise, the original tag is passed through unchanged. Multiple transformations may be separated by semicolons (;). Any character may be escaped with a backslash (\).
Examples:
foo=/^(.+):.*x=([0-9]+)/,foo,bar
foo=@.*y=([A-Za-z_]+)@,yval
--version
(default: false)
Print the version and exit
--xds.addr=value
(default: :50000)
The address on which to serve the envoy API server.
--xds.ads-enabled
(default: true)
If false, turn off ads discovery mode
--xds.ca-file=string
Path to a file (on the Envoy host's file system) containing CA certificates for TLS.
--xds.default-timeout=duration
(default: 1m0s)
The default request timeout, if none is specified in the RetryPolicy for a Route
--xds.disabled
(default: false)
Disables the xDS listener.
--xds.enable-tls
(default: false)
Enable grpc xDS TLS
--xds.grpc-log-top=int
(default: 0)
When gRPC logging is enabled and this value is greater than 1, logs of non-success Envoy responses are tracked and periodically reported. This flag controls how many unique response code & request path combinations are tracked. When the number of
tracked combinations in the reporting period is exceeded, uncommon paths are evicted.
--xds.grpc-log-top-interval=duration
(default: 5m0s)
See the grpc-log-top flag. Controls the interval at which top logs are generated.
--xds.interval=duration
(default: 1s)
The interval for polling the Greymatter API. Minimium value is 500ms
--xds.resolve-dns
(default: true)
If true, resolve EDS hostnames to IP addresses.
--xds.server-auth-type=string
TLS client authentication type
--xds.server-cert=string
URL containing the server certificate for the grpc ADS server
--xds.server-key=string
URL containing the server certificate key for the grpc ADS server
--xds.server-trusts=string
Comma-delimited URLs containing truststores for the grpc ADS server
--xds.standalone-cluster=string
(default: "default-cluster")
The name of the cluster for the Envoys consuming the standalone xDS server. Should match the --service-cluster flag for the envoy binary, or the ENVOY_NODE_CLUSTER value for the envoy-simple Docker image.
--xds.standalone-port=int
(default: 80)
The port on which Envoys consuming the standalone xDS server should listen. Ignored if --api.key is specified.
--xds.standalone-zone=string
(default: "default-zone")
The name of the zone for the Envoys consuming the standalone xDS server. Should match the --service-zone flag for the envoy binary, or the ENVOY_NODE_ZONE value for the envoy-simple Docker image.
--xds.static-resources.conflict-behavior=value
(default: "merge")
(valid values: "overwrite" or "merge")
How to handle conflicts between configuration types. If "overwrite" configuration types overwrite defaults. For example, if one were to include "listeners" in the static resources configuration file, all existing listeners would be overwritten. If the
value is "merge", listeners would be merged together, with collisions favoring the statically configured listener. Clusters are differentiated by name, while listeners are differentiated by IP/port. Listeners on 0.0.0.0 (or ::) on a given port will
collide with any other IP with the same port. Specifying colliding static resources will produce a startup error.
--xds.static-resources.filename=string
Path to a file containing static resources. The contents of the file should be either a JSON or YAML fragment (as configured by the corresponding --format flag) containing any combination of "clusters" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/cluster.proto), "cluster_template" (a single cluster, which will be used as the prototype for all clusters not specified statically), and/or listeners" (an array of
https://www.envoyproxy.io/docs/envoy/v1.13.1/api-v2/api/v2/listener.proto). The file is read once at startup. Only the v2 API is parsed. Enum strings such as "ROUND_ROBIN" must be capitalized.
--xds.static-resources.format=value
(default: "yaml")
(valid values: "json" or "yaml")
The format of the static resources file
Global options can also be configured via upper-case, underscore-delimited environment variables prefixed with "GM_CONTROL_". For example, "--some-flag" becomes "GM_CONTROL_SOME_FLAG". Command-line flags take precedence over environment variables.
OPTIONS
--cluster-label=label
(default: "gm_cluster")
The name of the Marathon label specifying to which cluster a Mesos task belongs.
--dcos.acs-token=string
The ACS Token for authenticating DC/OS requests. Obtained by logging into the DC/OS CLI, and then invoking "dcos config show core.dcos_acs_token". Required unless --dcos.toml-file is set. Cannot be combined with --dcos.toml-file.
--dcos.insecure
(default: false)
If true, do not verify DC/OS SSL certificates
--dcos.request-timeout=duration
(default: 5s)
The timeout for DC/OS requests.
--dcos.toml-file=string
The path to a DC/OS CLI dcos.toml configuration file. Required unless --dcos.url and --dcos.acs-token are set. Cannot be combined with --dcos.url or --dcos.acs-token.
--dcos.url=string
The the public master IP of your DC/OS installation. Required unless --dcos.toml-file is set. Cannot be combined with --dcos.toml-file.
--group-prefix=group
Marathon group prefix naming applications to expose. By default, all groups.
--help (default: false)
Show a list of commands or help for one command
--selector=string
A label selector for filtering applications.
--version
(default: false)
Print the version and exit
Options can also be configured via upper-case, underscore-delimited environment variables prefixed with "GM_CONTROL_MARATHON_". For example, "--some-flag" becomes "GM_CONTROL_MARATHON_SOME_FLAG". Command-line flags take precedence over environment variables.{
"users": [
{
"label": "CN=localuser,OU=Engineering,O=Decipher Technology Studios,=Alexandria,=Virginia,C=US",
"values": {
"email": [
"localuser@deciphernow.com"
],
"org": [
"www.deciphernow.com"
]
}
},
{
"label": "cn=chris.holmes, dc=deciphernow, dc=com",
"values": {
"email": [
"chris.holmes@deciphernow.com"
],
"org": [
"www.deciphernow.com"
],
"privilege": [
"root"
]
}
}
]
}echo "123,my-special-key,super-secret-key,pub-key" | base64 MTIzLG15LXNwZWNpYWwta2V5LHN1cGVyLXNlY3JldC1rZXkscHViLWtleQo={
...,
"health_checker": {
"http_health_check": {
"path": "/health"
}
}
}mkdir -p generated/configs
bazel build //configs:example_configs
tar xvf $PWD/bazel-genfiles/configs/example_configs.tar -C generated/configs{
"cipher_filter": "",
"protocols": [
"TLSv1_0",
"TLSv1_1",
"TLSv1_2",
"TLSv1_3"
],
"cert_key_pairs": [
{
"certificate_path": "/etc/proxy/tls/sidecar/server.crt",
"key_path": "/etc/proxy/tls/sidecar/server.key"
}
],
"trust_file": "/etc/proxy/tls/sidecar/ca.crt",
"sni": null
}{
"max_connections": 1,
"max_pending_requests": 1,
"max_retries": 1,
"max_requests": 1,
"max_connection_pools": 1,
"track_remaining": true,
"high": null
}{
"secret_key": "web-secret",
"secret_name": "spiffe://greymatter.io/web_proxy/mTLS",
"secret_validation_name": "spiffe://greymatter.io",
"subject_names": "spiffe://greymatter.io/echo_proxy/mTLS",
"ecdh_curves": [
"X25519:P-256:P-521:P-384"
],
"forward_client_cert_details": "SANITIZE",
"set_current_client_cert_details": {
"uri": false
}
}{
"name": "force-https",
"from": "(.*)",
"to": "https://$1",
"redirect_type": "permanent"
}{
"zone_key": "default-zone",
"cluster_key": "catalog-service",
"name": "service",
"instances": [
{
"host": "localhost",
"port": 8080
}
],
"circuit_breakers": {
"max_connections": 500,
"max_requests": 500
},
"outlier_detection": null,
"health_checks": [],
"lb_policy": "",
"secret": {
"secret_key": "",
"secret_name": "",
"secret_validation_name": "",
"subject_alt_name": "",
"ecdh_curves": null,
"set_current_client_cert_details": {
"uri": false
},
"checksum": ""
}
}"ssl_config": {
"cipher_filter": "",
"protocols": [],
"cert_key_pairs": null,
"trust_file": "",
"sni": null
}"secret" : {
"secret_key": "secret-{{.service.serviceName}}-secret",
"secret_name": "spiffe://{{ .Values.global.spire.trustDomain }}/{{.service.serviceName}}/mTLS",
"secret_validation_name": "spiffe://{{ .Values.global.spire.trustDomain }}",
"ecdh_curves": [
"X25519:P-256:P-521:P-384"
]
}{
"interval_msec": 1000,
"base_ejection_time_msec": 5000,
"max_ejection_percent": 100,
"consecutive_5xx": 3,
"enforcing_consecutive_5xx": 100,
"enforcing_success_rate": 0,
"success_rate_minimum_hosts": 0,
"success_rate_request_volume": 1,
"success_rate_stdev_factor": 1900,
"consecutive_gateway_failure": 1,
"enforcing_consecutive_gateway_failure": 0
}{
"name": "X-Forwarded-Proto",
"value": "http"
}{
"name": "X-Forwarded-Proto",
"value": "http"
}{
"name": "X-Forwarded-Proto",
"value": "https",
"invert": true
}route object for matching, rewriting, and redirecting to a shared_rule.portlistener







./gm-catalog --config=settings.tomlGM_CONTROL_LOCAL_CLUSTERS=gm-proxy:8080{
"clusters": [
{
"name": "gm-proxy",
"type": "EDS",
"edsClusterConfig": {
"edsConfig": {
"apiConfigSource": {
"apiType": "GRPC",
"grpcServices": [
{
"envoyGrpc": {
"clusterName": "tbn-xds"
}
}
],
"refreshDelay": "30s"
}
},
"serviceName": "gm-proxy"
},
"connectTimeout": "10s",
"lbPolicy": "LEAST_REQUEST",
"lbSubsetConfig": {
"fallbackPolicy": "ANY_ENDPOINT"
}
}
],
"loadAssignments": [
{
"clusterName": "gm-proxy",
"endpoints": [
{
"lbEndpoints": [
{
"endpoint": {
"address": {
"socketAddress": {
"address": "127.0.0.1",
"portValue": 8080
}
}
},
"healthStatus": "HEALTHY"
}
]
}
]
}
]
}{
"zone_key": "default-zone",
"listener_key": "catalog-listener",
"domain_keys": ["catalog"],
"name": "catalog",
"ip": "0.0.0.0",
"port": 9080,
"protocol": "http_auto",
"tracing_config": null
}"secret": {
"secret_key": "secret-{{.service.serviceName}}-secret",
"secret_name": "spiffe://{{ .Values.global.spire.trustDomain }}/{{.service.serviceName}}/mTLS",
"secret_validation_name": "spiffe://{{ .Values.global.spire.trustDomain }}",
"ecdh_curves": [
"X25519:P-256:P-521:P-384"
]
}{
"cipher_filter": "",
"protocols": [
"TLSv1.1",
"TLSv1.2"
],
"cert_key_pairs": [
{
"certificate_path": "/etc/proxy/tls/sidecar/server.crt",
"key_path": "/etc/proxy/tls/sidecar/server.key"
}
],
"require_client_certs": true,
"trust_file": "/etc/proxy/tls/sidecar/ca.crt",
"sni": null
}{
"path": "/services/example/latest/",
"match_type": "prefix"
}

















truetruetrueresponse_dataContent Type header is set to one of application/x-www-form-urlencoded or multipart/form-data or text/plainshared_rules{
"domain_key": "catalog",
"zone_key": "default",
"name": "*",
"port": 9080,
"ssl_config": {
"cipher_filter": "",
"protocols": [
"TLSv1.1",
"TLSv1.2"
],
"cert_key_pairs": [
{
"certificate_path": "/etc/proxy/tls/sidecar/server.crt",
"key_path": "/etc/proxy/tls/sidecar/server.key"
}
],
"require_client_certs": true,
"trust_file": "/etc/proxy/tls/sidecar/ca.crt",
"sni": null
},
"redirects": null,
"gzip_enabled": false,
"cors_config": null,
"aliases": null,
"force_https": true,
"custom_headers": null,
"checksum": "b633fd4b535932fc1da31fbb7c6d4c39517871d112e9bce2d5ffe004e6d09735"
}"ssl_config": {
"cipher_filter": "",
"protocols": [],
"cert_key_pairs": null,
"require_client_certs": false,
"trust_file": "",
"sni": null
}"custom_headers" : [
{
"key": "x-forwarded-proto",
"value": "https"
}
]{
"headers": [
{
"name": "test-new-header",
"value": "yes"
}
],
"cookies": [
{
"name": "dev-cookie",
"value": "false",
"value_is_literal": true
}
]
}{
"zone_key": "default",
"domain_key": "fibonacci",
"route_key": "fibonacci-route",
"path": "/",
"prefix_rewrite": null,
"redirects": null,
"shared_rules_key": "",
"rules": [
{
"rule_key": "default",
"constraints": {
"light": [
{
"constraint_key": "",
"cluster_key": "fibonacci-service",
"metadata": null,
"properties": null,
"response_data": {},
"weight": 1
}
],
"dark": null,
"tap": null
}
}
],
"response_data": {},
"cohort_seed": null,
"retry_policy": {
"num_retries": 3
}
}{
"kind": "/services/example/latest/",
"behavior": "prefix",
"from": "",
"to": ""
}{
"rule_key": "rkey1",
"methods": [
"GET"
],
"matches": [
{
"kind": "header",
"from": {
"key": "routeTo",
"value": "passthrough-cluster"
}
}
],
"constraints": {
"light": [
{
"cluster_key": "passthrough-cluster",
"weight": 1
}
]
}
}"constraints" : {
"light": [
{
"cluster_key": "example-service-1.0",
"weight": 10
},
{
"cluster_key": "example-service-1.1",
"weight": 1
}
]
}{
"zone_key": "zone-default-zone",
"domain_key": "domain-backend-service",
"name": "*",
"port": 10808,
"cors_config": {
"allowed_origins": [
{ "match_type": "exact", "value": "http://localhost:8080" }
],
"allowed_headers": [],
"allowed_methods": [],
"exposed_headers": [],
"max_age": 60
}
}{
"zone_key": "zone-default-zone",
"domain_key": "domain-backend-service",
"name": "*",
"port": 10808,
"cors_config": {
"allowed_origins": [
{ "match_type": "exact", "value": "http://localhost:8080" }
],
"allowed_headers": ["content-type"],
"allowed_methods": [],
"exposed_headers": [],
"max_age": 60
}
}greymatter edit domain <domain-name> "cors_config": {
"allowed_origins": [],
"allowed_headers": [],
"allowed_methods": [],
"exposed_headers": [],
"max_age": 0,
"allow_credentials": true
} "allowed_origins": [
{ "match_type": "exact", "value": "http://localhost:8080" }
]$ curl -v 'http://localhost:9080/services/catalog/latest/' \
-X OPTIONS \
-H 'Access-Control-Request-Method: POST' \
-H 'Access-Control-Request-Headers: content-type' \
-H 'Origin: http://localhost:8080'
* Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9080 (#0)
> OPTIONS /services/catalog/latest/ HTTP/1.1
> Host: localhost:9080
> User-Agent: curl/7.64.1
> Accept: */*
> Access-Control-Request-Method: POST
> Access-Control-Request-Headers: content-type
> Origin: http://localhost:8080
>
< HTTP/1.1 200 OK
< access-control-allow-origin: http://localhost:8080
< access-control-max-age: 60
< date: Tue, 12 May 2020 20:11:13 GMT
< server: envoy
< content-length: 0
<
* Connection #0 to host localhost left intact
* Closing connection 0{
"constraint_key": "constraint-key-1",
"cluster_key": "passthrough-cluster-3",
"metadata": null,
"properties": null,
"response_data": {},
"weight": 1
}{
"constraint_key": "constraint-key-1",
"cluster_key": "passthrough-cluster-3",
"metadata": null,
"properties": null,
"response_data": {},
"weight": 1
}EDITOR=vim greymatter edit domain domain-localhost[info] 2019/07/10 03:38:43 Preferring --api.key for authentication
{
"domain_key": "domain-localhost",
"zone_key": "zone-default",
"name": "localhost",
"port": 443,
"redirects": null,
"gzip_enabled": false,
"cors_config": null,
"aliases": null,
"force_https": false,
"checksum": "a35ccf0634599ac83b0b9cb61b07297e925f28bbc669a9a63cb65b9c6a6ea309"
}$ greymatter edit --help
NAME
edit - edit an object from the Grey Matter API
USAGE
greymatter [GLOBAL OPTIONS] edit [OPTIONS] <object type> [object key]
VERSION
v1.2.1
DESCRIPTION
object type is one of: zone, proxy, listener, domain, route, shared_rules, cluster
Editor Selection
When changes need to be made an initial version of the object can be presented in an
editor. The command used to launch the editor is taken from the EDITOR environment
variable and must block execution until the changes are saved and the editor is
closed. The current editor command is 'vim'.
Example EDITOR values:
vim
emacs
atom -w
Using STDIN
For scripting purposes it may be useful to use STDIN to provide the edited object
instead of using an interactive editor. If so, simply make the new version available
on STDIN through standard use of pipes.
Example: cat "new_cluster.json" | greymatter create cluster
GLOBAL OPTIONS
--api.header=header
Specifies a custom header to send with every API request. Headers are given as
name:value pairs. Leading and trailing whitespace will be stripped from the
name and value. For multiple headers, this flag may be repeated or multiple
headers can be delimited with commas.
--api.host=host:port
(default: localhost:80)
The address (host:port) for API requests. If no port is given, it defaults to
port 443 if --api.ssl is true and port 80 otherwise.
--api.insecure
(default: false)
If true, don't validate server cert when using SSL for API requests
--api.key=string
(default: "none")
[SENSITIVE] The auth key for API requests
--api.prefix=value
The url prefix for API requests. Forms the path part of <host>:<port><path>
--api.ssl
(default: true)
If true, use SSL for API requests
--api.sslCert=value
Specifies the SSL cert to use for every API request.
--api.sslKey=value
Specifies the SSL key to use for every API request.
--console.level=level
(default: "info")
(valid values: "debug", "info", "error", or "none")
Selects the log level for console logs messages.
--format=string
(default: "json")
The I/O format (json or yaml)
--help (default: false)
Show a list of commands or help for one command
--version
(default: false)
Print the version and exit
Global options can also be configured via upper-case, underscore-delimited environment
variables prefixed with "GREYMATTER_". For example, "--some-flag" becomes
"GREYMATTER_SOME_FLAG". Command-line flags take precedence over environment variables.
OPTIONS
--help (default: false)
Show a list of commands or help for one command
--key=string
[deprecated] key of the object to retrieve, if not provided will read input
from stdin
--version
(default: false)
Print the version and exit
Options can also be configured via upper-case, underscore-delimited environment
variables prefixed with "GREYMATTER_EDIT_". For example, "--some-flag" becomes
"GREYMATTER_EDIT_SOME_FLAG". Command-line flags take precedence over environment
variables.{
"shared_rules_key": "edge-catalog-shared-rules",
"name": "catalog",
"zone_key": "default",
"default": {
"light": [
{
"constraint_key": "",
"cluster_key": "catalog-cluster",
"metadata": null,
"properties": null,
"response_data": {},
"weight": 1
}
]
},
"rules": null,
"response_data": {},
"cohort_seed": null,
"properties": null,
"retry_policy": null
}"constraints" : {
"light": [
{
"cluster_key": "example-service-1.0",
"weight": 10
},
{
"cluster_key": "example-service-1.1",
"weight": 1
}
]
}{
"num_retries": 2,
"per_try_timeout_msec": 60000,
"timeout_msec": 60000
}{
"rule_key": "rkey1",
"methods": [
"GET"
],
"matches": [
{
"kind": "header",
"from": {
"key": "routeTo",
"value": "passthrough-cluster"
}
}
],
"constraints": {
"light": [
{
"cluster_key": "passthrough-cluster",
"weight": 1
}
]
}
}"constraints" : {
"light": [
{
"cluster_key": "example-service-1.0",
"weight": 10
},
{
"cluster_key": "example-service-1.1",
"weight": 1
}
]
}{
"headers": [
{
"name": "test-new-header",
"value": "yes"
}
],
"cookies": [
{
"name": "dev-cookie",
"value": "false",
"value_is_literal": true
}
]
}{
"zone_key": "default-zone",
"zone_name": "zone"
}{
"proxy_key": "catalog",
"zone_key": "default",
"name": "catalog",
"domain_keys": [
"catalog-domain"
],
"listener_keys": [
"catalog-listener"
],
"listeners": null,
"upgrades": "",
"active_proxy_filters": [
"gm.metrics",
"gm.observables"
],
"proxy_filters": {
"envoy_rbac": null,
"gm_impersonation": {},
"gm_inheaders": {},
"gm_listauth": {},
"gm_metrics": {
"metrics_port": 8081,
"metrics_host": "0.0.0.0",
"metrics_dashboard_uri_path": "/metrics",
"metrics_prometheus_uri_path": "/prometheus",
"prometheus_system_metrics_interval_seconds": 15,
"metrics_ring_buffer_size": 4096,
"metrics_key_function": "depth",
"metrics_key_depth": "1"
},
"gm_oauth": {},
"gm_observables": {
"useKafka": true,
"topic": "production-catalog-1.0",
"eventTopic": "events",
"kafkaServerConnection": "kafka-observables.observables.svc:9092"
}
},
"checksum": "9830e988dd93d560426e3ddff6758ca2976565b9e064e68f99661a39b3b17239"
}"lax" : causes SameSite=Lax to be passed back with a cookie
$ greymatter delete domain domain-catalog
[info] 2019/07/10 03:47:57 Preferring --api.key for authentication
{
"domain_key": "domain-catalog",
"zone_key": "zone-default-zone",
"name": "catalog",
"port": 8080,
"redirects": null,
"gzip_enabled": false,
"cors_config": null,
"aliases": null,
"force_https": false,
"checksum": "82581e0c56c2ad385e84234fe118ccf8cf8deb1852a5aa318eab887e9a2717d2"
}$ greymatter delete --help
NAME
delete - delete an object from the Grey Matter API
USAGE
greymatter [GLOBAL OPTIONS] delete [OPTIONS] <object type> <object key>
VERSION
v1.2.1
DESCRIPTION
object type is one of: zone, proxy, listener, domain, route, shared_rules, cluster
GLOBAL OPTIONS
--api.header=header
Specifies a custom header to send with every API request. Headers are given as
name:value pairs. Leading and trailing whitespace will be stripped from the
name and value. For multiple headers, this flag may be repeated or multiple
headers can be delimited with commas.
--api.host=host:port
(default: localhost:80)
The address (host:port) for API requests. If no port is given, it defaults to
port 443 if --api.ssl is true and port 80 otherwise.
--api.insecure
(default: false)
If true, don't validate server cert when using SSL for API requests
--api.key=string
(default: "none")
[SENSITIVE] The auth key for API requests
--api.prefix=value
The url prefix for API requests. Forms the path part of <host>:<port><path>
--api.ssl
(default: true)
If true, use SSL for API requests
--api.sslCert=value
Specifies the SSL cert to use for every API request.
--api.sslKey=value
Specifies the SSL key to use for every API request.
--console.level=level
(default: "info")
(valid values: "debug", "info", "error", or "none")
Selects the log level for console logs messages.
--format=string
(default: "json")
The I/O format (json or yaml)
--help (default: false)
Show a list of commands or help for one command
--version
(default: false)
Print the version and exit
Global options can also be configured via upper-case, underscore-delimited environment
variables prefixed with "GREYMATTER_". For example, "--some-flag" becomes
"GREYMATTER_SOME_FLAG". Command-line flags take precedence over environment variables.
OPTIONS
--deep (default: false)
if true, delete the entire object graph below the specified object
--help (default: false)
Show a list of commands or help for one command
--key=string
[deprecated] key of the object to delete
--version
(default: false)
Print the version and exit
Options can also be configured via upper-case, underscore-delimited environment
variables prefixed with "GREYMATTER_DELETE_". For example, "--some-flag" becomes
"GREYMATTER_DELETE_SOME_FLAG". Command-line flags take precedence over environment
variables.{
"zone_key": "zone-default-zone",
"name": "catalog",
"ip": "0.0.0.0",
"port": 8080,
"protocol": "http_auto",
"domain_keys": ["domain-*"],
"tracing_config": null,
"checksum": "5e3f86011c958c05fbb51a51f9363bd014bef5aa4505728daf4dd35db440ff01"
}$ ./greymatter create domain < listener-catalog.json
[info] 2019/07/10 03:43:46 Preferring --api.key for authentication
{
"domain_key": "domain-catalog",
"zone_key": "zone-default-zone",
"name": "catalog",
"port": 8080,
"redirects": null,
"gzip_enabled": false,
"cors_config": null,
"aliases": null,
"force_https": false,
"checksum": "82581e0c56c2ad385e84234fe118ccf8cf8deb1852a5aa318eab887e9a2717d2"
}EDITOR=vim greymatter create domain[info] 2019/07/10 03:38:43 Preferring --api.key for authentication
{
"domain_key": "domain-localhost",
"zone_key": "zone-default",
"name": "localhost",
"port": 443,
"redirects": null,
"gzip_enabled": false,
"cors_config": null,
"aliases": null,
"force_https": false,
"checksum": "a35ccf0634599ac83b0b9cb61b07297e925f28bbc669a9a63cb65b9c6a6ea309"
}$ greymatter create --help
NAME
create - create an object within the Grey Matter API
USAGE
greymatter [GLOBAL OPTIONS] create [OPTIONS] <object type>
VERSION
v1.2.1
DESCRIPTION
object type is one of: zone, proxy, listener, domain, route, shared_rules, cluster
Editor Selection
When changes need to be made an initial version of the object can be presented in an
editor. The command used to launch the editor is taken from the EDITOR environment
variable and must block execution until the changes are saved and the editor is
closed. The current editor command is 'vim'.
Example EDITOR values:
vim
emacs
atom -w
Using STDIN
For scripting purposes it may be useful to use STDIN to provide the created object
instead of using an interactive editor. If so, simply make the new version available
on STDIN through standard use of pipes.
Example: cat "new_cluster.json" | greymatter create cluster
GLOBAL OPTIONS
--api.header=header
Specifies a custom header to send with every API request. Headers are given as
name:value pairs. Leading and trailing whitespace will be stripped from the
name and value. For multiple headers, this flag may be repeated or multiple
headers can be delimited with commas.
--api.host=host:port
(default: localhost:80)
The address (host:port) for API requests. If no port is given, it defaults to
port 443 if --api.ssl is true and port 80 otherwise.
--api.insecure
(default: false)
If true, don't validate server cert when using SSL for API requests
--api.key=string
(default: "none")
[SENSITIVE] The auth key for API requests
--api.prefix=value
The url prefix for API requests. Forms the path part of <host>:<port><path>
--api.ssl
(default: true)
If true, use SSL for API requests
--api.sslCert=value
Specifies the SSL cert to use for every API request.
--api.sslKey=value
Specifies the SSL key to use for every API request.
--console.level=level
(default: "info")
(valid values: "debug", "info", "error", or "none")
Selects the log level for console logs messages.
--format=string
(default: "json")
The I/O format (json or yaml)
--help (default: false)
Show a list of commands or help for one command
--version
(default: false)
Print the version and exit
Global options can also be configured via upper-case, underscore-delimited environment
variables prefixed with "GREYMATTER_". For example, "--some-flag" becomes
"GREYMATTER_SOME_FLAG". Command-line flags take precedence over environment variables.
OPTIONS
--help (default: false)
Show a list of commands or help for one command
--version
(default: false)
Print the version and exit
Options can also be configured via upper-case, underscore-delimited environment
variables prefixed with "GREYMATTER_CREATE_". For example, "--some-flag" becomes
"GREYMATTER_CREATE_SOME_FLAG". Command-line flags take precedence over environment
variables.$ greymatter --help
NAME
greymatter - Command line tool for interacting with the Grey Matter API
USAGE
greymatter [GLOBAL OPTIONS] <command> [COMMAND OPTIONS] [arguments...]
VERSION
v1.2.1
COMMANDS
list list all of a particular object in the Grey Matter API
get retrieve an object from the Grey Matter API
create create an object within the Grey Matter API
edit edit an object from the Grey Matter API
delete delete an object from the Grey Matter API
export-zone
export a Zone from the Grey Matter API
import-zone
import a Zone to the Grey Matter API
GLOBAL OPTIONS
--api.header=header
Specifies a custom header to send with every API request. Headers are given as
name:value pairs. Leading and trailing whitespace will be stripped from the
name and value. For multiple headers, this flag may be repeated or multiple
headers can be delimited with commas.
--api.host=host:port
(default: localhost:80)
The address (host:port) for API requests. If no port is given, it defaults to
port 443 if --api.ssl is true and port 80 otherwise.
--api.insecure
(default: false)
If true, don't validate server cert when using SSL for API requests
--api.key=string
(default: "none")
[SENSITIVE] The auth key for API requests
--api.prefix=value
The url prefix for API requests. Forms the path part of <host>:<port><path>
--api.ssl
(default: true)
If true, use SSL for API requests
--api.sslCert=value
Specifies the SSL cert to use for every API request.
--api.sslKey=value
Specifies the SSL key to use for every API request.
--console.level=level
(default: "info")
(valid values: "debug", "info", "error", or "none")
Selects the log level for console logs messages.
--format=string
(default: "json")
The I/O format (json or yaml)
--help (default: false)
Show a list of commands or help for one command
--version
(default: false)
Print the version and exit
Global options can also be configured via upper-case, underscore-delimited environment
variables prefixed with "GREYMATTER_". For example, "--some-flag" becomes
"GREYMATTER_SOME_FLAG". Command-line flags take precedence over environment variables.
Run "greymatter help <command>" for more details on a specific command.{
"num_retries": 2,
"per_try_timeout_msec": 60000,
"timeout_msec": 60000
}




