Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MeshesToDetect = []MeshKind{ MeshKindIstio, MeshKindLinkerd, MeshKindKuma, MeshKindKongMesh, MeshKindConsul, MeshKindTraefik, MeshKindAWSAppMesh, }
MeshesToDetect is the list of meshes to detect.
Functions ¶
This section is empty.
Types ¶
type DeploymentResults ¶
type DeploymentResults struct {
ServiceExists bool `json:"serviceExists"`
}
DeploymentResults is the result of detecting signals of whether a certain mesh is deployed in kubernetes cluster.
type Detector ¶
type Detector struct { // Client is the kubernetes client to read kubernetes services. Client client.Client // Pod is the pod in which the mesh detector is running. Pod apitypes.NamespacedName // PublishServiceName is the Kubernetes service used for ingress traffic // to the Kong Gateway. PublishService apitypes.NamespacedName }
Detector provides methods to detect the following:
- whether a service mesh is deployed to the cluster
- whether the pod is injected with service mesh
- count of services injected within mesh networks
func NewDetectorByConfig ¶
func NewDetectorByConfig( client client.Client, pod apitypes.NamespacedName, publishService apitypes.NamespacedName, ) (*Detector, error)
NewDetectorByConfig creates a new Detector provided a Kubernetes config for the relevant cluster and the name of the Kubernetes service for ingress traffic to the Kong Gateway.
func (*Detector) DetectMeshDeployment ¶
DetectMeshDeployment detects which kinds of mesh networks are deployed.
func (*Detector) DetectRunUnder ¶
DetectRunUnder detects whether the pod is running under each kind of service mesh. in this function, we want to detect whether the pod running this detector, which is also the pod, is running under a certain kind of service mesh. for example, if the pod is injected with istio sidecar container and init container, we report that the detector is running under istio mesh.
func (*Detector) DetectServiceDistribution ¶
func (d *Detector) DetectServiceDistribution(ctx context.Context) (*ServiceDistributionResults, error)
DetectServiceDistribution detects how many services are running under each mesh.
type RunUnderResults ¶
type RunUnderResults struct { PodOrServiceAnnotation bool `json:"podOrServiceAnnotation"` SidecarContainerInjected bool `json:"sidecarContainerInjected"` InitContainerInjected bool `json:"initContainerInjected"` }
RunUnderResults is the result of detecting signals of whether pod is running under a certain service mesh.
type ServiceDistributionResults ¶
type ServiceDistributionResults struct { TotalServices int `json:"totalServices"` // MeshDistribution is the number of services running under each kind of mesh. // We decided to directly use number here instead of ratio in total services in a // floating number because using floating number needs extra work on calculating // and serializing. MeshDistribution map[MeshKind]int `json:"meshDistribution"` }
ServiceDistributionResults contains number of total services and number of services running under each mesh.
func (*ServiceDistributionResults) ToProviderReport ¶
func (s *ServiceDistributionResults) ToProviderReport() types.ProviderReport