business

package
v1.48.0-snapshot.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2022 License: Apache-2.0 Imports: 53 Imported by: 56

Documentation

Index

Constants

View Source
const (
	IstioDefaultCASecret string = "istio-ca-secret"
	UserProvidedCASecret string = "cacerts"
	CACert               string = "ca-cert.pem"
	CAChainCert          string = "cert-chain.pem"
)
View Source
const (
	Healthy     string = "Healthy"
	NotFound    string = "NotFound"
	NotReady    string = "NotReady"
	Unhealthy   string = "Unhealthy"
	Unreachable string = "Unreachable"
)
View Source
const (
	MTLSEnabled          = "MTLS_ENABLED"
	MTLSPartiallyEnabled = "MTLS_PARTIALLY_ENABLED"
	MTLSNotEnabled       = "MTLS_NOT_ENABLED"
	MTLSDisabled         = "MTLS_DISABLED"
)
View Source
const DefaultClusterID = "Kubernetes"

Variables

View Source
var GrafanaDashboardSupplier = findDashboard

Annotation Filter for Health

View Source
var (
	// ValidProxyLogLevels are the application log levels supported by the envoy admin interface.
	ValidProxyLogLevels = []string{"off", "trace", "debug", "info", "warning", "error", "critical"}
)

Functions

func FakeCustomControllerRSSyncedWithPods added in v1.33.0

func FakeCustomControllerRSSyncedWithPods() []apps_v1.ReplicaSet

func FakeDaemonSets added in v1.33.0

func FakeDaemonSets() []apps_v1.DaemonSet

func FakeDepSyncedWithRS

func FakeDepSyncedWithRS() []apps_v1.Deployment

func FakeDeploymentConfigs

func FakeDeploymentConfigs() []osapps_v1.DeploymentConfig

func FakeDeployments

func FakeDeployments() []apps_v1.Deployment

func FakeDuplicatedDeployments added in v0.9.1

func FakeDuplicatedDeployments() []apps_v1.Deployment

func FakeDuplicatedReplicaSets added in v0.9.1

func FakeDuplicatedReplicaSets() []apps_v1.ReplicaSet

func FakeDuplicatedStatefulSets added in v0.9.1

func FakeDuplicatedStatefulSets() []apps_v1.StatefulSet

func FakePodLogsProxy added in v1.33.0

func FakePodLogsProxy() *kubernetes.PodLogs

func FakePodLogsSyncedWithDeployments added in v0.18.0

func FakePodLogsSyncedWithDeployments() *kubernetes.PodLogs

func FakePodSyncedWithDeployments added in v0.18.0

func FakePodSyncedWithDeployments() *core_v1.Pod

func FakePodsFromCustomController added in v1.33.0

func FakePodsFromCustomController() []core_v1.Pod

func FakePodsNoController

func FakePodsNoController() []core_v1.Pod

func FakePodsSyncedWithDeployments

func FakePodsSyncedWithDeployments() []core_v1.Pod

func FakePodsSyncedWithDuplicated added in v0.9.1

func FakePodsSyncedWithDuplicated() []core_v1.Pod

func FakeRSSyncedWithPods

func FakeRSSyncedWithPods() []apps_v1.ReplicaSet

func FakeReplicaSets

func FakeReplicaSets() []apps_v1.ReplicaSet

func FakeReplicationControllers

func FakeReplicationControllers() []core_v1.ReplicationController

func FakeServices

func FakeServices() []core_v1.Service

func FakeStatefulSets

func FakeStatefulSets() []apps_v1.StatefulSet

func FilterUniqueIstioReferences added in v1.42.0

func FilterUniqueIstioReferences(refs []*models.IstioValidationKey) []*models.IstioValidationKey

func FilterWorkloadReferences added in v1.42.0

func FilterWorkloadReferences(wSelector string, istioConfigList models.IstioConfigList) []*models.IstioValidationKey

func GetGrafanaInfo added in v1.29.0

func GetGrafanaInfo(authInfo *api.AuthInfo, dashboardSupplier dashboardSupplier) (*models.GrafanaInfo, int, error)

GetGrafanaInfo returns the Grafana URL and other info, the HTTP status code (int) and eventually an error

func GetGrafanaLinks(authInfo *api.AuthInfo, linksSpec []dashboards.MonitoringDashboardExternalLink) ([]models.ExternalLink, int, error)

GetGrafanaLinks returns the links to Grafana dashboards and other info, the HTTP status code (int) and eventually an error

func GetIstioAPI added in v0.9.1

func GetIstioAPI(resourceType string) bool

