Documentation ¶
Index ¶
- Constants
- Variables
- func ConfigClient() (*rest.Config, error)
- func FilterByHost(host, serviceName, namespace string) bool
- func FilterByRoute(spec map[string]interface{}, protocols []string, service string, ...) bool
- func FilterPodsForController(controllerName string, controllerType string, allPods []v1.Pod) []v1.Pod
- func FilterPodsForEndpoints(endpoints *v1.Endpoints, unfiltered []v1.Pod) []v1.Pod
- func FilterPodsForSelector(selector labels.Selector, allPods []v1.Pod) []v1.Pod
- func FilterPodsForService(s *v1.Service, allPods []v1.Pod) []v1.Pod
- func FilterServicesForSelector(selector labels.Selector, allServices []v1.Service) []v1.Service
- func GatewayNames(gateways [][]IstioObject) map[string]struct{}
- func NewNotFound(name, group, resource string) error
- func ServiceEntryHostnames(serviceEntries []IstioObject) map[string][]string
- func ValidatePort(portDef interface{}) bool
- func ValidateVirtualServiceGateways(spec map[string]interface{}, gatewayNames map[string]struct{}, ...) (bool, int)
- type GenericIstioObject
- func (in *GenericIstioObject) DeepCopy() *GenericIstioObject
- func (in *GenericIstioObject) DeepCopyInto(out *GenericIstioObject)
- func (in *GenericIstioObject) DeepCopyIstioObject() IstioObject
- func (in *GenericIstioObject) DeepCopyObject() runtime.Object
- func (in *GenericIstioObject) GetObjectMeta() meta_v1.ObjectMeta
- func (in *GenericIstioObject) GetSpec() map[string]interface{}
- func (in *GenericIstioObject) SetObjectMeta(metadata meta_v1.ObjectMeta)
- func (in *GenericIstioObject) SetSpec(spec map[string]interface{})
- type GenericIstioObjectList
- type Host
- type IstioClient
- func (in *IstioClient) CreateIstioObject(api, namespace, resourceType, json string) (IstioObject, error)
- func (in *IstioClient) DeleteIstioObject(api, namespace, resourceType, name string) error
- func (in *IstioClient) GetAdapter(namespace, adapterType, adapterName string) (IstioObject, error)
- func (in *IstioClient) GetAdapters(namespace string) ([]IstioObject, error)
- func (in *IstioClient) GetClusterRbacConfig(namespace string, name string) (IstioObject, error)
- func (in *IstioClient) GetClusterRbacConfigs(namespace string) ([]IstioObject, error)
- func (in *IstioClient) GetCronJobs(namespace string) ([]batch_v1beta1.CronJob, error)
- func (in *IstioClient) GetDeployment(namespace, deploymentName string) (*appsv1.Deployment, error)
- func (in *IstioClient) GetDeploymentConfig(namespace, deploymentconfigName string) (*osappsv1.DeploymentConfig, error)
- func (in *IstioClient) GetDeploymentConfigs(namespace string) ([]osappsv1.DeploymentConfig, error)
- func (in *IstioClient) GetDeployments(namespace string) ([]appsv1.Deployment, error)
- func (in *IstioClient) GetDestinationRule(namespace string, destinationrule string) (IstioObject, error)
- func (in *IstioClient) GetDestinationRules(namespace string, serviceName string) ([]IstioObject, error)
- func (in *IstioClient) GetEndpoints(namespace, serviceName string) (*v1.Endpoints, error)
- func (in *IstioClient) GetGateway(namespace string, gateway string) (IstioObject, error)
- func (in *IstioClient) GetGateways(namespace string) ([]IstioObject, error)
- func (client *IstioClient) GetIstioConfigApi() *rest.RESTClient
- func (in *IstioClient) GetIstioDetails(namespace string, serviceName string) (*IstioDetails, error)
- func (client *IstioClient) GetIstioNetworkingApi() *rest.RESTClient
- func (client *IstioClient) GetIstioRbacApi() *rest.RESTClient
- func (in *IstioClient) GetIstioRule(namespace string, istiorule string) (IstioObject, error)
- func (in *IstioClient) GetIstioRules(namespace string) ([]IstioObject, error)
- func (in *IstioClient) GetJobs(namespace string) ([]batch_v1.Job, error)
- func (client *IstioClient) GetK8sApi() *kube.Clientset
- func (in *IstioClient) GetMeshPolicies(namespace string) ([]IstioObject, error)
- func (in *IstioClient) GetMeshPolicy(namespace string, policyName string) (IstioObject, error)
- func (in *IstioClient) GetNamespace(namespace string) (*v1.Namespace, error)
- func (in *IstioClient) GetNamespaces() ([]v1.Namespace, error)
- func (in *IstioClient) GetPods(namespace, labelSelector string) ([]v1.Pod, error)
- func (in *IstioClient) GetPolicies(namespace string) ([]IstioObject, error)
- func (in *IstioClient) GetPolicy(namespace string, policyName string) (IstioObject, error)
- func (in *IstioClient) GetProject(name string) (*osv1.Project, error)
- func (in *IstioClient) GetProjects() ([]osv1.Project, error)
- func (in *IstioClient) GetQuotaSpec(namespace string, quotaSpecName string) (IstioObject, error)
- func (in *IstioClient) GetQuotaSpecBinding(namespace string, quotaSpecBindingName string) (IstioObject, error)
- func (in *IstioClient) GetQuotaSpecBindings(namespace string) ([]IstioObject, error)
- func (in *IstioClient) GetQuotaSpecs(namespace string) ([]IstioObject, error)
- func (in *IstioClient) GetReplicaSets(namespace string) ([]appsv1.ReplicaSet, error)
- func (in *IstioClient) GetReplicationControllers(namespace string) ([]v1.ReplicationController, error)
- func (in *IstioClient) GetSelfSubjectAccessReview(namespace, api, resourceType string, verbs []string) ([]*auth_v1.SelfSubjectAccessReview, error)
- func (in *IstioClient) GetService(namespace, serviceName string) (*v1.Service, error)
- func (in *IstioClient) GetServiceEntries(namespace string) ([]IstioObject, error)
- func (in *IstioClient) GetServiceEntry(namespace string, serviceEntryName string) (IstioObject, error)
- func (in *IstioClient) GetServiceRole(namespace string, name string) (IstioObject, error)
- func (in *IstioClient) GetServiceRoleBinding(namespace string, name string) (IstioObject, error)
- func (in *IstioClient) GetServiceRoleBindings(namespace string) ([]IstioObject, error)
- func (in *IstioClient) GetServiceRoles(namespace string) ([]IstioObject, error)
- func (in *IstioClient) GetServices(namespace string, selectorLabels map[string]string) ([]v1.Service, error)
- func (in *IstioClient) GetStatefulSet(namespace string, statefulsetName string) (*appsv1.StatefulSet, error)
- func (in *IstioClient) GetStatefulSets(namespace string) ([]appsv1.StatefulSet, error)
- func (in *IstioClient) GetTemplate(namespace, templateType, templateName string) (IstioObject, error)
- func (in *IstioClient) GetTemplates(namespace string) ([]IstioObject, error)
- func (in *IstioClient) GetVirtualService(namespace string, virtualservice string) (IstioObject, error)
- func (in *IstioClient) GetVirtualServices(namespace string, serviceName string) ([]IstioObject, error)
- func (in *IstioClient) IsOpenShift() bool
- func (in *IstioClient) Stop()
- func (in *IstioClient) UpdateIstioObject(api, namespace, resourceType, name, jsonPatch string) (IstioObject, error)
- type IstioClientInterface
- type IstioDetails
- type IstioObject
- type IstioObjectList
- type KialiMonitoringClient
- type KialiMonitoringInterface
- type MTLSDetails
- type MonitoringDashboard
- type MonitoringDashboardAggregation
- type MonitoringDashboardChart
- type MonitoringDashboardSpec
- type ServiceDetails
- type ServiceList
Constants ¶
const ( // Raw constant for DataType Raw = "raw" // Rate constant for DataType Rate = "rate" // Histogram constant for DataType Histogram = "histogram" )
Variables ¶
var ( ConfigGroupVersion = schema.GroupVersion{ Group: "config.istio.io", Version: "v1alpha2", } ApiConfigVersion = ConfigGroupVersion.Group + "/" + ConfigGroupVersion.Version NetworkingGroupVersion = schema.GroupVersion{ Group: "networking.istio.io", Version: "v1alpha3", } ApiNetworkingVersion = NetworkingGroupVersion.Group + "/" + NetworkingGroupVersion.Version AuthenticationGroupVersion = schema.GroupVersion{ Group: "authentication.istio.io", Version: "v1alpha1", } ApiAuthenticationVersion = AuthenticationGroupVersion.Group + "/" + AuthenticationGroupVersion.Version RbacGroupVersion = schema.GroupVersion{ Group: "rbac.istio.io", Version: "v1alpha1", } ApiRbacVersion = RbacGroupVersion.Group + "/" + RbacGroupVersion.Version PluralType = map[string]string{ // contains filtered or unexported fields } )
Functions ¶
func ConfigClient ¶
ConfigClient return a client with the correct configuration Returns configuration if Kiali is in Cluster when InCluster is true Returns configuration if Kiali is not int Cluster when InCluster is false It returns an error on any problem
func FilterByHost ¶
func FilterByRoute ¶
func FilterPodsForController ¶
func FilterPodsForEndpoints ¶
FilterPodsForEndpoints performs a second pass was selector may return too many data This case happens when a "nil" selector (such as one of default/kubernetes service) is used
func FilterPodsForSelector ¶
func FilterPodsForService ¶
FilterPodsForService returns a subpart of pod list filtered according service selector
func GatewayNames ¶
func GatewayNames(gateways [][]IstioObject) map[string]struct{}
GatewayNames extracts the gateway names for easier matching
func NewNotFound ¶
NewNotFound is a helper method to create a NotFound error similar as used by the kubernetes client. This method helps upper layers to send a explicit NotFound error without querying the backend.
func ServiceEntryHostnames ¶
func ServiceEntryHostnames(serviceEntries []IstioObject) map[string][]string
ServiceEntryHostnames returns a list of hostnames defined in the ServiceEntries Specs. Key in the resulting map is the protocol (in lowercase) + hostname exported for test
func ValidatePort ¶
func ValidatePort(portDef interface{}) bool
ValidaPort parses the Istio Port definition and validates the naming scheme
func ValidateVirtualServiceGateways ¶
func ValidateVirtualServiceGateways(spec map[string]interface{}, gatewayNames map[string]struct{}, namespace, clusterName string) (bool, int)
ValidateVirtualServiceGateways checks all VirtualService gateways (except mesh, which is reserved word) and checks that they're found from the given list of gatewayNames. Also return index of missing gatways to show clearer error path in editor
Types ¶
type GenericIstioObject ¶
type GenericIstioObject struct { meta_v1.TypeMeta `json:",inline"` meta_v1.ObjectMeta `json:"metadata"` Spec map[string]interface{} `json:"spec"` }
GenericIstioObject is a type to test Istio types defined by Istio as a Kubernetes extension.
func (*GenericIstioObject) DeepCopy ¶
func (in *GenericIstioObject) DeepCopy() *GenericIstioObject
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericIstioObject.
func (*GenericIstioObject) DeepCopyInto ¶
func (in *GenericIstioObject) DeepCopyInto(out *GenericIstioObject)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GenericIstioObject) DeepCopyIstioObject ¶
func (in *GenericIstioObject) DeepCopyIstioObject() IstioObject
DeepCopyIstioObject is an autogenerated deepcopy function, copying the receiver, creating a new IstioObject.
func (*GenericIstioObject) DeepCopyObject ¶
func (in *GenericIstioObject) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*GenericIstioObject) GetObjectMeta ¶
func (in *GenericIstioObject) GetObjectMeta() meta_v1.ObjectMeta
GetObjectMeta from a wrapper
func (*GenericIstioObject) GetSpec ¶
func (in *GenericIstioObject) GetSpec() map[string]interface{}
GetSpec from a wrapper
func (*GenericIstioObject) SetObjectMeta ¶
func (in *GenericIstioObject) SetObjectMeta(metadata meta_v1.ObjectMeta)
SetObjectMeta for a wrapper
func (*GenericIstioObject) SetSpec ¶
func (in *GenericIstioObject) SetSpec(spec map[string]interface{})
SetSpec for a wrapper
type GenericIstioObjectList ¶
type GenericIstioObjectList struct { meta_v1.TypeMeta `json:",inline"` meta_v1.ListMeta `json:"metadata"` Items []GenericIstioObject `json:"items"` }
GenericIstioObjectList is the generic Kubernetes API list wrapper
func (*GenericIstioObjectList) DeepCopy ¶
func (in *GenericIstioObjectList) DeepCopy() *GenericIstioObjectList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericIstioObjectList.
func (*GenericIstioObjectList) DeepCopyInto ¶
func (in *GenericIstioObjectList) DeepCopyInto(out *GenericIstioObjectList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*GenericIstioObjectList) DeepCopyObject ¶
func (in *GenericIstioObjectList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (*GenericIstioObjectList) GetItems ¶
func (in *GenericIstioObjectList) GetItems() []IstioObject
GetItems from a wrapper
type Host ¶
Host represents the FQDN format for Istio hostnames
type IstioClient ¶
type IstioClient struct { IstioClientInterface // contains filtered or unexported fields }
IstioClient is the client struct for Kubernetes and Istio APIs It hides the way it queries each API
func NewClient ¶
func NewClient() (*IstioClient, error)
NewClient creates a new client to the Kubernetes and Istio APIs.
func NewClientFromConfig ¶
func NewClientFromConfig(config *rest.Config) (*IstioClient, error)
NewClientFromConfig creates a new client to the Kubernetes and Istio APIs. It takes the assumption that Istio is deployed into the cluster. It hides the access to Kubernetes/Openshift credentials. It hides the low level use of the API of Kubernetes and Istio, it should be considered as an implementation detail. It returns an error on any problem.
func (*IstioClient) CreateIstioObject ¶
func (in *IstioClient) CreateIstioObject(api, namespace, resourceType, json string) (IstioObject, error)
CreateIstioObject creates an Istio object
func (*IstioClient) DeleteIstioObject ¶
func (in *IstioClient) DeleteIstioObject(api, namespace, resourceType, name string) error
DeleteIstioObject deletes an Istio object from either config api or networking api
func (*IstioClient) GetAdapter ¶
func (in *IstioClient) GetAdapter(namespace, adapterType, adapterName string) (IstioObject, error)
func (*IstioClient) GetAdapters ¶
func (in *IstioClient) GetAdapters(namespace string) ([]IstioObject, error)
func (*IstioClient) GetClusterRbacConfig ¶
func (in *IstioClient) GetClusterRbacConfig(namespace string, name string) (IstioObject, error)
func (*IstioClient) GetClusterRbacConfigs ¶
func (in *IstioClient) GetClusterRbacConfigs(namespace string) ([]IstioObject, error)
func (*IstioClient) GetCronJobs ¶
func (in *IstioClient) GetCronJobs(namespace string) ([]batch_v1beta1.CronJob, error)
func (*IstioClient) GetDeployment ¶
func (in *IstioClient) GetDeployment(namespace, deploymentName string) (*appsv1.Deployment, error)
GetDeployment returns the definition of a specific deployment. It returns an error on any problem.
func (*IstioClient) GetDeploymentConfig ¶
func (in *IstioClient) GetDeploymentConfig(namespace, deploymentconfigName string) (*osappsv1.DeploymentConfig, error)
GetDeployment returns the definition of a specific deployment. It returns an error on any problem.
func (*IstioClient) GetDeploymentConfigs ¶
func (in *IstioClient) GetDeploymentConfigs(namespace string) ([]osappsv1.DeploymentConfig, error)
GetDeployments returns an array of deployments for a given namespace and a set of labels. An empty labelSelector will fetch all Deployments for a namespace. It returns an error on any problem.
func (*IstioClient) GetDeployments ¶
func (in *IstioClient) GetDeployments(namespace string) ([]appsv1.Deployment, error)
GetDeployments returns an array of deployments for a given namespace and a set of labels. It returns an error on any problem.
func (*IstioClient) GetDestinationRule ¶
func (in *IstioClient) GetDestinationRule(namespace string, destinationrule string) (IstioObject, error)
func (*IstioClient) GetDestinationRules ¶
func (in *IstioClient) GetDestinationRules(namespace string, serviceName string) ([]IstioObject, error)
GetDestinationRules returns all DestinationRules for a given namespace. If serviceName param is provided it will filter all DestinationRules having a host defined on a particular service. It returns an error on any problem.
func (*IstioClient) GetEndpoints ¶
func (in *IstioClient) GetEndpoints(namespace, serviceName string) (*v1.Endpoints, error)
GetEndpoints return the list of endpoint of a specific service. It returns an error on any problem.
func (*IstioClient) GetGateway ¶
func (in *IstioClient) GetGateway(namespace string, gateway string) (IstioObject, error)
func (*IstioClient) GetGateways ¶
func (in *IstioClient) GetGateways(namespace string) ([]IstioObject, error)
GetGateways return all Gateways for a given namespace. It returns an error on any problem.
func (*IstioClient) GetIstioConfigApi ¶
func (client *IstioClient) GetIstioConfigApi() *rest.RESTClient
GetIstioConfigApi returns the istio config rest client
func (*IstioClient) GetIstioDetails ¶
func (in *IstioClient) GetIstioDetails(namespace string, serviceName string) (*IstioDetails, error)
GetIstioDetails returns Istio details for a given namespace, on this version it collects the VirtualServices and DestinationRules defined for a namespace. If serviceName param is provided, it filters all the Istio objects pointing to a particular service. It returns an error on any problem.
func (*IstioClient) GetIstioNetworkingApi ¶
func (client *IstioClient) GetIstioNetworkingApi() *rest.RESTClient
GetIstioNetworkingApi returns the istio config rest client
func (*IstioClient) GetIstioRbacApi ¶
func (client *IstioClient) GetIstioRbacApi() *rest.RESTClient
GetIstioRbacApi returns the istio rbac rest client
func (*IstioClient) GetIstioRule ¶
func (in *IstioClient) GetIstioRule(namespace string, istiorule string) (IstioObject, error)
func (*IstioClient) GetIstioRules ¶
func (in *IstioClient) GetIstioRules(namespace string) ([]IstioObject, error)
GetIstioRules returns a list of mixer rules for a given namespace.
func (*IstioClient) GetJobs ¶
func (in *IstioClient) GetJobs(namespace string) ([]batch_v1.Job, error)
func (*IstioClient) GetK8sApi ¶
func (client *IstioClient) GetK8sApi() *kube.Clientset
GetK8sApi returns the clientset referencing all K8s rest clients
func (*IstioClient) GetMeshPolicies ¶
func (in *IstioClient) GetMeshPolicies(namespace string) ([]IstioObject, error)
func (*IstioClient) GetMeshPolicy ¶
func (in *IstioClient) GetMeshPolicy(namespace string, policyName string) (IstioObject, error)
func (*IstioClient) GetNamespace ¶
func (in *IstioClient) GetNamespace(namespace string) (*v1.Namespace, error)
GetNamespace fetches and returns the specified namespace definition from the cluster
func (*IstioClient) GetNamespaces ¶
func (in *IstioClient) GetNamespaces() ([]v1.Namespace, error)
GetNamespaces returns a list of all namespaces of the cluster. It returns a list of all namespaces of the cluster. It returns an error on any problem.
func (*IstioClient) GetPods ¶
func (in *IstioClient) GetPods(namespace, labelSelector string) ([]v1.Pod, error)
GetPods returns the pods definitions for a given set of labels. An empty labelSelector will fetch all pods found per a namespace. It returns an error on any problem.
func (*IstioClient) GetPolicies ¶
func (in *IstioClient) GetPolicies(namespace string) ([]IstioObject, error)
func (*IstioClient) GetPolicy ¶
func (in *IstioClient) GetPolicy(namespace string, policyName string) (IstioObject, error)
func (*IstioClient) GetProject ¶
func (in *IstioClient) GetProject(name string) (*osv1.Project, error)
GetProject fetches and returns the definition of the project with the specified name by querying the cluster API. GetProject will fail if the underlying cluster is not Openshift.
func (*IstioClient) GetProjects ¶
func (in *IstioClient) GetProjects() ([]osv1.Project, error)
func (*IstioClient) GetQuotaSpec ¶
func (in *IstioClient) GetQuotaSpec(namespace string, quotaSpecName string) (IstioObject, error)
func (*IstioClient) GetQuotaSpecBinding ¶
func (in *IstioClient) GetQuotaSpecBinding(namespace string, quotaSpecBindingName string) (IstioObject, error)
func (*IstioClient) GetQuotaSpecBindings ¶
func (in *IstioClient) GetQuotaSpecBindings(namespace string) ([]IstioObject, error)
GetQuotaSpecBindings returns all QuotaSpecBindings objects for a given namespace. It returns an error on any problem.
func (*IstioClient) GetQuotaSpecs ¶
func (in *IstioClient) GetQuotaSpecs(namespace string) ([]IstioObject, error)
GetQuotaSpecs returns all QuotaSpecs objects for a given namespace. It returns an error on any problem.
func (*IstioClient) GetReplicaSets ¶
func (in *IstioClient) GetReplicaSets(namespace string) ([]appsv1.ReplicaSet, error)
func (*IstioClient) GetReplicationControllers ¶
func (in *IstioClient) GetReplicationControllers(namespace string) ([]v1.ReplicationController, error)
func (*IstioClient) GetSelfSubjectAccessReview ¶
func (in *IstioClient) GetSelfSubjectAccessReview(namespace, api, resourceType string, verbs []string) ([]*auth_v1.SelfSubjectAccessReview, error)
GetSelfSubjectAccessReview provides information on Kiali permissions
func (*IstioClient) GetService ¶
func (in *IstioClient) GetService(namespace, serviceName string) (*v1.Service, error)
GetService returns the definition of a specific service. It returns an error on any problem.
func (*IstioClient) GetServiceEntries ¶
func (in *IstioClient) GetServiceEntries(namespace string) ([]IstioObject, error)
GetServiceEntries return all ServiceEntry objects for a given namespace. It returns an error on any problem.
func (*IstioClient) GetServiceEntry ¶
func (in *IstioClient) GetServiceEntry(namespace string, serviceEntryName string) (IstioObject, error)
func (*IstioClient) GetServiceRole ¶
func (in *IstioClient) GetServiceRole(namespace string, name string) (IstioObject, error)
func (*IstioClient) GetServiceRoleBinding ¶
func (in *IstioClient) GetServiceRoleBinding(namespace string, name string) (IstioObject, error)
func (*IstioClient) GetServiceRoleBindings ¶
func (in *IstioClient) GetServiceRoleBindings(namespace string) ([]IstioObject, error)
func (*IstioClient) GetServiceRoles ¶
func (in *IstioClient) GetServiceRoles(namespace string) ([]IstioObject, error)
func (*IstioClient) GetServices ¶
func (in *IstioClient) GetServices(namespace string, selectorLabels map[string]string) ([]v1.Service, error)
GetServices returns a list of services for a given namespace. If selectorLabels is defined the list of services is filtered for those that matches Services selector labels. It returns an error on any problem.
func (*IstioClient) GetStatefulSet ¶
func (in *IstioClient) GetStatefulSet(namespace string, statefulsetName string) (*appsv1.StatefulSet, error)
func (*IstioClient) GetStatefulSets ¶
func (in *IstioClient) GetStatefulSets(namespace string) ([]appsv1.StatefulSet, error)
func (*IstioClient) GetTemplate ¶
func (in *IstioClient) GetTemplate(namespace, templateType, templateName string) (IstioObject, error)
func (*IstioClient) GetTemplates ¶
func (in *IstioClient) GetTemplates(namespace string) ([]IstioObject, error)
func (*IstioClient) GetVirtualService ¶
func (in *IstioClient) GetVirtualService(namespace string, virtualservice string) (IstioObject, error)
func (*IstioClient) GetVirtualServices ¶
func (in *IstioClient) GetVirtualServices(namespace string, serviceName string) ([]IstioObject, error)
GetVirtualServices return all VirtualServices for a given namespace. If serviceName param is provided it will filter all VirtualServices having a host defined on a particular service. It returns an error on any problem.
func (*IstioClient) IsOpenShift ¶
func (in *IstioClient) IsOpenShift() bool
func (*IstioClient) Stop ¶
func (in *IstioClient) Stop()
func (*IstioClient) UpdateIstioObject ¶
func (in *IstioClient) UpdateIstioObject(api, namespace, resourceType, name, jsonPatch string) (IstioObject, error)
UpdateIstioObject updates an Istio object from either config api or networking api
type IstioClientInterface ¶
type IstioClientInterface interface { CreateIstioObject(api, namespace, resourceType, json string) (IstioObject, error) DeleteIstioObject(api, namespace, resourceType, name string) error GetAdapter(namespace, adapterType, adapterName string) (IstioObject, error) GetAdapters(namespace string) ([]IstioObject, error) GetCronJobs(namespace string) ([]batch_v1beta1.CronJob, error) GetDeployment(namespace string, deploymentName string) (*appsv1.Deployment, error) GetDeployments(namespace string) ([]appsv1.Deployment, error) GetDeploymentConfig(namespace string, deploymentconfigName string) (*osappsv1.DeploymentConfig, error) GetDeploymentConfigs(namespace string) ([]osappsv1.DeploymentConfig, error) GetDestinationRule(namespace string, destinationrule string) (IstioObject, error) GetDestinationRules(namespace string, serviceName string) ([]IstioObject, error) GetEndpoints(namespace string, serviceName string) (*v1.Endpoints, error) GetGateway(namespace string, gateway string) (IstioObject, error) GetGateways(namespace string) ([]IstioObject, error) GetIstioDetails(namespace string, serviceName string) (*IstioDetails, error) GetIstioRule(namespace string, istiorule string) (IstioObject, error) GetIstioRules(namespace string) ([]IstioObject, error) GetJobs(namespace string) ([]batch_v1.Job, error) GetNamespace(namespace string) (*v1.Namespace, error) GetNamespaces() ([]v1.Namespace, error) GetPods(namespace, labelSelector string) ([]v1.Pod, error) GetProject(project string) (*osv1.Project, error) GetProjects() ([]osv1.Project, error) GetQuotaSpec(namespace string, quotaSpecName string) (IstioObject, error) GetQuotaSpecs(namespace string) ([]IstioObject, error) GetQuotaSpecBinding(namespace string, quotaSpecBindingName string) (IstioObject, error) GetQuotaSpecBindings(namespace string) ([]IstioObject, error) GetReplicationControllers(namespace string) ([]v1.ReplicationController, error) GetReplicaSets(namespace string) ([]appsv1.ReplicaSet, error) GetSelfSubjectAccessReview(namespace, api, resourceType string, verbs []string) ([]*auth_v1.SelfSubjectAccessReview, error) GetService(namespace string, serviceName string) (*v1.Service, error) GetServices(namespace string, selectorLabels map[string]string) ([]v1.Service, error) GetServiceEntries(namespace string) ([]IstioObject, error) GetServiceEntry(namespace string, serviceEntryName string) (IstioObject, error) GetStatefulSet(namespace string, statefulsetName string) (*appsv1.StatefulSet, error) GetStatefulSets(namespace string) ([]appsv1.StatefulSet, error) GetTemplate(namespace, templateType, templateName string) (IstioObject, error) GetTemplates(namespace string) ([]IstioObject, error) GetPolicy(namespace string, policyName string) (IstioObject, error) GetPolicies(namespace string) ([]IstioObject, error) GetMeshPolicy(namespace string, policyName string) (IstioObject, error) GetMeshPolicies(namespace string) ([]IstioObject, error) GetClusterRbacConfig(namespace string, name string) (IstioObject, error) GetClusterRbacConfigs(namespace string) ([]IstioObject, error) GetServiceRole(namespace string, name string) (IstioObject, error) GetServiceRoles(namespace string) ([]IstioObject, error) GetServiceRoleBinding(namespace string, name string) (IstioObject, error) GetServiceRoleBindings(namespace string) ([]IstioObject, error) GetVirtualService(namespace string, virtualservice string) (IstioObject, error) GetVirtualServices(namespace string, serviceName string) ([]IstioObject, error) IsOpenShift() bool Stop() UpdateIstioObject(api, namespace, resourceType, name, jsonPatch string) (IstioObject, error) }
IstioClientInterface for mocks (only mocked function are necessary here)
type IstioDetails ¶
type IstioDetails struct { VirtualServices []IstioObject `json:"virtualservices"` DestinationRules []IstioObject `json:"destinationrules"` ServiceEntries []IstioObject `json:"serviceentries"` Gateways []IstioObject `json:"gateways"` }
IstioDetails is a wrapper to group all Istio objects related to a Service. Used to fetch all Istio information in a single operation instead to invoke individual APIs per each group.
type IstioObject ¶
type IstioObject interface { runtime.Object GetSpec() map[string]interface{} SetSpec(map[string]interface{}) GetObjectMeta() meta_v1.ObjectMeta SetObjectMeta(meta_v1.ObjectMeta) DeepCopyIstioObject() IstioObject }
IstioObject is a k8s wrapper interface for config objects. Taken from istio.io
type IstioObjectList ¶
type IstioObjectList interface { runtime.Object GetItems() []IstioObject }
IstioObjectList is a k8s wrapper interface for list config objects. Taken from istio.io
type KialiMonitoringClient ¶
type KialiMonitoringClient struct { KialiMonitoringInterface // contains filtered or unexported fields }
KialiMonitoringClient is the client struct for Kiali Monitoring API over Kubernetes API to get MonitoringDashboards
func NewKialiMonitoringClient ¶
func NewKialiMonitoringClient() (*KialiMonitoringClient, error)
NewKialiMonitoringClient creates a new client able to fetch Kiali Monitoring API.
func (*KialiMonitoringClient) GetDashboard ¶
func (in *KialiMonitoringClient) GetDashboard(namespace string, name string) (*MonitoringDashboard, error)
GetDashboard returns a MonitoringDashboard for the given name
type KialiMonitoringInterface ¶
type KialiMonitoringInterface interface {
GetDashboard(namespace string, name string) (*MonitoringDashboard, error)
}
KialiMonitoringInterface for mocks (only mocked function are necessary here)
type MTLSDetails ¶
type MTLSDetails struct { DestinationRules []IstioObject `json:"destinationrules"` MeshPolicies []IstioObject `json:"meshpolicies"` }
MTLSDetails is a wrapper to group all Istio objects related to non-local mTLS configurations
type MonitoringDashboard ¶
type MonitoringDashboard struct { Metadata map[string]interface{} Spec MonitoringDashboardSpec }
type MonitoringDashboardChart ¶
type MonitoringDashboardChart struct { Name string Unit string Spans int MetricName string DataType string // MetricType is either "raw", "rate" or "histogram" Aggregator string // Aggregator can be set for raw data. Ex: "sum", "avg". See https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators Aggregations []MonitoringDashboardAggregation }
type MonitoringDashboardSpec ¶
type MonitoringDashboardSpec struct { Title string Charts []MonitoringDashboardChart }
type ServiceDetails ¶
type ServiceDetails struct { Service *v1.Service `json:"service"` Endpoints *v1.Endpoints `json:"endpoints"` Deployments *v1beta1.DeploymentList `json:"deployments"` Autoscalers *autoscalingV1.HorizontalPodAutoscalerList `json:"autoscalers"` Pods []v1.Pod `json:"pods"` }
ServiceDetails is a wrapper to group full Service description, Endpoints and Pods. Used to fetch all details in a single operation instead to invoke individual APIs per each group.
type ServiceList ¶
type ServiceList struct { Services *v1.ServiceList Pods *v1.PodList Deployments *v1beta1.DeploymentList }
ServiceList holds list of services, pods and deployments