Documentation ¶
Index ¶
- Constants
- Variables
- func ConstructGtpKey(env, identity string) string
- func ConstructRoutingPolicyKey(env, identity string) string
- func GetAdditionalEndpointLabelFilters() []string
- func GetAdditionalEndpointSuffixes() []string
- func GetArgoRolloutsEnabled() bool
- func GetBytes(key interface{}) ([]byte, error)
- func GetCacheRefreshDuration() time.Duration
- func GetClusterRegistriesNamespace() string
- func GetCname(deployment *k8sAppsV1.Deployment, identifier string, nameSuffix string) string
- func GetCnameForRollout(rollout *argo.Rollout, identifier string, nameSuffix string) string
- func GetCnameVal(vals []string) string
- func GetDependenciesNamespace() string
- func GetDeploymentGlobalIdentifier(deployment *k8sAppsV1.Deployment) string
- func GetEnableRoutingPolicy() bool
- func GetEnableSAN() bool
- func GetEnv(deployment *k8sAppsV1.Deployment) string
- func GetEnvForRollout(rollout *argo.Rollout) string
- func GetEnvKey() string
- func GetEnvoyFilterAdditionalConfig() string
- func GetEnvoyFilterVersion() string
- func GetGlobalTrafficDeploymentLabel() string
- func GetGtpEnv(gtp *v1.GlobalTrafficPolicy) string
- func GetGtpIdentity(gtp *v1.GlobalTrafficPolicy) string
- func GetGtpKey(gtp *v1.GlobalTrafficPolicy) string
- func GetHostnameSuffix() string
- func GetKubeconfigPath() string
- func GetMetricsEnabled() bool
- func GetNodeLocality(node *k8sV1.Node) string
- func GetPodGlobalIdentifier(pod *k8sV1.Pod) string
- func GetRolloutGlobalIdentifier(rollout *argo.Rollout) string
- func GetRoutingPolicyEnv(rp *v1.RoutingPolicy) string
- func GetRoutingPolicyIdentity(rp *v1.RoutingPolicy) string
- func GetRoutingPolicyKey(rp *v1.RoutingPolicy) string
- func GetRoutingPolicyLabel() string
- func GetSAN(domain string, deployment *k8sAppsV1.Deployment, identifier string) string
- func GetSANForRollout(domain string, rollout *argo.Rollout, identifier string) string
- func GetSANPrefix() string
- func GetSecretResolver() string
- func GetSha1(key interface{}) (string, error)
- func GetSyncNamespace() string
- func GetValueForKeyFromDeployment(key string, deployment *k8sAppsV1.Deployment) string
- func GetValueForKeyFromRollout(key string, rollout *argo.Rollout) string
- func GetWorkloadIdentifier() string
- func GetWorkloadSidecarName() string
- func GetWorkloadSidecarUpdate() string
- func InitializeConfig(params AdmiralParams)
- func InitializeMetrics()
- func IsServiceMatch(serviceSelector map[string]string, selector *v12.LabelSelector) bool
- func MatchGTPsToRollout(gtpList []v1.GlobalTrafficPolicy, rollout *argo.Rollout) *v1.GlobalTrafficPolicy
- func MatchRolloutsToGTP(gtp *v1.GlobalTrafficPolicy, rollouts []argo.Rollout) []argo.Rollout
- func ResetSync()
- func SetEnablePrometheus(value bool)
- func SetKubeconfigPath(path string)
- func ShouldIgnoreResource(metadata v12.ObjectMeta) bool
- type AdmiralParams
- type Counter
- type Event
- type Gauge
- type LabelSet
- type Map
- type MapOfMaps
- type NoopCounter
- type NoopGauge
- type PromCounter
- type PromGauge
- type ResourceType
- type SidecarEgress
- type SidecarEgressMap
Constants ¶
const ( NamespaceKubeSystem = "kube-system" NamespaceIstioSystem = "istio-system" Env = "env" Http = "http" Grpc = "grpc" GrpcWeb = "grpc-web" Http2 = "http2" DefaultMtlsPort = 15443 DefaultServiceEntryPort = 80 Sep = "." Dash = "-" Slash = "/" DotLocalDomainSuffix = ".svc.cluster.local" Mesh = "mesh" MulticlusterIngressGateway = "istio-multicluster-ingressgateway" LocalAddressPrefix = "240.0" NodeRegionLabel = "failure-domain.beta.kubernetes.io/region" SpiffePrefix = "spiffe://" SidecarEnabledPorts = "traffic.sidecar.istio.io/includeInboundPorts" Default = "default" AdmiralIgnoreAnnotation = "admiral.io/ignore" AdmiralCnameCaseSensitive = "admiral.io/cname-case-sensitive" BlueGreenRolloutPreviewPrefix = "preview" RolloutPodHashLabel = "rollouts-pod-template-hash" RolloutActiveServiceSuffix = "active-service" RolloutStableServiceSuffix = "stable-service" WASMPath = "wasmPath" )
const ( ClustersMonitoredMetricName = "clusters_monitored" EventsProcessedTotalMetricName = "events_processed_total" AddEventLabelValue = "add" UpdateEventLabelValue = "update" DeleteEventLabelValue = "delete" )
Variables ¶
var ( RemoteClustersMetric Gauge EventsProcessed Counter )
Functions ¶
func ConstructGtpKey ¶
func ConstructRoutingPolicyKey ¶
this function is exactly same as ConstructGtpKey. Not reusing the same function to keep the methods associated with these two objects separate.
func GetAdditionalEndpointLabelFilters ¶
func GetAdditionalEndpointLabelFilters() []string
func GetAdditionalEndpointSuffixes ¶
func GetAdditionalEndpointSuffixes() []string
func GetArgoRolloutsEnabled ¶
func GetArgoRolloutsEnabled() bool
func GetCacheRefreshDuration ¶
func GetClusterRegistriesNamespace ¶
func GetClusterRegistriesNamespace() string
func GetCname ¶
func GetCname(deployment *k8sAppsV1.Deployment, identifier string, nameSuffix string) string
GetCname returns cname in the format <env>.<service identity>.global, Ex: stage.Admiral.services.registry.global
func GetCnameForRollout ¶
GetCname returns cname in the format <env>.<service identity>.global, Ex: stage.Admiral.services.registry.global
func GetCnameVal ¶
func GetDependenciesNamespace ¶
func GetDependenciesNamespace() string
func GetDeploymentGlobalIdentifier ¶
func GetDeploymentGlobalIdentifier(deployment *k8sAppsV1.Deployment) string
func GetEnableRoutingPolicy ¶
func GetEnableRoutingPolicy() bool
func GetEnableSAN ¶
func GetEnableSAN() bool
func GetEnv ¶
func GetEnv(deployment *k8sAppsV1.Deployment) string
func GetEnvForRollout ¶
func GetEnvoyFilterAdditionalConfig ¶
func GetEnvoyFilterAdditionalConfig() string
func GetEnvoyFilterVersion ¶
func GetEnvoyFilterVersion() string
func GetGlobalTrafficDeploymentLabel ¶
func GetGlobalTrafficDeploymentLabel() string
func GetGtpEnv ¶
func GetGtpEnv(gtp *v1.GlobalTrafficPolicy) string
func GetGtpIdentity ¶
func GetGtpIdentity(gtp *v1.GlobalTrafficPolicy) string
func GetGtpKey ¶
func GetGtpKey(gtp *v1.GlobalTrafficPolicy) string
func GetHostnameSuffix ¶
func GetHostnameSuffix() string
func GetKubeconfigPath ¶
func GetKubeconfigPath() string
func GetMetricsEnabled ¶
func GetMetricsEnabled() bool
func GetNodeLocality ¶
func GetPodGlobalIdentifier ¶
func GetRoutingPolicyEnv ¶
func GetRoutingPolicyEnv(rp *v1.RoutingPolicy) string
func GetRoutingPolicyIdentity ¶
func GetRoutingPolicyIdentity(rp *v1.RoutingPolicy) string
func GetRoutingPolicyKey ¶
func GetRoutingPolicyKey(rp *v1.RoutingPolicy) string
func GetRoutingPolicyLabel ¶
func GetRoutingPolicyLabel() string
func GetSAN ¶
func GetSAN(domain string, deployment *k8sAppsV1.Deployment, identifier string) string
GetSAN returns SAN for a service entry in the format spiffe://<domain>/<identifier>, Ex: spiffe://subdomain.domain.com/Admiral.platform.mesh.server
func GetSANForRollout ¶
GetSAN returns SAN for a service entry in the format spiffe://<domain>/<identifier>, Ex: spiffe://subdomain.domain.com/Admiral.platform.mesh.server
func GetSANPrefix ¶
func GetSANPrefix() string
func GetSecretResolver ¶
func GetSecretResolver() string
func GetSyncNamespace ¶
func GetSyncNamespace() string
func GetValueForKeyFromDeployment ¶
func GetValueForKeyFromDeployment(key string, deployment *k8sAppsV1.Deployment) string
func GetWorkloadIdentifier ¶
func GetWorkloadIdentifier() string
func GetWorkloadSidecarName ¶
func GetWorkloadSidecarName() string
func GetWorkloadSidecarUpdate ¶
func GetWorkloadSidecarUpdate() string
func InitializeConfig ¶
func InitializeConfig(params AdmiralParams)
func InitializeMetrics ¶
func InitializeMetrics()
InitializeMetrics depends on AdmiralParams for metrics enablement.
func IsServiceMatch ¶
func IsServiceMatch(serviceSelector map[string]string, selector *v12.LabelSelector) bool
func MatchGTPsToRollout ¶
func MatchGTPsToRollout(gtpList []v1.GlobalTrafficPolicy, rollout *argo.Rollout) *v1.GlobalTrafficPolicy
Find the GTP that best matches the rollout. It's assumed that the set of GTPs passed in has already been matched via the GtprolloutLabel. Now it's our job to choose the best one. In order: - If one and only one GTP matches the env label of the rollout - use that one. Use "default" as the default env label for all GTPs and rollout. - If multiple GTPs match the rollout label, use the oldest one (Using an old one has less chance of new behavior which could impact workflows) IMPORTANT: If an environment label is specified on either the GTP or the rollout, the same value must be specified on the other for them to match
func MatchRolloutsToGTP ¶
Returns the list of rollouts to which this GTP should apply. It is assumed that all inputs already are an identity match If the GTP has an identity label, it should match all rollouts which share that label If the GTP does not have an identity label, it should return all rollouts without an identity label IMPORTANT: If an environment label is specified on either the GTP or the rollout, the same value must be specified on the other for them to match
func SetKubeconfigPath ¶
func SetKubeconfigPath(path string)
func ShouldIgnoreResource ¶
func ShouldIgnoreResource(metadata v12.ObjectMeta) bool
Types ¶
type AdmiralParams ¶
type AdmiralParams struct { ArgoRolloutsEnabled bool KubeconfigPath string CacheRefreshDuration time.Duration ClusterRegistriesNamespace string DependenciesNamespace string SyncNamespace string EnableSAN bool SANPrefix string SecretResolver string LabelSet *LabelSet LogLevel int HostnameSuffix string PreviewHostnamePrefix string MetricsEnabled bool WorkloadSidecarUpdate string WorkloadSidecarName string AdmiralStateCheckerName string DRStateStoreConfigPath string ServiceEntryIPPrefix string EnvoyFilterVersion string EnvoyFilterAdditionalConfig string EnableRoutingPolicy bool ExcludedIdentityList []string AdditionalEndpointSuffixes []string AdditionalEndpointLabelFilters []string }
func GetAdmiralParams ¶
func GetAdmiralParams() AdmiralParams
func (AdmiralParams) String ¶
func (b AdmiralParams) String() string
type LabelSet ¶
type LabelSet struct { DeploymentAnnotation string SubsetLabel string NamespaceSidecarInjectionLabel string NamespaceSidecarInjectionLabelValue string AdmiralIgnoreLabel string PriorityKey string WorkloadIdentityKey string //Should always be used for both label and annotation (using label as the primary, and falling back to annotation if the label is not found) GlobalTrafficDeploymentLabel string //label used to tie together deployments and globaltrafficpolicy objects. Configured separately from the identity key because this one _must_ be a label EnvKey string //key used to group deployments by env. The order would be to use annotation `EnvKey` and then label `EnvKey` and then fallback to label `env` label GatewayApp string //the value for `app` key that will be used to fetch the loadblancer for cross cluster calls, also referred to as east west gateway }
func GetLabelSet ¶
func GetLabelSet() *LabelSet
type MapOfMaps ¶
type MapOfMaps struct {
// contains filtered or unexported fields
}
func NewMapOfMaps ¶
func NewMapOfMaps() *MapOfMaps
type NoopCounter ¶
type NoopCounter struct{}
func (*NoopCounter) Inc ¶
func (g *NoopCounter) Inc()
func (*NoopCounter) With ¶
func (g *NoopCounter) With(...string) Counter
type PromCounter ¶
type PromCounter struct {
// contains filtered or unexported fields
}
func (*PromCounter) Inc ¶
func (c *PromCounter) Inc()
func (*PromCounter) With ¶
func (c *PromCounter) With(labelValues ...string) Counter
type ResourceType ¶
type ResourceType string
const ( VirtualService ResourceType = "VirtualService" DestinationRule ResourceType = "DestinationRule" ServiceEntry ResourceType = "ServiceEntry" )
type SidecarEgress ¶
type SidecarEgressMap ¶
type SidecarEgressMap struct {
// contains filtered or unexported fields
}
maintains a map from workload identity -> map[namespace]SidecarEgress
func NewSidecarEgressMap ¶
func NewSidecarEgressMap() *SidecarEgressMap
func (*SidecarEgressMap) Delete ¶
func (s *SidecarEgressMap) Delete(key string)
func (*SidecarEgressMap) Get ¶
func (s *SidecarEgressMap) Get(key string) map[string]SidecarEgress
func (*SidecarEgressMap) Range ¶
func (s *SidecarEgressMap) Range(fn func(k string, v map[string]SidecarEgress))
Range is a thread safe iterator to iterate through the SidecarEgress map