GetIstioAPI provides the Kubernetes API that manages this Istio resource type or empty string if it's not managed

func GetIstioScaler added in v1.27.0

func GetIstioScaler() func(name string) float64

func GetWorkloadStatus added in v1.33.0

func GetWorkloadStatus(wl models.Workload) string

func IsAccessibleError added in v1.10.0

func IsAccessibleError(err error) bool

func IsNamespaceCached added in v1.23.0

func IsNamespaceCached(namespace string) bool

func IsResourceCached added in v1.23.0

func IsResourceCached(namespace string, resource string) bool

func IsValidProxyLogLevel added in v1.41.0

func IsValidProxyLogLevel(level string) bool

IsValidLogLevel determines if the provided string is a valid proxy log level. This can be called before calling SetLogLevel.

func SetKialiControlPlaneCluster added in v1.45.0

func SetKialiControlPlaneCluster(cluster *Cluster)

Global helper used for test mockup

func SetWithBackends

func SetWithBackends(cf kubernetes.ClientFactory, prom prometheus.ClientInterface)

SetWithBackends allows for specifying the ClientFactory and Prometheus clients to be used. Mock friendly. Used only with tests.

func Start added in v1.46.0

func Start()

func Stop added in v1.9.0

func Stop()

Types

type AccessLogEntry added in v1.33.0

type AccessLogEntry struct {
	Timestamp     string `json:"timestamp,omitempty"`
	TimestampUnix int64  `json:"timestampUnix,omitempty"`
}

AccessLogEntry provides parsed info from a single proxy access log entry

type AccessibleNamespaceError added in v1.10.0

type AccessibleNamespaceError struct {
	// contains filtered or unexported fields
}

func (*AccessibleNamespaceError) Error added in v1.10.0

func (in *AccessibleNamespaceError) Error() string

type AccessibleTokenReviewError added in v1.29.0

type AccessibleTokenReviewError struct {
	// contains filtered or unexported fields
}

func (*AccessibleTokenReviewError) Error added in v1.29.0

func (in *AccessibleTokenReviewError) Error() string

type AppCriteria added in v1.48.0

type AppCriteria struct {
	Namespace             string
	IncludeIstioResources bool
}

type AppService

type AppService struct {
	// contains filtered or unexported fields
}

AppService deals with fetching Workloads group by "app" label, which will be identified as an "application"

func (*AppService) GetApp

func (in *AppService) GetApp(ctx context.Context, namespace string, appName string) (models.App, error)

GetApp is the API handler to fetch the details for a given namespace and app name

func (*AppService) GetAppList

func (in *AppService) GetAppList(ctx context.Context, criteria AppCriteria) (models.AppList, error)

GetAppList is the API handler to fetch the list of applications in a given namespace

type Cluster added in v1.29.0

type Cluster struct {
	// ApiEndpoint is the URL where the Kubernetes/Cluster API Server can be contacted
	ApiEndpoint string `json:"apiEndpoint"`

	// IsKialiHome specifies if this cluster is hosting this Kiali instance (and the observed Mesh Control Plane)
	IsKialiHome bool `json:"isKialiHome"`

	// KialiInstances is the list of Kialis discovered in the cluster.
	KialiInstances []KialiInstance `json:"kialiInstances"`

	// Name specifies the CLUSTER_ID as known by the Control Plane
	Name string `json:"name"`

	// Network specifies the logical NETWORK_ID as known by the Control Plane
	Network string `json:"network"`

	// SecretName is the name of the kubernetes "remote secret" where data of this cluster was resolved
	SecretName string `json:"secretName"`
}

Cluster holds some metadata about a cluster that is part of the mesh.

type ComponentStatus added in v1.18.0

type ComponentStatus struct {
	// The app label value of the Istio component
	//
	// example: istio-ingressgateway
	// required: true
	Name string `json:"name"`

	// The status of a Istio component
	//
	// example:  Not Found
	// required: true
	Status string `json:"status"`

	// When true, the component is necessary for Istio to function. Otherwise, it is an addon
	//
	// example:  true
	// required: true
	IsCore bool `json:"is_core"`
}

type DashboardsService added in v0.12.0

type DashboardsService struct {
	CustomEnabled bool
	// contains filtered or unexported fields
}

DashboardsService deals with fetching dashboards from config

func NewDashboardsService added in v0.12.0

func NewDashboardsService(namespace *models.Namespace, workload *models.Workload) *DashboardsService

NewDashboardsService initializes this business service

func (*DashboardsService) BuildIstioDashboard added in v1.27.0

func (in *DashboardsService) BuildIstioDashboard(metrics models.MetricsMap, direction string) *models.MonitoringDashboard

