Documentation
¶
Overview ¶
Package properties provides helper functions for retrieving properties in the Envoy/Istio specific environment.
WARNING: There's absolutely no guarantee that all properties will be available across versions, and the availability is totally dependent of the configuration, so users are highly encouraged to ensure that plugins work as expected when deploying the plugins using these properties.
Index ¶
- func GetClusterName() (string, error)
- func GetDownstreamConnectionID() (uint64, error)
- func GetDownstreamDnsSanLocalCertificate() (string, error)
- func GetDownstreamDnsSanPeerCertificate() (string, error)
- func GetDownstreamLocalAddress() (string, error)
- func GetDownstreamLocalPort() (uint64, error)
- func GetDownstreamRemoteAddress() (string, error)
- func GetDownstreamRemotePort() (uint64, error)
- func GetDownstreamRequestedServerName() (string, error)
- func GetDownstreamSha256PeerCertificateDigest() (string, error)
- func GetDownstreamSubjectLocalCertificate() (string, error)
- func GetDownstreamSubjectPeerCertificate() (string, error)
- func GetDownstreamTerminationDetails() (string, error)
- func GetDownstreamTlsVersion() (string, error)
- func GetDownstreamUriSanLocalCertificate() (string, error)
- func GetDownstreamUriSanPeerCertificate() (string, error)
- func GetNodeClientFeatures() ([]string, error)
- func GetNodeCluster() (string, error)
- func GetNodeDynamicParams() (string, error)
- func GetNodeId() (string, error)
- func GetNodeListeningAddresses() ([]string, error)
- func GetNodeMetaAnnotations() (map[string]string, error)
- func GetNodeMetaAppContainers() (string, error)
- func GetNodeMetaClusterId() (string, error)
- func GetNodeMetaEnvoyPrometheusPort() (float64, error)
- func GetNodeMetaEnvoyStatusPort() (float64, error)
- func GetNodeMetaInstanceIps() (string, error)
- func GetNodeMetaIstioProxySha() (string, error)
- func GetNodeMetaIstioVersion() (string, error)
- func GetNodeMetaLabels() (map[string]string, error)
- func GetNodeMetaMeshId() (string, error)
- func GetNodeMetaName() (string, error)
- func GetNodeMetaNamespace() (string, error)
- func GetNodeMetaNodeName() (string, error)
- func GetNodeMetaOwner() (string, error)
- func GetNodeMetaPilotSan() ([]string, error)
- func GetNodeMetaPodPorts() (string, error)
- func GetNodeMetaProxyConfigBinaryPath() (string, error)
- func GetNodeMetaProxyConfigConcurrency() (float64, error)
- func GetNodeMetaProxyConfigConfigPath() (string, error)
- func GetNodeMetaServiceAccount() (string, error)
- func GetNodeMetaWorkloadName() (string, error)
- func GetNodeProxyConfigControlPlaneAuthPolicy() (string, error)
- func GetNodeProxyConfigDiscoveryAddress() (string, error)
- func GetNodeProxyConfigDrainDuration() (string, error)
- func GetNodeProxyConfigExtraStatTags() ([]string, error)
- func GetNodeProxyConfigHoldApplicationUntilProxyStarts() (bool, error)
- func GetNodeProxyConfigProxyAdminPort() (float64, error)
- func GetNodeProxyConfigServiceCluster() (string, error)
- func GetNodeProxyConfigStatNameLength() (float64, error)
- func GetNodeProxyConfigStatusPort() (float64, error)
- func GetNodeProxyConfigTerminationDrainDuration() (string, error)
- func GetNodeProxyConfigTracingDatadogAddress() (string, error)
- func GetNodeProxyConfigTracingOpenCensusAgentAddress() (string, error)
- func GetNodeProxyConfigTracingZipkinAddress() (string, error)
- func GetNodeUserAgentBuildVersion() (string, error)
- func GetNodeUserAgentName() (string, error)
- func GetNodeUserAgentVersion() (string, error)
- func GetPluginName() (string, error)
- func GetPluginRootId() (string, error)
- func GetPluginVmId() (string, error)
- func GetRequestDuration() (uint64, error)
- func GetRequestHeaders() (map[string]string, error)
- func GetRequestHost() (string, error)
- func GetRequestId() (string, error)
- func GetRequestMethod() (string, error)
- func GetRequestPath() (string, error)
- func GetRequestProtocol() (string, error)
- func GetRequestQuery() (string, error)
- func GetRequestReferer() (string, error)
- func GetRequestScheme() (string, error)
- func GetRequestSize() (uint64, error)
- func GetRequestTime() (time.Time, error)
- func GetRequestTotalSize() (uint64, error)
- func GetRequestUrlPath() (string, error)
- func GetRequestUserAgent() (string, error)
- func GetResponseCode() (uint64, error)
- func GetResponseCodeDetails() (string, error)
- func GetResponseFlags() (uint64, error)
- func GetResponseGrpcStatusCode() (uint64, error)
- func GetResponseHeaders() (map[string]string, error)
- func GetResponseSize() (uint64, error)
- func GetResponseTotalSize() (uint64, error)
- func GetResponseTrailers() (map[string]string, error)
- func GetRouteName() (string, error)
- func GetUpstreamAddress() (string, error)
- func GetUpstreamDnsSanLocalCertificate() (string, error)
- func GetUpstreamDnsSanPeerCertificate() (string, error)
- func GetUpstreamLocalAddress() (string, error)
- func GetUpstreamPort() (uint64, error)
- func GetUpstreamSha256PeerCertificateDigest() (string, error)
- func GetUpstreamSubjectLocalCertificate() (string, error)
- func GetUpstreamSubjectPeerCertificate() (string, error)
- func GetUpstreamTlsVersion() (string, error)
- func GetUpstreamTransportFailureReason() (string, error)
- func GetUpstreamUriSanLocalCertificate() (string, error)
- func GetUpstreamUriSanPeerCertificate() (string, error)
- func GetXdsClusterName() (string, error)
- func GetXdsListenerFilterChainName() (string, error)
- func GetXdsRouteName() (string, error)
- func IsDownstreamConnectionTls() (bool, error)
- type EnvoyExtension
- type EnvoyLocality
- type EnvoyTrafficDirection
- type IstioFilterMetadata
- func GetClusterMetadata() (IstioFilterMetadata, error)
- func GetListenerMetadata() (IstioFilterMetadata, error)
- func GetRouteMetadata() (IstioFilterMetadata, error)
- func GetUpstreamHostMetadata() (IstioFilterMetadata, error)
- func GetXdsClusterMetadata() (IstioFilterMetadata, error)
- func GetXdsRouteMetadata() (IstioFilterMetadata, error)
- func GetXdsUpstreamHostMetadata() (IstioFilterMetadata, error)
- type IstioProxyStatsMatcher
- type IstioService
- type IstioTrafficInterceptionMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClusterName ¶
GetClusterName returns the upstream cluster name.
Example value: "outbound|80||httpbin.org".
func GetDownstreamConnectionID ¶
GetDownstreamConnectionID returns the connection ID of the downstream connection.
func GetDownstreamDnsSanLocalCertificate ¶
GetDownstreamDnsSanLocalCertificate returns The first DNS entry in the SAN field of the local certificate in the downstream TLS connection.
func GetDownstreamDnsSanPeerCertificate ¶
GetDownstreamDnsSanPeerCertificate returns The first DNS entry in the SAN field of the peer certificate in the downstream TLS connection.
func GetDownstreamLocalAddress ¶
GetDownstreamLocalAddress returns the local address of the downstream connection.
func GetDownstreamLocalPort ¶
GetDownstreamLocalPort returns the local port of the downstream connection.
func GetDownstreamRemoteAddress ¶
GetDownstreamRemoteAddress returns the remote address of the downstream connection.
func GetDownstreamRemotePort ¶
GetDownstreamRemotePort returns the remote port of the downstream connection.
func GetDownstreamRequestedServerName ¶
GetDownstreamRequestedServerName returns the requested server name of the downstream connection.
func GetDownstreamSha256PeerCertificateDigest ¶
GetDownstreamSha256PeerCertificateDigest returns the SHA256 digest of a peer certificate digest of the downstream connection.
func GetDownstreamSubjectLocalCertificate ¶
GetDownstreamSubjectLocalCertificate returns the subject field of the local certificate in the downstream TLS connection.
func GetDownstreamSubjectPeerCertificate ¶
GetDownstreamSubjectPeerCertificate returns the subject field of the peer certificate in the downstream TLS connection.
func GetDownstreamTerminationDetails ¶
GetDownstreamTerminationDetails returns the internal termination details of the connection (subject to change).
func GetDownstreamTlsVersion ¶
GetDownstreamTlsVersion returns the TLS version of the downstream connection.
func GetDownstreamUriSanLocalCertificate ¶
GetDownstreamUriSanLocalCertificate returns the first URI entry in the SAN field of the local certificate in the downstream TLS connection
func GetDownstreamUriSanPeerCertificate ¶
GetDownstreamUriSanPeerCertificate returns The first URI entry in the SAN field of the peer certificate in the downstream TLS connection.
func GetNodeClientFeatures ¶
GetNodeClientFeatures returns the node client features. These are well known features described in the Envoy API repository for a given major version of an API. Client features use reverse DNS naming scheme, for example "com.acme.feature".
func GetNodeCluster ¶
GetNodeCluster returns the node cluster, which defines the local service cluster name where envoy is running. Though optional, it should be set if any of the following features are used: statsd, health check cluster verification, runtime override directory, user agent addition, HTTP global rate limiting, CDS, and HTTP tracing, either in this message or via --service-cluster
Example value: istio-ingress.istio-ingress
func GetNodeDynamicParams ¶
GetNodeDynamicParams returns the node dynamic parameters. These may vary at runtime (unlike other fields in this message). For example, the xDS client may have a shared identifier that changes during the lifetime of the xDS client. In Envoy, this would be achieved by updating the dynamic context on the Server::Instance’s LocalInfo context provider. The shard ID dynamic parameter then appears in this field during future discovery requests
func GetNodeId ¶
GetNodeId returns the node id, an opaque node identifier for the Envoy node. This also provides the local service node name. It should be set if any of the following features are used: statsd, CDS, and HTTP tracing, either in this message or via --service-node
Example value: router~10.244.0.22~istio-ingress-6d78c67d85-qsbtz.istio-ingress~istio-ingress.svc.cluster.local
func GetNodeListeningAddresses ¶
GetNodeListeningAddresses returns the node listening addresses.
func GetNodeMetaAnnotations ¶
GetNodeMetaAnnotations returns the node annotations
func GetNodeMetaAppContainers ¶
GetNodeMetaAppContainers returns the app containers of the node
func GetNodeMetaClusterId ¶
GetNodeMetaClusterId returns the cluster ID of the node, which defines the cluster the node belongs to
func GetNodeMetaEnvoyPrometheusPort ¶
GetNodeMetaEnvoyPrometheusPort returns the Envoy Prometheus port of the node
func GetNodeMetaEnvoyStatusPort ¶
GetNodeMetaEnvoyStatusPort returns the Envoy status port of the node
func GetNodeMetaInstanceIps ¶
GetNodeMetaInstanceIps returns the instance IPs of the node
func GetNodeMetaIstioProxySha ¶
GetNodeMetaIstioProxySha returns the Istio proxy SHA of the node
func GetNodeMetaIstioVersion ¶
GetNodeMetaIstioVersion returns the Istio version of the node
func GetNodeMetaLabels ¶
GetNodeMetaLabels returns the labels of the node
func GetNodeMetaMeshId ¶
GetNodeMetaMeshId returns the mesh ID of the node
func GetNodeMetaName ¶
GetNodeMetaName returns the name of the node
func GetNodeMetaNamespace ¶
GetNodeMetaNamespace returns the namespace of the node
func GetNodeMetaNodeName ¶
GetNodeMetaNodeName returns the node name of the node
func GetNodeMetaOwner ¶
GetNodeMetaOwner returns the owner of the node (opaque string). Typically, this is the owning controller of of the workload instance (ex: k8s deployment for a k8s pod)
func GetNodeMetaPilotSan ¶
GetNodeMetaPilotSan returns the pilot SAN (subject alternate names) of the node's xDS server
func GetNodeMetaPodPorts ¶
GetNodeMetaPodPorts returns the pod ports of the node. This is used to lookup named ports
func GetNodeMetaProxyConfigBinaryPath ¶
GetNodeMetaProxyConfigBinaryPath returns the path to the proxy binary
func GetNodeMetaProxyConfigConcurrency ¶
GetNodeMetaProxyConfigConcurrency returns the concurrency configuration of the proxy which is the number of worker threads to run. If unset, this will be automatically determined based on CPU requests/limits. If set to 0, all cores on the machine will be used. Default is 2 worker threads
func GetNodeMetaProxyConfigConfigPath ¶
GetNodeMetaProxyConfigConfigPath returns the path to the proxy configuration, Proxy agent generates the actual configuration and stores it in this directory
func GetNodeMetaServiceAccount ¶
GetNodeMetaServiceAccount returns the service account of the node
func GetNodeMetaWorkloadName ¶
GetNodeMetaWorkloadName returns the workload name of the node
func GetNodeProxyConfigControlPlaneAuthPolicy ¶
GetNodeProxyConfigControlPlaneAuthPolicy returns the control plane authentication policy of the proxy. The authenticationPolicy defines how the proxy is authenticated when it connects to the control plane. Default is set to MUTUAL_TLS
func GetNodeProxyConfigDiscoveryAddress ¶
GetNodeProxyConfigDiscoveryAddress returns the discovery address of the proxy. The discovery service exposes xDS over an mTLS connection. The inject configuration may override this value
func GetNodeProxyConfigDrainDuration ¶
GetNodeProxyConfigDrainDuration returns the drain duration of the proxy, the time in seconds that Envoy will drain connections during a hot restart. MUST be >=1s (e.g., 1s/1m/1h). Default drain duration is 45s
func GetNodeProxyConfigExtraStatTags ¶
GetNodeProxyConfigExtraStatTags returns the extra stat tags of the proxy to extract from the in-proxy Istio telemetry. These extra tags can be added by configuring the telemetry extension. Each additional tag needs to be present in this list. Extra tags emitted by the telemetry extensions must be listed here so that they can be processed and exposed as Prometheus metrics
func GetNodeProxyConfigHoldApplicationUntilProxyStarts ¶
GetNodeProxyConfigHoldApplicationUntilProxyStarts returns whether to hold the application until the proxy starts. A boolean flag for enabling/disabling the holdApplicationUntilProxyStarts behavior. This feature adds hooks to delay application startup until the pod proxy is ready to accept traffic, mitigating some startup race conditions. Default value is ‘false’
func GetNodeProxyConfigProxyAdminPort ¶
GetNodeProxyConfigProxyAdminPort returns the admin port of the proxy for administrative commands. Default port is 15000
func GetNodeProxyConfigServiceCluster ¶
GetNodeProxyConfigServiceCluster returns the name of the service cluster of the proxy that is shared by all Envoy instances. This setting corresponds to --service-cluster flag in Envoy. In a typical Envoy deployment, the service-cluster flag is used to identify the caller, for source-based routing scenarios. Since Istio does not assign a local service version to each Envoy instance, the name is same for all of them. However, the source/caller’s identity (e.g., IP address) is encoded in the --service-node flag when launching Envoy. When the RDS service receives API calls from Envoy, it uses the value of the service-node flag to compute routes that are relative to the service instances located at that IP address
func GetNodeProxyConfigStatNameLength ¶
GetNodeProxyConfigStatNameLength returns the stat name length of the proxy, The length of the name field is determined by the length of a name field in a service and the set of labels that comprise a particular version of the service. The default value is set to 189 characters. Envoy’s internal metrics take up 67 characters, for a total of 256 character name per metric. Increase the value of this field if you find that the metrics from Envoys are truncated
func GetNodeProxyConfigStatusPort ¶
GetNodeProxyConfigStatusPort returns the port on which the agent should listen for administrative commands such as readiness probe. Default is set to port 15020
func GetNodeProxyConfigTerminationDrainDuration ¶
GetNodeProxyConfigTerminationDrainDuration returns the stat name length of the proxy, the amount of time allowed for connections to complete on proxy shutdown. On receiving SIGTERM or SIGINT, istio-agent tells the active Envoy to start draining, preventing any new connections and allowing existing connections to complete. It then sleeps for the termination_drain_duration and then kills any remaining active Envoy processes. If not set, a default of 5s will be applied
func GetNodeProxyConfigTracingDatadogAddress ¶
GetNodeProxyConfigTracingDatadogAddress returns the address of the Datadog service (e.g. datadog-agent.sre.svc.cluster.local:8126)
func GetNodeProxyConfigTracingOpenCensusAgentAddress ¶
GetNodeProxyConfigTracingOpenCensusAgentAddress returns the gRPC address for the OpenCensus agent (e.g. dns://authority/host:port or unix:path)
func GetNodeProxyConfigTracingZipkinAddress ¶
GetNodeProxyConfigTracingZipkinAddress returns address of the Zipkin service (e.g. zipkin.sre.svc.cluster.local:9411)
func GetNodeUserAgentBuildVersion ¶
GetNodeUserAgentBuildVersion returns the node user agent build version.
func GetNodeUserAgentName ¶
GetNodeUserAgentName returns the node user agent name.
Example: “envoy” or “grpc”.
func GetNodeUserAgentVersion ¶
GetNodeUserAgentVersion returns the node user agent version.
Example “1.12.2” or “abcd1234”, or “SpecialEnvoyBuild”.
func GetPluginName ¶
GetPluginName returns the plugin name.
This matches <metadata.name>.<metadata.namespace> in an istio WasmPlugin CR.
func GetPluginRootId ¶
GetPluginRootId returns the plugin root id.
This matches the <spec.pluginName> in the istio WasmPlugin CR.
func GetRequestDuration ¶
GetRequestDuration returns the total duration of the request, approximated to nano-seconds.
func GetRequestHeaders ¶
GetRequestHeaders returns all request headers indexed by the lower-cased header name.
func GetRequestHost ¶
GetRequestHost returns the host portion of the URL.
func GetRequestId ¶
GetRequestId returns the request ID corresponding to x-request-id header value.
func GetRequestMethod ¶
GetRequestMethod returns the request method e.g. “GET”.
func GetRequestPath ¶
GetRequestPath return the path portion of the URL.
func GetRequestProtocol ¶
GetRequestProtocol returns the request protocol (“HTTP/1.0”, “HTTP/1.1”, “HTTP/2”, or “HTTP/3”).
func GetRequestQuery ¶
GetRequestQuery returns the query portion of the URL in the format of “name1=value1&name2=value2”.
func GetRequestReferer ¶
GetRequestReferer returns the referer request header.
func GetRequestScheme ¶
GetRequestScheme returns the scheme portion of the URL e.g. “http”.
func GetRequestSize ¶
GetRequestSize returns the size of the request body. Content length header is used if available.
func GetRequestTime ¶
GetRequestTime returns the UTC time of the first byte received, approximated to nano-seconds.
func GetRequestTotalSize ¶
GetRequestTotalSize returns the total size of the request including the approximate uncompressed size of the headers.
func GetRequestUrlPath ¶
GetRequestUrlPath returns the path portion of the URL without the query string.
func GetRequestUserAgent ¶
GetRequestUserAgent returns the user agent request header.
func GetResponseCode ¶
GetResponseCode returns the response HTTP status code.
func GetResponseCodeDetails ¶
GetResponseCodeDetails returns the internal response code details (subject to change).
func GetResponseFlags ¶
GetResponseFlags returns additional details about the response beyond the standard response code encoded as a bit-vector.
func GetResponseGrpcStatusCode ¶
GetResponseGrpcStatusCode returns the response gRPC status code.
func GetResponseHeaders ¶
GetResponseHeaders returns all response headers indexed by the lower-cased header name.
func GetResponseSize ¶
GetResponseSize returns the size of the response body.
func GetResponseTotalSize ¶
GetResponseTotalSize returns the total size of the response including the approximate uncompressed size of the headers and the trailers.
func GetResponseTrailers ¶
GetResponseTrailers returns all response trailers indexed by the lower-cased trailer name.
func GetRouteName ¶
GetRouteName returns the route name, only available in the response path (cfr getXdsRouteName()).
This matches the <spec.http.name> in the istio VirtualService CR.
func GetUpstreamAddress ¶
GetUpstreamAddress returns the upstream connection remote address.
func GetUpstreamDnsSanLocalCertificate ¶
GetUpstreamDnsSanLocalCertificate returns the first DNS entry in the SAN field of the local certificate in the upstream TLS connection.
func GetUpstreamDnsSanPeerCertificate ¶
GetUpstreamDnsSanPeerCertificate returns the first DNS entry in the SAN field of the peer certificate in the upstream TLS connection.
func GetUpstreamLocalAddress ¶
GetUpstreamLocalAddress returns the local address of the upstream connection.
func GetUpstreamPort ¶
GetUpstreamPort returns the upstream connection remote port.
func GetUpstreamSha256PeerCertificateDigest ¶
GetUpstreamSha256PeerCertificateDigest returns the SHA256 digest of the peer certificate in the upstream TLS connection if present.
func GetUpstreamSubjectLocalCertificate ¶
GetUpstreamSubjectLocalCertificate returns the subject field of the local certificate in the upstream TLS connection.
func GetUpstreamSubjectPeerCertificate ¶
GetUpstreamSubjectPeerCertificate returns the subject field of the peer certificate in the upstream TLS connection.
func GetUpstreamTlsVersion ¶
GetUpstreamTlsVersion returns the TLS version of the upstream TLS connection.
func GetUpstreamTransportFailureReason ¶
GetUpstreamTransportFailureReason returns the upstream transport failure reason e.g. certificate validation failed.
func GetUpstreamUriSanLocalCertificate ¶
GetUpstreamUriSanLocalCertificate returns the first URI entry in the SAN field of the local certificate in the upstream TLS connection.
func GetUpstreamUriSanPeerCertificate ¶
GetUpstreamUriSanPeerCertificate returns the first URI entry in the SAN field of the peer certificate in the upstream TLS connection.
func GetXdsClusterName ¶
GetXdsClusterName returns the upstream cluster name.
Example value: "outbound|80||httpbin.org".
func GetXdsListenerFilterChainName ¶
GetXdsListenerFilterChainName returns the listener filter chain name.
func GetXdsRouteName ¶
GetXdsRouteName returns the upstream route name (available in both the request response path, cfr getRouteName()). This matches the <spec.http.name> in an istio VirtualService CR.
func IsDownstreamConnectionTls ¶
IsDownstreamConnectionTls returns true if the downstream connection is TLS.
Types ¶
type EnvoyExtension ¶
EnvoyExtension holds version and identification for an Envoy extension.
func GetNodeExtensions ¶
func GetNodeExtensions() ([]EnvoyExtension, error)
GetNodeExtensions returns the node extensions.
type EnvoyLocality ¶
EnvoyLocality identifies location of where either Envoy runs or where upstream hosts run.
https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/base.proto#config-core-v3-locality
func GetNodeLocality ¶
func GetNodeLocality() (EnvoyLocality, error)
GetNodeLocality returns the node locality.
type EnvoyTrafficDirection ¶
type EnvoyTrafficDirection int
EnvoyTrafficDirection identifies the direction of the traffic relative to the local Envoy.
const ( // EnvoyTrafficDirectionUnspecified means that the direction is not specified. EnvoyTrafficDirectionUnspecified EnvoyTrafficDirection = iota // EnvoyTrafficDirectionInbound means that the transport is used for incoming traffic. EnvoyTrafficDirectionInbound // EnvoyTrafficDirectionOutbound means that the transport is used for outgoing traffic. EnvoyTrafficDirectionOutbound )
func GetListenerDirection ¶
func GetListenerDirection() (EnvoyTrafficDirection, error)
GetListenerDirection returns the listener direction.
Possible values are:
- UNSPECIFIED: 0 (default option is unspecified)
- INBOUND: 1 (the transport is used for incoming traffic)
- OUTBOUND: 2 (the transport is used for outgoing traffic)
func (EnvoyTrafficDirection) String ¶
func (t EnvoyTrafficDirection) String() string
String converts the EnvoyTrafficDirection enum value to its corresponding string representation. It returns "UNSPECIFIED" for Unspecified, "INBOUND" for Inbound, and "OUTBOUND" for Outbound. If the enum value doesn't match any of the predefined values, it defaults to "UNSPECIFIED".
type IstioFilterMetadata ¶
type IstioFilterMetadata struct { Config string Services []IstioService }
IstioFilterMetadata provides additional inputs to filters based on matched listeners, filter chains, routes and endpoints. It is structured as a map, usually from filter name (in reverse DNS format) to metadata specific to the filter. Metadata key-values for a filter are merged as connection and request handling occurs, with later values for the same key overriding earlier values.
https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/base.proto#config-core-v3-metadata
func GetClusterMetadata ¶
func GetClusterMetadata() (IstioFilterMetadata, error)
GetClusterMetadata returns the cluster metadata.
func GetListenerMetadata ¶
func GetListenerMetadata() (IstioFilterMetadata, error)
GetListenerMetadata returns the listener metadata.
func GetRouteMetadata ¶
func GetRouteMetadata() (IstioFilterMetadata, error)
GetRouteMetadata returns the route metadata.
func GetUpstreamHostMetadata ¶
func GetUpstreamHostMetadata() (IstioFilterMetadata, error)
GetUpstreamHostMetadata returns the upstream host metadata.
func GetXdsClusterMetadata ¶
func GetXdsClusterMetadata() (IstioFilterMetadata, error)
GetXdsClusterMetadata returns the upstream cluster metadata.
func GetXdsRouteMetadata ¶
func GetXdsRouteMetadata() (IstioFilterMetadata, error)
GetXdsRouteMetadata returns the upstream route metadata.
func GetXdsUpstreamHostMetadata ¶
func GetXdsUpstreamHostMetadata() (IstioFilterMetadata, error)
GetXdsUpstreamHostMetadata returns the upstream host metadata.
type IstioProxyStatsMatcher ¶
type IstioProxyStatsMatcher struct { InclusionPrefixes []string InclusionRegexps []string InclusionSuffixes []string }
IstioProxyStatsMatcher holds proxy stats name matches for stats creation. Note this is in addition to the minimum Envoy stats that Istio generates by default.
https://istio.io/latest/docs/reference/config/istio.mesh.v1alpha1/#ProxyConfig-ProxyStatsMatcher
func GetNodeProxyConfigProxyStatsMatcher ¶
func GetNodeProxyConfigProxyStatsMatcher() (IstioProxyStatsMatcher, error)
GetNodeProxyConfigProxyStatsMatcher returns the proxy stats matcher, which defines configuration for reporting custom Envoy stats. To reduce memory and CPU overhead from Envoy stats system, Istio proxies by default create and expose only a subset of Envoy stats. This option is to control creation of additional Envoy stats with prefix, suffix, and regex expressions match on the name of the stats. This replaces the stats inclusion annotations (sidecar.istio.io/statsInclusionPrefixes, sidecar.istio.io/statsInclusionRegexps, and sidecar.istio.io/statsInclusionSuffixes)
type IstioService ¶
IstioService holds information of the host, name and namespace of an Istio Service.
type IstioTrafficInterceptionMode ¶
type IstioTrafficInterceptionMode int
IstioTrafficInterceptionMode indicates how traffic to/from the workload is captured and sent to Envoy. This should not be confused with the CaptureMode in the API that indicates how the user wants traffic to be intercepted for the listener. IstioTrafficInterceptionMode is always derived from the Proxy metadata.
https://pkg.go.dev/istio.io/istio/pilot/pkg/model#TrafficInterceptionMode
const ( // IstioTrafficInterceptionModeNone indicates that the workload is not using IPtables for traffic interception. IstioTrafficInterceptionModeNone IstioTrafficInterceptionMode = iota // IstioTrafficInterceptionModeTproxy implies traffic intercepted by IPtables with TPROXY mode. IstioTrafficInterceptionModeTproxy // IstioTrafficInterceptionModeRedirect implies traffic intercepted by IPtables with REDIRECT mode. This is our default mode. IstioTrafficInterceptionModeRedirect )
func GetNodeMetaInterceptionMode ¶
func GetNodeMetaInterceptionMode() (IstioTrafficInterceptionMode, error)
GetNodeMetaInterceptionMode returns the interception mode of the node
Possible values:
REDIRECT : REDIRECT mode uses iptables REDIRECT to NAT and redirect to Envoy. This mode loses source IP addresses during redirection TPROXY : TPROXY mode uses iptables TPROXY to redirect to Envoy. This mode preserves both the source and destination IP addresses and ports, so that they can be used for advanced filtering and manipulation. This mode also configures the sidecar to run with the CAP_NET_ADMIN capability, which is required to use TPROXY NONE : NONE mode does not configure redirect to Envoy at all. This is an advanced configuration that typically requires changes to user applications.
func ParseIstioTrafficInterceptionMode ¶
func ParseIstioTrafficInterceptionMode(s string) (IstioTrafficInterceptionMode, error)
ParseIstioTrafficInterceptionMode converts a string representation of IstioTrafficInterceptionMode to its corresponding enum value. It returns None for "NONE", Tproxy for "TPROXY", and Redirect for "REDIRECT". If the provided string doesn't match any of the predefined values, it returns an error and the default value Redirect.
func (IstioTrafficInterceptionMode) String ¶
func (t IstioTrafficInterceptionMode) String() string
String converts the IstioTrafficInterceptionMode enum value to its corresponding string representation. It returns "NONE" for None, "TPROXY" for Tproxy, and "REDIRECT" for Redirect. If the enum value doesn't match any of the predefined values, it defaults to "REDIRECT".