-
Notifications
You must be signed in to change notification settings - Fork 326
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
598 additions
and
2,024 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
package connectinject | ||
|
||
const ( | ||
// annotationStatus is the key of the annotation that is added to | ||
// a pod after an injection is done. | ||
annotationStatus = "consul.hashicorp.com/connect-inject-status" | ||
|
||
// annotationInject is the key of the annotation that controls whether | ||
// injection is explicitly enabled or disabled for a pod. This should | ||
// be set to a truthy or falsy value, as parseable by strconv.ParseBool | ||
annotationInject = "consul.hashicorp.com/connect-inject" | ||
|
||
// annotationService is the name of the service to proxy. This defaults | ||
// to the name of the first container. | ||
annotationService = "consul.hashicorp.com/connect-service" | ||
|
||
// annotationPort is the name or value of the port to proxy incoming | ||
// connections to. | ||
annotationPort = "consul.hashicorp.com/connect-service-port" | ||
|
||
// annotationProtocol contains the protocol that should be used for | ||
// the service that is being injected. Valid values are "http", "http2", | ||
// "grpc" and "tcp". | ||
// | ||
// Deprecated: This annotation is no longer supported. | ||
annotationProtocol = "consul.hashicorp.com/connect-service-protocol" | ||
|
||
// annotationUpstreams is a list of upstreams to register with the | ||
// proxy in the format of `<service-name>:<local-port>,...`. The | ||
// service name should map to a Consul service namd and the local port | ||
// is the local port in the pod that the listener will bind to. It can | ||
// be a named port. | ||
annotationUpstreams = "consul.hashicorp.com/connect-service-upstreams" | ||
|
||
// annotationTags is a list of tags to register with the service | ||
// this is specified as a comma separated list e.g. abc,123 | ||
annotationTags = "consul.hashicorp.com/service-tags" | ||
|
||
// annotationConnectTags is a list of tags to register with the service | ||
// this is specified as a comma separated list e.g. abc,123 | ||
// | ||
// Deprecated: 'consul.hashicorp.com/service-tags' is the new annotation | ||
// and should be used instead. We made this change because the tagging is | ||
// not specific to connect as both the connect proxy *and* the Consul | ||
// service that gets registered is tagged. | ||
annotationConnectTags = "consul.hashicorp.com/connect-service-tags" | ||
|
||
// annotationMeta is a list of metadata key/value pairs to add to the service | ||
// registration. This is specified in the format `<key>:<value>` | ||
// e.g. consul.hashicorp.com/service-meta-foo:bar | ||
annotationMeta = "consul.hashicorp.com/service-meta-" | ||
|
||
// annotationSyncPeriod controls the -sync-period flag passed to the | ||
// consul-k8s consul-sidecar command. This flag controls how often the | ||
// service is synced (i.e. re-registered) with the local agent. | ||
// | ||
// Deprecated: This annotation is no longer supported. | ||
annotationSyncPeriod = "consul.hashicorp.com/connect-sync-period" | ||
|
||
// annotations for sidecar proxy resource limits | ||
annotationSidecarProxyCPULimit = "consul.hashicorp.com/sidecar-proxy-cpu-limit" | ||
annotationSidecarProxyCPURequest = "consul.hashicorp.com/sidecar-proxy-cpu-request" | ||
annotationSidecarProxyMemoryLimit = "consul.hashicorp.com/sidecar-proxy-memory-limit" | ||
annotationSidecarProxyMemoryRequest = "consul.hashicorp.com/sidecar-proxy-memory-request" | ||
|
||
// annotations for metrics to configure where Prometheus scrapes | ||
// metrics from, whether to run a merged metrics endpoint on the consul | ||
// sidecar, and configure the connect service metrics. | ||
annotationEnableMetrics = "consul.hashicorp.com/enable-metrics" | ||
annotationEnableMetricsMerging = "consul.hashicorp.com/enable-metrics-merging" | ||
annotationMergedMetricsPort = "consul.hashicorp.com/merged-metrics-port" | ||
annotationPrometheusScrapePort = "consul.hashicorp.com/prometheus-scrape-port" | ||
annotationPrometheusScrapePath = "consul.hashicorp.com/prometheus-scrape-path" | ||
annotationServiceMetricsPort = "consul.hashicorp.com/service-metrics-port" | ||
annotationServiceMetricsPath = "consul.hashicorp.com/service-metrics-path" | ||
|
||
// annotationEnvoyExtraArgs is a space-separated list of arguments to be passed to the | ||
// envoy binary. See list of args here: https://www.envoyproxy.io/docs/envoy/latest/operations/cli | ||
// e.g. consul.hashicorp.com/envoy-extra-args: "--log-level debug --disable-hot-restart" | ||
// The arguments passed in via this annotation will take precendence over arguments | ||
// passed via the -envoy-extra-args flag. | ||
annotationEnvoyExtraArgs = "consul.hashicorp.com/envoy-extra-args" | ||
|
||
// annotationConsulNamespace is the Consul namespace the service is registered into. | ||
annotationConsulNamespace = "consul.hashicorp.com/consul-namespace" | ||
|
||
// injected is used as the annotation value for annotationInjected | ||
injected = "injected" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.