BuildIstioDashboard returns Istio dashboard filled-in with metrics

func (*DashboardsService) GetCustomDashboardRefs added in v0.17.0

func (in *DashboardsService) GetCustomDashboardRefs(namespace, app, version string, pods []*models.Pod) []models.Runtime

GetCustomDashboardRefs finds all dashboard IDs and Titles associated to this app and add them to the model

func (*DashboardsService) GetDashboard added in v0.12.0

func (in *DashboardsService) GetDashboard(authInfo *api.AuthInfo, params models.DashboardQuery, template string) (*models.MonitoringDashboard, error)

GetDashboard returns a dashboard filled-in with target data

func (*DashboardsService) SearchExplicitDashboards added in v1.27.0

func (in *DashboardsService) SearchExplicitDashboards(pods []models.Pod) []models.Runtime

SearchExplicitDashboards will check annotations of all supplied pods to extract a unique list of dashboards

Accepted annotations are "kiali.io/runtimes" and "kiali.io/dashboards"

type HealthService

type HealthService struct {
	// contains filtered or unexported fields
}

HealthService deals with fetching health from various sources and convert to kiali model

func (*HealthService) GetAppHealth

func (in *HealthService) GetAppHealth(ctx context.Context, namespace, app, rateInterval string, queryTime time.Time) (models.AppHealth, error)

GetAppHealth returns an app health from just Namespace and app name (thus, it fetches data from K8S and Prometheus)

func (*HealthService) GetNamespaceAppHealth

func (in *HealthService) GetNamespaceAppHealth(ctx context.Context, namespace, rateInterval string, queryTime time.Time) (models.NamespaceAppHealth, error)

GetNamespaceAppHealth returns a health for all apps in given Namespace (thus, it fetches data from K8S and Prometheus)

func (*HealthService) GetNamespaceServiceHealth

func (in *HealthService) GetNamespaceServiceHealth(ctx context.Context, namespace, rateInterval string, queryTime time.Time) (models.NamespaceServiceHealth, error)

GetNamespaceServiceHealth returns a health for all services in given Namespace (thus, it fetches data from K8S and Prometheus)

func (*HealthService) GetNamespaceWorkloadHealth

func (in *HealthService) GetNamespaceWorkloadHealth(ctx context.Context, namespace, rateInterval string, queryTime time.Time) (models.NamespaceWorkloadHealth, error)

GetNamespaceWorkloadHealth returns a health for all workloads in given Namespace (thus, it fetches data from K8S and Prometheus)

func (*HealthService) GetServiceHealth

func (in *HealthService) GetServiceHealth(ctx context.Context, namespace, service, rateInterval string, queryTime time.Time) (models.ServiceHealth, error)

GetServiceHealth returns a service health (service request error rate)

func (*HealthService) GetWorkloadHealth

func (in *HealthService) GetWorkloadHealth(ctx context.Context, namespace, workload, workloadType, rateInterval string, queryTime time.Time) (models.WorkloadHealth, error)

GetWorkloadHealth returns a workload health from just Namespace and workload (thus, it fetches data from K8S and Prometheus)

type IstioCertsService added in v1.40.0

type IstioCertsService struct {
	// contains filtered or unexported fields
}

func (*IstioCertsService) GetCertsInfo added in v1.40.0

func (ics *IstioCertsService) GetCertsInfo() ([]models.CertInfo, error)

type IstioComponentStatus added in v1.18.0

type IstioComponentStatus []ComponentStatus

type IstioConfigCriteria

type IstioConfigCriteria struct {
	// When AllNamespaces is true the IstioConfigService will use the Istio registry to return the configuration
	// from all namespaces directly from the Istio registry instead of the individual API
	// This usecase should be reserved for validations use cases only where cross-namespace validation may create a
	// penalty
	AllNamespaces                 bool
	Namespace                     string
	IncludeGateways               bool
	IncludeVirtualServices        bool
	IncludeDestinationRules       bool
	IncludeServiceEntries         bool
	IncludeSidecars               bool
	IncludeAuthorizationPolicies  bool
	IncludePeerAuthentications    bool
	IncludeWorkloadEntries        bool
	IncludeWorkloadGroups         bool
	IncludeRequestAuthentications bool
	IncludeEnvoyFilters           bool
	LabelSelector                 string
	WorkloadSelector              string
}

func ParseIstioConfigCriteria added in v1.20.0

func ParseIstioConfigCriteria(namespace, objects, labelSelector, workloadSelector string) IstioConfigCriteria

func (IstioConfigCriteria) Include added in v1.24.0

func (icc IstioConfigCriteria) Include(resource string) bool

type IstioConfigService

type IstioConfigService struct {
	// contains filtered or unexported fields
}

func (*IstioConfigService) CreateIstioConfigDetail added in v0.14.0

func (in *IstioConfigService) CreateIstioConfigDetail(namespace, resourceType string, body []byte) (models.IstioConfigDetails, error)

func (*IstioConfigService) DeleteIstioConfigDetail added in v0.9.1

func (in *IstioConfigService) DeleteIstioConfigDetail(namespace, resourceType, name string) error

DeleteIstioConfigDetail deletes the given Istio resource

func (*IstioConfigService) GetIstioConfigDetails

func (in *IstioConfigService) GetIstioConfigDetails(ctx context.Context, namespace, objectType, object string) (models.IstioConfigDetails, error)

GetIstioConfigDetails returns a specific Istio configuration object. It uses following parameters: - "namespace": namespace where configuration is stored - "objectType": type of the configuration - "object": name of the configuration

func (*IstioConfigService) GetIstioConfigList added in v0.9.1

func (in *IstioConfigService) GetIstioConfigList(ctx context.Context, criteria IstioConfigCriteria) (models.IstioConfigList, error)

GetIstioConfigList returns a list of Istio routing objects, Mixer Rules, (etc.) per a given Namespace.

func (*IstioConfigService) GetIstioConfigPermissions added in v1.29.0

func (in *IstioConfigService) GetIstioConfigPermissions(ctx context.Context, namespaces []string) models.IstioConfigPermissions

func (*IstioConfigService) UpdateIstioConfigDetail added in v0.12.0

func (in *IstioConfigService) UpdateIstioConfigDetail(namespace, resourceType, name, jsonPatch string) (models.IstioConfigDetails, error)

type IstioStatusService added in v1.18.0

type IstioStatusService struct {
	// contains filtered or unexported fields
}

SvcService deals with fetching istio/kubernetes services related content and convert to kiali model

func (*IstioStatusService) GetStatus added in v1.18.0

type IstioValidationsService

type IstioValidationsService struct {
	// contains filtered or unexported fields
}

func (*IstioValidationsService) GetIstioObjectValidations

func (in *IstioValidationsService) GetIstioObjectValidations(ctx context.Context, namespace string, objectType string, object string) (models.IstioValidations, models.IstioReferencesMap, error)

GetIstioObjectValidations validates a single Istio object of the given type with the given name found in the given namespace.

func (*IstioValidationsService) GetValidations added in v0.14.0

func (in *IstioValidationsService) GetValidations(ctx context.Context, namespace, service, workload string) (models.IstioValidations, error)

GetValidations returns an IstioValidations object with all the checks found when running all the enabled checkers. If service is "" then the whole namespace is validated. If service is not empty string, then all of its associated Istio objects are validated.

type JaegerLoader added in v1.11.0

type JaegerLoader = func() (jaeger.ClientInterface, error)

type JaegerService added in v1.11.0

type JaegerService struct {
	// contains filtered or unexported fields
}

func (*JaegerService) GetAppSpans added in v1.24.0

func (in *JaegerService) GetAppSpans(ns, app string, query models.TracingQuery) ([]jaeger.JaegerSpan, error)

func (*JaegerService) GetAppTraces added in v1.24.0

func (in *JaegerService) GetAppTraces(ns, app string, query models.TracingQuery) (*jaeger.JaegerResponse, error)

func (*JaegerService) GetErrorTraces added in v1.11.0

func (in *JaegerService) GetErrorTraces(ns, app string, duration time.Duration) (errorTraces int, err error)

func (*JaegerService) GetJaegerTraceDetail added in v1.11.0

func (in *JaegerService) GetJaegerTraceDetail(traceID string) (trace *jaeger.JaegerSingleTrace, err error)

func (*JaegerService) GetServiceSpans added in v1.24.0

func (in *JaegerService) GetServiceSpans(ctx context.Context, ns, service string, query models.TracingQuery) ([]jaeger.JaegerSpan, error)

func (*JaegerService) GetServiceTraces added in v1.24.0

func (in *JaegerService) GetServiceTraces(ctx context.Context, ns, service string, query models.TracingQuery) (*jaeger.JaegerResponse, error)

func (*JaegerService) GetStatus added in v1.38.1

func (in *JaegerService) GetStatus() (accessible bool, err error)

func (*JaegerService) GetWorkloadSpans added in v1.24.0

func (in *JaegerService) GetWorkloadSpans(ctx context.Context, ns, workload string, query models.TracingQuery) ([]jaeger.JaegerSpan, error)

func (*JaegerService) GetWorkloadTraces added in v1.24.0

func (in *JaegerService) GetWorkloadTraces(ctx context.Context, ns, workload string, query models.TracingQuery) (*jaeger.JaegerResponse, error)

type KialiInstance added in v1.31.0

type KialiInstance struct {
	// ServiceName is the name of the Kubernetes service associated to the Kiali installation. The Kiali Service is the
	// entity that is looked for in order to determine if a Kiali instance is available.
	ServiceName string `json:"serviceName"`

	// Namespace is the name of the namespace where is Kiali installed on.
	Namespace string `json:"namespace"`

	// OperatorResource contains the namespace and the name of the Kiali CR that the user
	// created to install Kiali via the operator. This can be blank if the operator wasn't used
	// to install Kiali. This resource is populated from annotations in the Service. It has
	// the format "namespace/resource_name".
	OperatorResource string `json:"operatorResource"`

	// Url is the URI that can be used to access Kiali.
	Url string `json:"url"`

	// Version is the Kiali version as reported by annotations in the Service.
	Version string `json:"version"`
}

KialiInstance represents a Kiali installation. It holds some data about where and how Kiali was deployed.

type Layer

type Layer struct {
	App         AppService
	Health      HealthService
	IstioConfig IstioConfigService
	IstioStatus IstioStatusService
	IstioCerts  IstioCertsService
	Jaeger      JaegerService

	Mesh           MeshService
	Namespace      NamespaceService
	OpenshiftOAuth OpenshiftOAuthService
	ProxyLogging   ProxyLoggingService
	ProxyStatus    ProxyStatusService
	RegistryStatus RegistryStatusService
	Svc            SvcService
	TLS            TLSService
	TokenReview    TokenReviewService
	Validations    IstioValidationsService
	Workload       WorkloadService
	// contains filtered or unexported fields
}

Layer is a container for fast access to inner services

func Get

func Get(authInfo *api.AuthInfo) (*Layer, error)

Get the business.Layer

func NewWithBackends added in v0.10.0

func NewWithBackends(k8s kubernetes.ClientInterface, prom prometheus.ClientInterface, jaegerClient JaegerLoader) *Layer

NewWithBackends creates the business layer using the passed k8s and prom clients

type LogEntry added in v1.25.0

type LogEntry struct {
	Message       string            `json:"message,omitempty"`
	Severity      string            `json:"severity,omitempty"`
	Timestamp     string            `json:"timestamp,omitempty"`
	TimestampUnix int64             `json:"timestampUnix,omitempty"`
	AccessLog     *parser.AccessLog `json:"accessLog,omitempty"`
}

LogEntry holds a single log entry

type LogOptions added in v1.26.0

type LogOptions struct {
	Duration *time.Duration
	IsProxy  bool // fetching logs for Istio Proxy (Envoy access log)
	core_v1.PodLogOptions
}

LogOptions holds query parameter values

type MeshService added in v1.29.0

type MeshService struct {
	// contains filtered or unexported fields
}

MeshService is a support service for retrieving data about the mesh environment when Istio is installed with multi-cluster enabled. Prefer initializing this type via the NewMeshService function.

func NewMeshService added in v1.29.0

func NewMeshService(k8s kubernetes.ClientInterface, layer *Layer, newRemoteClientFunc func(config *rest.Config) (kubernetes.ClientInterface, error)) MeshService

NewMeshService initializes a new MeshService structure with the given k8s client and newRemoteClientFunc arguments (see the MeshService struct for details). The newRemoteClientFunc can be passed a nil value and a default function will be used.

func (*MeshService) GetClusters added in v1.29.0

func (in *MeshService) GetClusters(r *http.Request) (clusters []Cluster, errVal error)

GetClusters resolves the Kubernetes clusters that are hosting the mesh. Resolution is done as best-effort using the resources that are present in the cluster.

func (*MeshService) IsMeshConfigured added in v1.29.0

func (in *MeshService) IsMeshConfigured() (bool, error)

func (*MeshService) ResolveKialiControlPlaneCluster added in v1.29.0

func (in *MeshService) ResolveKialiControlPlaneCluster(r *http.Request) (*Cluster, error)

ResolveKialiControlPlaneCluster tries to resolve the metadata about the cluster where Kiali is installed. This assumes that the mesh Control Plane is installed in the same cluster as Kiali.

type MetricsLabelsBuilder added in v1.27.0

type MetricsLabelsBuilder struct {
	// contains filtered or unexported fields
}

func NewMetricsLabelsBuilder added in v1.27.0

func NewMetricsLabelsBuilder(direction string) *MetricsLabelsBuilder

func (*MetricsLabelsBuilder) Add added in v1.27.0

func (lb *MetricsLabelsBuilder) Add(key, value string) *MetricsLabelsBuilder

func (*MetricsLabelsBuilder) Aggregate added in v1.27.0

func (lb *MetricsLabelsBuilder) Aggregate(key, value string) *MetricsLabelsBuilder

func (*MetricsLabelsBuilder) App added in v1.27.0

func (lb *MetricsLabelsBuilder) App(name, namespace string) *MetricsLabelsBuilder

func (*MetricsLabelsBuilder) Build added in v1.27.0

func (lb *MetricsLabelsBuilder) Build() string

func (*MetricsLabelsBuilder) BuildForErrors added in v1.27.0

func (lb *MetricsLabelsBuilder) BuildForErrors() []string

func (*MetricsLabelsBuilder) Namespace added in v1.27.0

func (lb *MetricsLabelsBuilder) Namespace(namespace string) *MetricsLabelsBuilder

func (*MetricsLabelsBuilder) PeerApp added in v1.27.0

func (lb *MetricsLabelsBuilder) PeerApp(name, namespace string) *MetricsLabelsBuilder

func (*MetricsLabelsBuilder) PeerNamespace added in v1.27.0

func (lb *MetricsLabelsBuilder) PeerNamespace(namespace string) *MetricsLabelsBuilder

func (*MetricsLabelsBuilder) PeerService added in v1.27.0

func (lb *MetricsLabelsBuilder) PeerService(name, namespace string) *MetricsLabelsBuilder

func (*MetricsLabelsBuilder) PeerWorkload added in v1.27.0

func (lb *MetricsLabelsBuilder) PeerWorkload(name, namespace string) *MetricsLabelsBuilder

func (*MetricsLabelsBuilder) Protocol added in v1.27.0

func (lb *MetricsLabelsBuilder) Protocol(name string) *MetricsLabelsBuilder

func (*MetricsLabelsBuilder) QueryScope added in v1.48.0

func (lb *MetricsLabelsBuilder) QueryScope() *MetricsLabelsBuilder

QueryScope adds scope labels, if configured

func (*MetricsLabelsBuilder) Reporter added in v1.27.0

func (lb *MetricsLabelsBuilder) Reporter(name string) *MetricsLabelsBuilder

func (*MetricsLabelsBuilder) SelfReporter added in v1.27.0

func (lb *MetricsLabelsBuilder) SelfReporter() *MetricsLabelsBuilder

func (*MetricsLabelsBuilder) Service added in v1.27.0

func (lb *MetricsLabelsBuilder) Service(name, namespace string) *MetricsLabelsBuilder

func (*MetricsLabelsBuilder) Workload added in v1.27.0

func (lb *MetricsLabelsBuilder) Workload(name, namespace string) *MetricsLabelsBuilder

type MetricsService added in v1.27.0

type MetricsService struct {
	// contains filtered or unexported fields
}

MetricsService deals with fetching metrics from prometheus

func NewMetricsService added in v1.27.0

func NewMetricsService(prom prometheus.ClientInterface) *MetricsService

NewMetricsService initializes this business service

func (*MetricsService) GetMetrics added in v1.27.0

func (in *MetricsService) GetMetrics(q models.IstioMetricsQuery, scaler func(n string) float64) (models.MetricsMap, error)

func (*MetricsService) GetStats added in v1.27.0

func (in *MetricsService) GetStats(queries []models.MetricsStatsQuery) (map[string]models.MetricsStats, error)

GetStats computes metrics stats, currently response times, for a set of queries

type NamespaceService

type NamespaceService struct {
	// contains filtered or unexported fields
}

NamespaceService deals with fetching k8s namespaces / OpenShift projects and convert to kiali model

func (*NamespaceService) GetNamespace added in v0.9.1

func (in *NamespaceService) GetNamespace(ctx context.Context, namespace string) (*models.Namespace, error)

GetNamespace returns the definition of the specified namespace.

func (*NamespaceService) GetNamespaces

func (in *NamespaceService) GetNamespaces(ctx context.Context) ([]models.Namespace, error)

Returns a list of the given namespaces / projects

func (*NamespaceService) UpdateNamespace added in v1.22.1

func (in *NamespaceService) UpdateNamespace(ctx context.Context, namespace string, jsonPatch string) (*models.Namespace, error)

type OAuthAuthorizationServer added in v0.16.0

type OAuthAuthorizationServer struct {
	AuthorizationEndpoint string `json:"authorization_endpoint"`
	Issuer                string `json:"issuer"`
}

Structure that's returned by the openshift oauth authorization server. It defaults to following the snake_case format, so we parse it to something more usable on our side.

type OAuthMetadata added in v0.16.0

type OAuthMetadata struct {
	AuthorizationEndpoint string `json:"authorizationEndpoint"`
	LogoutEndpoint        string `json:"logoutEndpoint"`
	LogoutRedirect        string `json:"logoutRedirect"`
}

type OAuthRoute added in v0.16.0

type OAuthRoute struct {
	Spec OAuthRouteSpec `json:"spec"`
}

type OAuthRouteSpec added in v0.16.0

type OAuthRouteSpec struct {
	Host string             `json:"host"`
	TLS  *OAuthRouteTLSSpec `json:"tls,omitempty"`
}

type OAuthRouteTLSSpec added in v0.16.0

type OAuthRouteTLSSpec struct {
	Termination string `json:"termination"`
}

type OAuthUser added in v0.16.0

type OAuthUser struct {
	Metadata OAuthUserMetadata `json:"metadata"`
}

type OAuthUserMetadata added in v0.16.0

type OAuthUserMetadata struct {
	Name string `json:"name"`
}

type ObjectChecker

type ObjectChecker interface {
	Check() models.IstioValidations
}

type OpenshiftOAuthService added in v0.16.0

type OpenshiftOAuthService struct {
	// contains filtered or unexported fields
}

func (*OpenshiftOAuthService) GetUserInfo added in v0.16.0

func (in *OpenshiftOAuthService) GetUserInfo(token string) (*OAuthUser, error)

func (*OpenshiftOAuthService) Logout added in v0.20.0

func (in *OpenshiftOAuthService) Logout(token string) error

func (*OpenshiftOAuthService) Metadata added in v0.16.0

func (in *OpenshiftOAuthService) Metadata() (metadata *OAuthMetadata, err error)

type PodLog added in v1.25.0

type PodLog struct {
	Entries []LogEntry `json:"entries,omitempty"`
}

PodLog reports log entries

type ProxyLoggingService added in v1.41.0

type ProxyLoggingService struct {
	// contains filtered or unexported fields
}

ProxyLoggingService is a thin layer over the kube interface for proxy logging functions.

func (*ProxyLoggingService) SetLogLevel added in v1.41.0

func (in *ProxyLoggingService) SetLogLevel(namespace, pod, level string) error

SetLogLevel sets the pod's proxy log level.

type ProxyStatusService added in v1.35.0

type ProxyStatusService struct {
	// contains filtered or unexported fields
}

func (*ProxyStatusService) GetConfigDump added in v1.35.0

func (in *ProxyStatusService) GetConfigDump(namespace, pod string) (models.EnvoyProxyDump, error)

func (*ProxyStatusService) GetConfigDumpResourceEntries added in v1.35.0

func (in *ProxyStatusService) GetConfigDumpResourceEntries(namespace, pod, resource string) (*models.EnvoyProxyDump, error)

func (*ProxyStatusService) GetPodProxyStatus added in v1.35.0

func (in *ProxyStatusService) GetPodProxyStatus(ns, pod string) (*kubernetes.ProxyStatus, error)

type ReferenceChecker added in v1.47.0

type ReferenceChecker interface {
	References() models.IstioReferencesMap
}

type RegistryCriteria added in v1.44.0

type RegistryCriteria struct {
	// When AllNamespaces is true Namespace criteria is ignored
	// Note this flag is only supported in Registry queries
	AllNamespaces   bool
	Namespace       string
	ServiceName     string
	ServiceSelector string
}

type RegistryStatusService added in v1.35.0

type RegistryStatusService struct {
	// contains filtered or unexported fields
}

func (*RegistryStatusService) GetRegistryConfiguration added in v1.44.0

func (in *RegistryStatusService) GetRegistryConfiguration(criteria RegistryCriteria) (*kubernetes.RegistryConfiguration, error)

func (*RegistryStatusService) GetRegistryEndpoints added in v1.44.0

func (in *RegistryStatusService) GetRegistryEndpoints(criteria RegistryCriteria) ([]*kubernetes.RegistryEndpoint, error)

func (*RegistryStatusService) GetRegistryServices added in v1.44.0

func (in *RegistryStatusService) GetRegistryServices(criteria RegistryCriteria) ([]*kubernetes.RegistryService, error)

type ServiceCriteria added in v1.43.0

type ServiceCriteria struct {
	Namespace              string
	IncludeIstioResources  bool
	IncludeOnlyDefinitions bool
	ServiceSelector        string
}

type SpanFilter added in v1.24.0

type SpanFilter = func(span *jaegerModels.Span) bool

type SvcService

type SvcService struct {
	// contains filtered or unexported fields
}

SvcService deals with fetching istio/kubernetes services related content and convert to kiali model

func (*SvcService) GetService

func (in *SvcService) GetService(ctx context.Context, namespace, service string) (models.Service, error)

func (*SvcService) GetServiceAppName added in v1.24.0

func (in *SvcService) GetServiceAppName(ctx context.Context, namespace, service string) (string, error)

GetServiceAppName returns the "Application" name (app label) that relates to a service This label is taken from the service selector, which means it is assumed that pods are selected using that label

func (*SvcService) GetServiceDetails added in v1.43.0

func (in *SvcService) GetServiceDetails(ctx context.Context, namespace, service, interval string, queryTime time.Time) (*models.ServiceDetails, error)

GetService returns a single service and associated data using the interval and queryTime

func (*SvcService) GetServiceList

func (in *SvcService) GetServiceList(ctx context.Context, criteria ServiceCriteria) (*models.ServiceList, error)

GetServiceList returns a list of all services for a given criteria

func (*SvcService) UpdateService added in v1.30.0

func (in *SvcService) UpdateService(ctx context.Context, namespace, service string, interval string, queryTime time.Time, jsonPatch string) (*models.ServiceDetails, error)

type TLSService added in v0.16.0

type TLSService struct {
	// contains filtered or unexported fields
}

func (*TLSService) GetAllDestinationRules added in v1.46.0

func (in *TLSService) GetAllDestinationRules(ctx context.Context, namespaces []string) ([]networking_v1alpha3.DestinationRule, error)

TODO refactor business/istio_validations.go

func (*TLSService) MeshWidemTLSStatus added in v0.16.0

func (in *TLSService) MeshWidemTLSStatus(ctx context.Context, namespaces []string) (models.MTLSStatus, error)

func (*TLSService) NamespaceWidemTLSStatus added in v0.16.0

func (in *TLSService) NamespaceWidemTLSStatus(ctx context.Context, namespace string) (models.MTLSStatus, error)

type TokenReviewService added in v1.29.0

type TokenReviewService struct {
	// contains filtered or unexported fields
}

func NewTokenReview added in v1.29.0

func NewTokenReview(k8s kubernetes.ClientInterface) TokenReviewService

func (*TokenReviewService) GetTokenSubject added in v1.29.0

func (in *TokenReviewService) GetTokenSubject(authInfo *api.AuthInfo) (string, error)

type WorkloadCriteria added in v1.43.0

type WorkloadCriteria struct {
	Namespace             string
	IncludeIstioResources bool
}

type WorkloadService

type WorkloadService struct {
	// contains filtered or unexported fields
}

WorkloadService deals with fetching istio/kubernetes workloads related content and convert to kiali model

func (*WorkloadService) BuildLogOptionsCriteria added in v1.27.0

func (in *WorkloadService) BuildLogOptionsCriteria(container, duration, isProxy, sinceTime, tailLines string) (*LogOptions, error)

func (*WorkloadService) GetPod added in v0.18.0

func (in *WorkloadService) GetPod(namespace, name string) (*models.Pod, error)

func (*WorkloadService) GetPodLogs added in v0.18.0

func (in *WorkloadService) GetPodLogs(namespace, name string, opts *LogOptions) (*PodLog, error)

GetPodLogs returns pod logs given the provided options

func (*WorkloadService) GetPods

func (in *WorkloadService) GetPods(ctx context.Context, namespace string, labelSelector string) (models.Pods, error)

func (*WorkloadService) GetWorkload

func (in *WorkloadService) GetWorkload(ctx context.Context, namespace string, workloadName string, workloadType string, includeServices bool) (*models.Workload, error)

GetWorkload is the API handler to fetch details of a specific workload. If includeServices is set true, the Workload will fetch all services related

func (*WorkloadService) GetWorkloadAppName added in v1.24.0

func (in *WorkloadService) GetWorkloadAppName(ctx context.Context, namespace, workload string) (string, error)

GetWorkloadAppName returns the "Application" name (app label) that relates to a workload

func (*WorkloadService) GetWorkloadList

func (in *WorkloadService) GetWorkloadList(ctx context.Context, criteria WorkloadCriteria) (models.WorkloadList, error)

GetWorkloadList is the API handler to fetch the list of workloads in a given namespace.

func (*WorkloadService) UpdateWorkload added in v1.22.0

func (in *WorkloadService) UpdateWorkload(ctx context.Context, namespace string, workloadName string, workloadType string, includeServices bool, jsonPatch string) (*models.Workload, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL