kubernetes

package
v1.36.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2021 License: Apache-2.0 Imports: 43 Imported by: 156

Documentation

Index

Constants

View Source
const (
	// Kubernetes Controllers
	ConfigMapType             = "ConfigMap"
	CronJobType               = "CronJob"
	DaemonSetType             = "DaemonSet"
	DeploymentType            = "Deployment"
	DeploymentConfigType      = "DeploymentConfig"
	EndpointsType             = "Endpoints"
	JobType                   = "Job"
	PodType                   = "Pod"
	ReplicationControllerType = "ReplicationController"
	ReplicaSetType            = "ReplicaSet"
	ServiceType               = "Service"
	StatefulSetType           = "StatefulSet"

	DestinationRules        = "destinationrules"
	DestinationRuleType     = "DestinationRule"
	DestinationRuleTypeList = "DestinationRuleList"

	Gateways        = "gateways"
	GatewayType     = "Gateway"
	GatewayTypeList = "GatewayList"

	EnvoyFilters        = "envoyfilters"
	EnvoyFilterType     = "EnvoyFilter"
	EnvoyFilterTypeList = "EnvoyFilterList"

	Sidecars        = "sidecars"
	SidecarType     = "Sidecar"
	SidecarTypeList = "SidecarList"

	ServiceEntries       = "serviceentries"
	ServiceEntryType     = "ServiceEntry"
	ServiceentryTypeList = "ServiceEntryList"

	VirtualServices        = "virtualservices"
	VirtualServiceType     = "VirtualService"
	VirtualServiceTypeList = "VirtualServiceList"

	WorkloadEntries       = "workloadentries"
	WorkloadEntryType     = "WorkloadEntry"
	WorkloadEntryTypeList = "WorkloadEntryList"

	WorkloadGroups        = "workloadgroups"
	WorkloadGroupType     = "WorkloadGroup"
	WorkloadGroupTypeList = "WorkloadGroupList"

	// Authorization PeerAuthentications
	AuthorizationPolicies         = "authorizationpolicies"
	AuthorizationPoliciesType     = "AuthorizationPolicy"
	AuthorizationPoliciesTypeList = "AuthorizationPolicyList"

	// Peer Authentications
	PeerAuthentications         = "peerauthentications"
	PeerAuthenticationsType     = "PeerAuthentication"
	PeerAuthenticationsTypeList = "PeerAuthenticationList"

	// Request Authentications
	RequestAuthentications         = "requestauthentications"
	RequestAuthenticationsType     = "RequestAuthentication"
	RequestAuthenticationsTypeList = "RequestAuthenticationList"

	Iter8Experiments        = "experiments"
	Iter8ExperimentType     = "Experiment"
	Iter8ExperimentTypeList = "ExperimentList"
	Iter8ConfigMap          = "iter8config-metrics"
)
View Source
const DefaultServiceAccountPath = "/var/run/secrets/kubernetes.io/serviceaccount/token"
View Source
const RemoteSecretData = "/kiali-remote-secret/kiali"

Variables

View Source
var (
	NetworkingGroupVersion = schema.GroupVersion{
		Group:   "networking.istio.io",
		Version: "v1alpha3",
	}
	ApiNetworkingVersion = NetworkingGroupVersion.Group + "/" + NetworkingGroupVersion.Version

	SecurityGroupVersion = schema.GroupVersion{
		Group:   "security.istio.io",
		Version: "v1beta1",
	}
	ApiSecurityVersion = SecurityGroupVersion.Group + "/" + SecurityGroupVersion.Version

	// We will add a new extesion API in a similar way as we added the Kubernetes + Istio APIs
	Iter8GroupVersion = schema.GroupVersion{
		Group:   "iter8.tools",
		Version: "v1alpha2",
	}
	ApiIter8Version = Iter8GroupVersion.Group + "/" + Iter8GroupVersion.Version

	// A map to get the plural for a Istio type using the singlar type
	PluralType = map[string]string{

		Gateways:         GatewayType,
		VirtualServices:  VirtualServiceType,
		DestinationRules: DestinationRuleType,
		ServiceEntries:   ServiceEntryType,
		Sidecars:         SidecarType,
		WorkloadEntries:  WorkloadEntryType,
		WorkloadGroups:   WorkloadGroupType,
		EnvoyFilters:     EnvoyFilterType,

		AuthorizationPolicies:  AuthorizationPoliciesType,
		PeerAuthentications:    PeerAuthenticationsType,
		RequestAuthentications: RequestAuthenticationsType,

		Iter8Experiments: Iter8ExperimentType,
	}

	ResourceTypesToAPI = map[string]string{
		DestinationRules:       NetworkingGroupVersion.Group,
		VirtualServices:        NetworkingGroupVersion.Group,
		ServiceEntries:         NetworkingGroupVersion.Group,
		Gateways:               NetworkingGroupVersion.Group,
		Sidecars:               NetworkingGroupVersion.Group,
		WorkloadEntries:        NetworkingGroupVersion.Group,
		WorkloadGroups:         NetworkingGroupVersion.Group,
		EnvoyFilters:           NetworkingGroupVersion.Group,
		AuthorizationPolicies:  SecurityGroupVersion.Group,
		PeerAuthentications:    SecurityGroupVersion.Group,
		RequestAuthentications: SecurityGroupVersion.Group,

		Iter8Experiments: Iter8GroupVersion.Group,
	}

	ApiToVersion = map[string]string{
		NetworkingGroupVersion.Group: ApiNetworkingVersion,
		SecurityGroupVersion.Group:   ApiSecurityVersion,
	}
)
View Source
var KialiToken string

Functions

func ConfigClient

func ConfigClient() (*rest.Config, error)

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 DestinationRuleHasMTLSEnabled added in v1.31.0

func DestinationRuleHasMTLSEnabled(destinationRule IstioObject) (bool, string)

func DestinationRuleHasMTLSEnabledForHost added in v0.16.0

func DestinationRuleHasMTLSEnabledForHost(expectedHost string, destinationRule IstioObject) (bool, string)

func DestinationRuleHasMeshWideMTLSEnabled added in v0.16.0

func DestinationRuleHasMeshWideMTLSEnabled(destinationRule IstioObject) (bool, string)

func DestinationRuleHasNamespaceWideMTLSEnabled added in v0.16.0

func DestinationRuleHasNamespaceWideMTLSEnabled(namespace string, destinationRule IstioObject) (bool, string)

func FilterByHost

func FilterByHost(host, serviceName, namespace string) bool

func FilterByRegistryStatus added in v1.35.0

func FilterByRegistryStatus(hostname string, registryStatus *RegistryStatus) bool

func FilterByRoute added in v0.6.0

func FilterByRoute(spec map[string]interface{}, protocols []string, service string, namespace string, serviceEntries map[string]struct{}) bool

func FilterPodsForController added in v0.9.0

func FilterPodsForController(controllerName string, controllerType string, allPods []core_v1.Pod) []core_v1.Pod

func FilterPodsForEndpoints added in v0.8.0

func FilterPodsForEndpoints(endpoints *core_v1.Endpoints, unfiltered []core_v1.Pod) []core_v1.Pod

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 added in v0.9.0

func FilterPodsForSelector(selector labels.Selector, allPods []core_v1.Pod) []core_v1.Pod

func FilterPodsForService

func FilterPodsForService(s *core_v1.Service, allPods []core_v1.Pod) []core_v1.Pod

FilterPodsForService returns a subpart of pod list filtered according service selector

func FilterServicesByLabels added in v1.34.1

func FilterServicesByLabels(selector labels.Selector, allServices []core_v1.Service) []core_v1.Service

func FilterServicesForSelector added in v0.9.0

func FilterServicesForSelector(selector labels.Selector, allServices []core_v1.Service) []core_v1.Service

func GatewayNames added in v0.7.0

func GatewayNames(gateways [][]IstioObject) map[string]struct{}

GatewayNames extracts the gateway names for easier matching

func GetKialiToken added in v0.21.0

func GetKialiToken() (string, error)

func HasMatchingRegistryStatus added in v1.36.0

func HasMatchingRegistryStatus(host string, registryStatus []*RegistryStatus) bool

HasMatchingRegistryStatus returns true when the FDQN of the host param matches with one registry status of the registryStatus param.

func HasMatchingServiceEntries added in v1.15.0

func HasMatchingServiceEntries(service string, serviceEntries map[string][]string) bool

func HasMatchingServices added in v1.15.0

func HasMatchingServices(service string, services []core_v1.Service) bool

func HasMatchingVirtualServices added in v1.22.1

func HasMatchingVirtualServices(host Host, virtualServices []IstioObject) bool

func HasMatchingWorkloads added in v1.15.0

func HasMatchingWorkloads(service string, workloadList []labels.Set) bool

func HostWithinWildcardHost added in v1.22.1

func HostWithinWildcardHost(subdomain, wildcardDomain string) bool

func MatchPortNameRule added in v0.19.0

func MatchPortNameRule(portName, protocol string) bool

func MatchPortNameWithValidProtocols added in v0.19.0

func MatchPortNameWithValidProtocols(portName string) bool

func NewNotFound added in v0.7.0

func NewNotFound(name, group, resource string) error

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 ParseTwoPartHost added in v1.15.0

func ParseTwoPartHost(host Host) (string, string)

func PeerAuthnHasMTLSEnabled added in v1.18.1

func PeerAuthnHasMTLSEnabled(peerAuthn IstioObject) (bool, string)

func PeerAuthnHasStrictMTLS added in v1.18.1

func PeerAuthnHasStrictMTLS(peerAuthn IstioObject) bool

func PeerAuthnMTLSMode added in v1.31.0

func PeerAuthnMTLSMode(peerAuthn IstioObject) (bool, string)

func ServiceEntryHostnames added in v0.7.0

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 UseRemoteCreds added in v1.23.0

func UseRemoteCreds(remoteSecret *RemoteSecret) (*rest.Config, error)

Point the k8s client to a remote cluster's API server

func ValidatePort added in v0.15.0

func ValidatePort(portDef interface{}) bool

ValidaPort parses the Istio Port definition and validates the naming scheme

Types

type ClientFactory added in v0.16.0

type ClientFactory interface {
	GetClient(authInfo *api.AuthInfo) (ClientInterface, error)
}

ClientFactory interface for the clientFactory object

func GetClientFactory added in v0.17.0

func GetClientFactory() (ClientFactory, error)

GetClientFactory returns the client factory. Creates a new one if necessary

type ClientInterface added in v1.20.0

type ClientInterface interface {
	GetServerVersion() (*version.Info, error)
	GetToken() string
	GetAuthInfo() *api.AuthInfo
	IsOpenShift() bool
	K8SClientInterface
	IstioClientInterface
	Iter8ClientInterface
	OSClientInterface
}

ClientInterface for mocks (only mocked function are necessary here)

type ClusterDump added in v1.28.0

type ClusterDump struct {
	DynamicClusters []EnvoyClusterWrapper `mapstructure:"dynamic_active_clusters"`
	StaticClusters  []EnvoyClusterWrapper `mapstructure:"static_clusters"`
}

type ConfigDump added in v1.28.0

type ConfigDump struct {
	Configs []interface{} `json:"configs"`
}

Root of ConfigDump

func (*ConfigDump) GetClusters added in v1.28.0

func (cd *ConfigDump) GetClusters() (*ClusterDump, error)

func (*ConfigDump) GetConfig added in v1.28.0

func (cd *ConfigDump) GetConfig(objectType string) map[string]interface{}

func (*ConfigDump) GetListeners added in v1.28.0

func (cd *ConfigDump) GetListeners() (*ListenerDump, error)

func (*ConfigDump) GetRoutes added in v1.28.0

func (cd *ConfigDump) GetRoutes() (*RouteDump, error)

type CounterMetric added in v1.24.0

type CounterMetric struct {
	Name               string  `json:"name" yaml:"name"`
	QueryTemplate      string  `json:"query_template" yaml:"query_template"`
	PreferredDirection *string `json:"preferred_direction,omitempty" yaml:"preferred_direction,omitempty"`
	Unit               *string `json:"unit,omitempty" yaml:"unit,omitempty"`
}

type DynamicListener added in v1.28.0

type DynamicListener struct {
	Name        string         `mapstructure:"name"`
	ActiveState StaticListener `mapstructure:"active_state"`
}

type EnvoyCluster added in v1.28.0

type EnvoyCluster struct {
	Name     string         `mapstructure:"name"`
	Type     string         `mapstructure:"type"`
	Metadata *EnvoyMetadata `mapstructure:"metadata,omitempty"`
}

type EnvoyClusterWrapper added in v1.28.0

type EnvoyClusterWrapper struct {
	Cluster EnvoyCluster `mapstructure:"cluster"`
}

type EnvoyFilterChain added in v1.28.0

type EnvoyFilterChain struct {
	Filters          []EnvoyListenerFilter `mapstructure:"filters"`
	FilterChainMatch *FilterChainMatch     `mapstructure:"filter_chain_match"`
}

type EnvoyListener added in v1.28.0

type EnvoyListener struct {
	Address struct {
		SocketAddress struct {
			Address   string  `mapstructure:"address"`
			PortValue float64 `mapstructure:"port_value"`
		} `mapstructure:"socket_address"`
	} `mapstructure:"address"`
	FilterChains       []EnvoyFilterChain `mapstructure:"filter_chains,omitempty"`
	DefaultFilterChain *EnvoyFilterChain  `mapstructure:"default_filter_chain,omitempty"`
}

type EnvoyListenerFilter added in v1.28.0

type EnvoyListenerFilter struct {
	Name        string `mapstructure:"name"`
	TypedConfig struct {
		Type        string       `mapstructure:"@type"`
		Cluster     string       `mapstructure:"cluster"`
		RouteConfig *RouteConfig `mapstructure:"route_config,omitempty"`
		Rds         *struct {
			RouteConfigName string `mapstructure:"route_config_name"`
		} `mapstructure:"rds,omitempty"`
	} `mapstructure:"typed_config"`
}

type EnvoyMetadata added in v1.28.0

type EnvoyMetadata struct {
	FilterMetadata *struct {
		Istio *struct {
			Config string `mapstructure:"config,omitempty"`
		} `mapstructure:"istio,omitempty"`
	} `mapstructure:"filter_metadata,omitempty"`
}

type EnvoyRouteConfig added in v1.28.0

type EnvoyRouteConfig struct {
	RouteConfig *RouteConfig `mapstructure:"route_config,omitempty"`
}

type ExperimentAction added in v1.24.0

type ExperimentAction struct {
	Action       string           `json:"action"`
	TrafficSplit map[string]int32 `json:"trafficSplit,omitempty"`
}

type FilterChainMatch added in v1.28.0

type FilterChainMatch struct {
	ApplicationProtocols []string `mapstructure:"application_protocols,omitempty"`
	TransportProtocol    string   `mapstructure:"transport_protocol,omitempty"`
	ServerNames          []string `mapstructure:"server_names,omitempty"`
	DestinationPort      *int32   `mapstructure:"destination_port,omitempty"`
	PrefixRanges         []struct {
		AddressPrefix string `mapstructure:"address_prefix"`
		PrefixLen     int    `mapstructure:"prefix_len"`
	} `mapstructure:"prefix_ranges"`
}

type GenericIstioObject added in v0.11.0

type GenericIstioObject struct {
	meta_v1.TypeMeta   `json:",inline" yaml:",inline"`
	meta_v1.ObjectMeta `json:"metadata" yaml:"metadata"`
	Spec               map[string]interface{} `json:"spec"`
	Status             map[string]interface{} `json:"status"`
}

GenericIstioObject is a type to test Istio types defined by Istio as a Kubernetes extension.

func (*GenericIstioObject) DeepCopy added in v0.11.0

func (in *GenericIstioObject) DeepCopy() *GenericIstioObject

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericIstioObject.

func (*GenericIstioObject) DeepCopyInto added in v0.11.0

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 added in v0.11.0

func (in *GenericIstioObject) DeepCopyIstioObject() IstioObject

DeepCopyIstioObject is an autogenerated deepcopy function, copying the receiver, creating a new IstioObject.

func (*GenericIstioObject) DeepCopyObject added in v0.11.0

func (in *GenericIstioObject) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*GenericIstioObject) GetObjectMeta added in v0.11.0

func (in *GenericIstioObject) GetObjectMeta() meta_v1.ObjectMeta

GetObjectMeta from a wrapper

func (*GenericIstioObject) GetSpec added in v0.11.0

func (in *GenericIstioObject) GetSpec() map[string]interface{}

GetSpec from a wrapper

func (*GenericIstioObject) GetStatus added in v1.24.0

func (in *GenericIstioObject) GetStatus() map[string]interface{}

GetStatus from a wrapper

func (*GenericIstioObject) GetTypeMeta added in v0.16.0

func (in *GenericIstioObject) GetTypeMeta() meta_v1.TypeMeta

GetTypeMeta from a wrapper

func (*GenericIstioObject) HasMatchLabelsSelector added in v1.18.1

func (in *GenericIstioObject) HasMatchLabelsSelector() bool

func (*GenericIstioObject) HasWorkloadSelectorLabels added in v1.16.0

func (in *GenericIstioObject) HasWorkloadSelectorLabels() bool

func (*GenericIstioObject) SetObjectMeta added in v0.11.0

func (in *GenericIstioObject) SetObjectMeta(metadata meta_v1.ObjectMeta)

SetObjectMeta for a wrapper

func (*GenericIstioObject) SetSpec added in v0.11.0

func (in *GenericIstioObject) SetSpec(spec map[string]interface{})

SetSpec for a wrapper

func (*GenericIstioObject) SetStatus added in v1.24.0

func (in *GenericIstioObject) SetStatus(status map[string]interface{})

SetStatus for a wrapper

func (*GenericIstioObject) SetTypeMeta added in v0.16.0

func (in *GenericIstioObject) SetTypeMeta(typemeta meta_v1.TypeMeta)

SetObjectMeta for a wrapper

type GenericIstioObjectList added in v0.11.0

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 added in v0.11.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericIstioObjectList.

func (*GenericIstioObjectList) DeepCopyInto added in v0.11.0

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 added in v0.11.0

func (in *GenericIstioObjectList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*GenericIstioObjectList) GetItems added in v0.11.0

func (in *GenericIstioObjectList) GetItems() []IstioObject

GetItems from a wrapper

type HTTPMatchRequest added in v1.24.0

type HTTPMatchRequest struct {
	// The name assigned to a match.
	Name string `json:"name,omitempty"`

	// URI to match
	URI *StringMatch `json:"uri,omitempty"`

	// Scheme Scheme
	Scheme *StringMatch `json:"scheme,omitempty"`

	// HTTP Method
	Method *StringMatch `json:"method,omitempty"`

	// HTTP Authority
	Authority *StringMatch `json:"authority,omitempty"`

	// Headers to match
	Headers map[string]*StringMatch `json:"headers,omitempty"`

	// Specifies the ports on the host that is being addressed.
	Port uint32 `json:"port,omitempty"`

	// SourceLabels for matching
	SourceLabels map[string]string `json:"sourceLabels,omitempty"`

	// Gateways for matching
	Gateways []string `json:"gateways,omitempty"`

	// Query parameters for matching.
	QueryParams map[string]StringMatch `json:"query_params,omitempty"`

	// Flag to specify whether the URI matching should be case-insensitive.
	IgnoreURICase bool `json:"ignore_uri_case,omitempty"`
}

type Host added in v0.15.0

type Host struct {
	Service   string `json:"service"`
	Namespace string `json:"namespace"`
	Cluster   string `json:"cluster"`
	// CompleteInput is true when Service, Namespace and Cluster fields are present.
	// It is true for simple service names and FQDN services.
	// It is false for service.namespace format and service entries.
	CompleteInput bool `json:"complete_input"`
}

Host represents the FQDN format for Istio hostnames

func GetHost added in v1.12.0

func GetHost(hostName, namespace, cluster string, clusterNamespaces []string) Host

GetHost parses hostName and returns a Host struct. It considers Namespaces in the cluster to be more accurate when deciding if the hostName is a ServiceEntry or a service.namespace host definition.

func ParseGatewayAsHost added in v1.19.0

func ParseGatewayAsHost(gateway, currentNamespace, currentCluster string) Host

func ParseHost added in v0.15.0

func ParseHost(hostName, namespace, cluster string) Host

ParseHost takes as an input a hostname (simple or full FQDN), namespace and clusterName and returns a parsed Host struct

func (Host) String added in v0.15.0

func (h Host) String() string

String outputs a full FQDN version of the Host

type IstioClientInterface

type IstioClientInterface interface {
	CreateIstioObject(api, namespace, resourceType, json string) (IstioObject, error)
	DeleteIstioObject(api, namespace, resourceType, name string) error
	GetIstioObject(namespace, resourceType, name string) (IstioObject, error)
	GetIstioObjects(namespace, resourceType, labelSelector string) ([]IstioObject, error)
	UpdateIstioObject(api, namespace, resourceType, name, jsonPatch string) (IstioObject, error)
	GetProxyStatus() ([]*ProxyStatus, error)
	GetConfigDump(namespace, podName string) (*ConfigDump, error)
	GetRegistryStatus() ([]*RegistryStatus, error)
}

type IstioDetails

type IstioDetails struct {
	VirtualServices        []IstioObject `json:"virtualservices"`
	DestinationRules       []IstioObject `json:"destinationrules"`
	ServiceEntries         []IstioObject `json:"serviceentries"`
	Gateways               []IstioObject `json:"gateways"`
	Sidecars               []IstioObject `json:"sidecars"`
	RequestAuthentications []IstioObject `json:"requestauthentications"`
}

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 IstioMeshConfig added in v1.18.1

type IstioMeshConfig struct {
	DisableMixerHttpReports bool  `yaml:"disableMixerHttpReports,omitempty"`
	EnableAutoMtls          *bool `yaml:"enableAutoMtls,omitempty"`
}

func GetIstioConfigMap added in v1.23.0

func GetIstioConfigMap(istioConfig *core_v1.ConfigMap) (*IstioMeshConfig, error)

func (IstioMeshConfig) GetEnableAutoMtls added in v1.18.1

func (imc IstioMeshConfig) GetEnableAutoMtls() bool

type IstioObject

type IstioObject interface {
	runtime.Object
	GetSpec() map[string]interface{}
	SetSpec(map[string]interface{})
	GetStatus() map[string]interface{}
	SetStatus(map[string]interface{})
	GetTypeMeta() meta_v1.TypeMeta
	SetTypeMeta(meta_v1.TypeMeta)
	GetObjectMeta() meta_v1.ObjectMeta
	SetObjectMeta(meta_v1.ObjectMeta)
	DeepCopyIstioObject() IstioObject
	HasWorkloadSelectorLabels() bool
	HasMatchLabelsSelector() bool
}

IstioObject is a k8s wrapper interface for config objects. Taken from istio.io

func FilterDestinationRules added in v1.9.0

func FilterDestinationRules(allDr []IstioObject, namespace string, serviceName string) []IstioObject

func FilterIstioObjectsForSelector added in v1.22.0

func FilterIstioObjectsForSelector(selector labels.Selector, allObjects []IstioObject) []IstioObject

func FilterIstioObjectsForWorkloadSelector added in v1.24.0

func FilterIstioObjectsForWorkloadSelector(workloadSelector string, allObjects []IstioObject) []IstioObject

func FilterVirtualServices added in v1.9.0

func FilterVirtualServices(allVs []IstioObject, namespace string, serviceName string) []IstioObject

type IstioObjectList

type IstioObjectList interface {
	runtime.Object
	GetItems() []IstioObject
}

IstioObjectList is a k8s wrapper interface for list config objects. Taken from istio.io

type Iter8ClientInterface added in v1.15.0

type Iter8ClientInterface interface {
	CreateIter8Experiment(namespace string, json string) (Iter8Experiment, error)
	UpdateIter8Experiment(namespace string, name string, json string) (Iter8Experiment, error)
	DeleteIter8Experiment(namespace string, name string) error
	GetIter8Experiment(namespace string, name string) (Iter8Experiment, error)
	GetIter8Experiments(namespace string) ([]Iter8Experiment, error)
	IsIter8Api() bool
	Iter8MetricMap() ([]string, error)
}

type Iter8CriterionAssessment added in v1.24.0

type Iter8CriterionAssessment struct {
	ID         string `json:"id"`
	MetricID   string `json:"metric_id"`
	Statistics struct {
		Value           *float32 `json:"value,omitempty"`
		RatioStatistics struct {
			ImprovementOverBaseline struct {
				Lower *float32 `json:"lower"`
				Upper *float32 `json:"upper"`
			} `json:"improvement_over_baseline"`
			ProbabilityOfBeatingBaseline  *float32 `json:"probability_of_beating_baseline"`
			ProbabilityOfBeingBestVersion *float32 `json:"probability_of_being_best_version"`
			CredibleInterval              struct {
				Lower *float32 `json:"lower"`
				Upper *float32 `json:"upper"`
			} `json:"credible_interval"`
		} `json:"ratio_statistics,omitempty"`
	} `json:"statistics,omitempty"`
	ThresholdAssessment *struct {
		ThresholdBreached                bool     `json:"threshold_breached"`
		ProbabilityOfSatisfyingTHreshold *float32 `json:"probability_of_satisfying_threshold"`
	} `json:"threshold_assessment,omitempty"`
}

type Iter8Duration added in v1.24.0

type Iter8Duration struct {
	Interval      *string `json:"interval,omitempty"`
	MaxIterations *int32  `json:"maxIterations,omitempty"`
}

type Iter8Experiment added in v1.15.0

type Iter8Experiment interface {
	runtime.Object
	GetSpec() Iter8ExperimentSpec
	SetSpec(Iter8ExperimentSpec)
	GetStatus() Iter8ExperimentStatus
	SetStatus(Iter8ExperimentStatus)
	GetTypeMeta() meta_v1.TypeMeta
	SetTypeMeta(meta_v1.TypeMeta)
	GetObjectMeta() meta_v1.ObjectMeta
	SetObjectMeta(meta_v1.ObjectMeta)
	DeepCopyIter8Object() Iter8Experiment
}

Iter8Experiment is a dynamic object to map Iter8 Experiments

type Iter8ExperimentAction added in v1.20.0

type Iter8ExperimentAction string

type Iter8ExperimentCRD added in v1.24.0

type Iter8ExperimentCRD struct {
	meta_v1.TypeMeta   `json:",inline"`
	meta_v1.ObjectMeta `json:"metadata,omitempty"`

	Spec Iter8ExperimentSpec `json:"spec"`
}

type Iter8ExperimentList added in v1.15.0

type Iter8ExperimentList interface {
	runtime.Object
	GetItems() []Iter8Experiment
}

type Iter8ExperimentMetrics added in v1.15.0

type Iter8ExperimentMetrics map[string]struct {
	AbsentValue        string `json:"absent_value,omitempty"`
	IsCounter          bool   `json:"is_counter,omitempty"`
	QueryTemplate      string `json:"query_template,omitempty"`
	SampleSizeTemplate string `json:"sample_size_template,omitempty"`
}

type Iter8ExperimentObject added in v1.15.0

type Iter8ExperimentObject struct {
	meta_v1.TypeMeta   `json:",inline"`
	meta_v1.ObjectMeta `json:"metadata,omitempty"`

	Spec Iter8ExperimentSpec `json:"spec"`
	// +optional
	Status Iter8ExperimentStatus `json:"status,omitempty"`
}

func (*Iter8ExperimentObject) DeepCopy added in v1.15.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericIstioObject.

func (*Iter8ExperimentObject) DeepCopyInto added in v1.15.0

func (in *Iter8ExperimentObject) DeepCopyInto(out *Iter8ExperimentObject)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Iter8ExperimentObject) DeepCopyIter8Object added in v1.15.0

func (in *Iter8ExperimentObject) DeepCopyIter8Object() Iter8Experiment

func (*Iter8ExperimentObject) DeepCopyObject added in v1.15.0

func (in *Iter8ExperimentObject) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Iter8ExperimentObject) GetObjectMeta added in v1.15.0

func (in *Iter8ExperimentObject) GetObjectMeta() meta_v1.ObjectMeta

GetObjectMeta from a wrapper

func (*Iter8ExperimentObject) GetSpec added in v1.15.0

GetSpec from a wrapper

func (*Iter8ExperimentObject) GetStatus added in v1.15.0

func (*Iter8ExperimentObject) GetTypeMeta added in v1.15.0

func (in *Iter8ExperimentObject) GetTypeMeta() meta_v1.TypeMeta

GetTypeMeta from a wrapper

func (*Iter8ExperimentObject) SetObjectMeta added in v1.15.0

func (in *Iter8ExperimentObject) SetObjectMeta(metadata meta_v1.ObjectMeta)

SetObjectMeta for a wrapper

func (*Iter8ExperimentObject) SetSpec added in v1.15.0

func (in *Iter8ExperimentObject) SetSpec(spec Iter8ExperimentSpec)

SetSpec for a wrapper

func (*Iter8ExperimentObject) SetStatus added in v1.15.0

func (in *Iter8ExperimentObject) SetStatus(status Iter8ExperimentStatus)

SetStatus for a wrapper

func (*Iter8ExperimentObject) SetTypeMeta added in v1.15.0

func (in *Iter8ExperimentObject) SetTypeMeta(typemeta meta_v1.TypeMeta)

SetObjectMeta for a wrapper

type Iter8ExperimentObjectList added in v1.15.0

type Iter8ExperimentObjectList struct {
	meta_v1.TypeMeta `json:",inline"`
	meta_v1.ListMeta `json:"metadata"`
	Items            []Iter8ExperimentObject `json:"items"`
}

func (*Iter8ExperimentObjectList) DeepCopy added in v1.15.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GenericIstioObjectList.

func (*Iter8ExperimentObjectList) DeepCopyInto added in v1.15.0

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Iter8ExperimentObjectList) DeepCopyObject added in v1.15.0

func (in *Iter8ExperimentObjectList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Iter8ExperimentObjectList) GetItems added in v1.15.0

func (in *Iter8ExperimentObjectList) GetItems() []Iter8Experiment

GetItems from a wrapper

type Iter8ExperimentSpec added in v1.15.0

type Iter8ExperimentSpec struct {
	Service struct {
		core_v1.ObjectReference `json:",inline"`
		Baseline                string   `json:"baseline"`
		Candidates              []string `json:"candidates"`
		Port                    *int32   `json:"port,omitempty"`
	} `json:"service"`

	Criteria []struct {
		Metric    string          `json:"metric"`
		Threshold *Iter8Threshold `json:"threshold,omitempty"`
		IsReward  bool            `json:"isReward,omitempty"`
	} `json:"criteria,omitempty"`
	TrafficControl struct {
		Strategy      string `json:"strategy,omitempty"`
		OnTermination string `json:"onTermination,omitempty"`
		Match         struct {
			HTTP []*HTTPMatchRequest `json:"http,omitempty"`
		} `json:"match,omitempty"`
		Percentage   int32 `json:"percentage,omitempty"`
		MaxIncrement int32 `json:"maxIncrement,omitempty"`
	} `json:"trafficControl,omitempty"`
	AnalyticsEndpoint string        `json:"analyticsEndpoint,omitempty"`
	Duration          Iter8Duration `json:"duration,omitempty"`
	Cleanup           bool          `json:"cleanup,omitempty"`
	Metrics           struct {
		CounterMetrics []CounterMetric `json:"counter_metrics,omitempty"`
		RatioMetrics   []RatioMetric   `json:"ratio_metrics,omitempty"`
	} `json:"metrics,omitempty"`
	ManualOverride *ExperimentAction `json:"manualOverride,omitempty"`
	Networking     *Iter8Networking  `json:"networking,omitempty"`
}

Linked with https://github.com/iter8-tools/iter8-controller/blob/master/pkg/apis/iter8/v1alpha2/experiment_types.go ExperimentSpec defines the desired state of Experiment

type Iter8ExperimentStatus added in v1.15.0

type Iter8ExperimentStatus struct {
	Conditions []struct {
		LastTransitionTime string `json:"lastTransitionTime"`
		Message            string `json:"message"`
		Reason             string `json:"reason"`
		Status             string `json:"status"`
		Type               string `json:"type"`
	} `json:"conditions"`
	InitTimeStamp    meta_v1.Time           `json:"initTimestamp"`
	StartTimeStamp   meta_v1.Time           `json:"startTimestamp"`
	EndTimestamp     meta_v1.Time           `json:"endTimestamp,omitempty"`
	LastUpdateTime   string                 `json:"lastUpdateTime"`
	CurrentIteration int                    `json:"currentIteration"`
	AnalysisState    map[string]interface{} `json:"analysisState"`
	GrafanaURL       string                 `json:"grafanaURL"`
	Assestment       struct {
		Baseline   Iter8VersionAssessment   `json:"baseline"`
		Candidates []Iter8VersionAssessment `json:"candidates"`
		Winner     struct {
			Name        *string  `json:"name,omitempty"`
			WinnerFound *bool    `json:"winning_version_found"`
			Winner      string   `json:"current_best_version,omitempty"`
			Probability *float32 `json:"probability_of_winning_for_best_version,omitempty"`
		} `json:"winner"`
	} `json:"assessment"`
	Phase          string   `json:"phase"`
	Message        string   `json:"message"`
	ExperimentType string   `json:"experimentType,omitempty"`
	EffectiveHosts []string `json:"effectiveHosts,omitempty"`
}

type Iter8Host added in v1.22.1

type Iter8Host struct {
	Name    string `json:"name"`
	Gateway string `json:"gateway"`
}

type Iter8Networking added in v1.24.0

type Iter8Networking struct {
	// id of router
	// +optional
	ID string `json:"id,omitempty"`

	// List of hosts used to receive external traffic
	// +optional
	Hosts []Iter8Host `json:"hosts,omitempty"`
}

type Iter8Threshold added in v1.24.0

type Iter8Threshold struct {
	Type                     string  `json:"type,omitempty"`
	Value                    float32 `json:"value,omitempty"`
	CutoffTrafficOnViolation bool    `json:"cutoffTrafficOnViolation,omitempty"`
}

type Iter8VersionAssessment added in v1.24.0

type Iter8VersionAssessment struct {
	ID                   string                     `json:"id"`
	Name                 string                     `json:"name"`
	Weight               int32                      `json:"weight"`
	WinProbability       float32                    `json:"win_probability"`
	RequestCount         int32                      `json:"request_count"`
	CriterionAssessments []Iter8CriterionAssessment `json:"criterion_assessments,omitempty"`
	Rollback             bool
}

type K8SClient added in v1.20.0

type K8SClient struct {
	ClientInterface
	// contains filtered or unexported fields
}

K8SClient is the client struct for Kubernetes and Istio APIs It hides the way it queries each API

func NewClientFromConfig added in v0.9.0

func NewClientFromConfig(config *rest.Config) (*K8SClient, 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 (*K8SClient) CreateIstioObject added in v1.20.0

func (in *K8SClient) CreateIstioObject(api, namespace, resourceType, json string) (IstioObject, error)

CreateIstioObject creates an Istio object

func (*K8SClient) CreateIter8Experiment added in v1.20.0

func (in *K8SClient) CreateIter8Experiment(namespace string, json string) (Iter8Experiment, error)

func (*K8SClient) DeleteIstioObject added in v1.20.0

func (in *K8SClient) DeleteIstioObject(api, namespace, resourceType, name string) error

DeleteIstioObject deletes an Istio object from either config api or networking api

func (*K8SClient) DeleteIter8Experiment added in v1.20.0

func (in *K8SClient) DeleteIter8Experiment(namespace string, name string) error

func (*K8SClient) EnvoyForward added in v1.28.0

func (in *K8SClient) EnvoyForward(namespace, podName, path string) ([]byte, error)

func (*K8SClient) GetClusterServicesByLabels added in v1.34.1

func (in *K8SClient) GetClusterServicesByLabels(labelsSelector string) ([]core_v1.Service, error)

GetClusterServicesByLabels fetches and returns all services in the whole cluster that match the optional labelSelector. This is using the cluster-wide call to fetch the services. The client will need to be created with an account that has cluster-wide privileges to list services.

func (*K8SClient) GetConfigDump added in v1.28.0

func (in *K8SClient) GetConfigDump(namespace, podName string) (*ConfigDump, error)

func (*K8SClient) GetConfigMap added in v1.20.0

func (in *K8SClient) GetConfigMap(namespace, name string) (*core_v1.ConfigMap, error)

GetConfigMap fetches and returns the specified ConfigMap definition from the cluster

func (*K8SClient) GetCronJobs added in v1.20.0

func (in *K8SClient) GetCronJobs(namespace string) ([]batch_v1beta1.CronJob, error)

func (*K8SClient) GetDaemonSet added in v1.33.0

func (in *K8SClient) GetDaemonSet(namespace string, name string) (*apps_v1.DaemonSet, error)

func (*K8SClient) GetDaemonSets added in v1.33.0

func (in *K8SClient) GetDaemonSets(namespace string) ([]apps_v1.DaemonSet, error)

func (*K8SClient) GetDeployment added in v1.20.0

func (in *K8SClient) GetDeployment(namespace, name string) (*apps_v1.Deployment, error)

GetDeployment returns the definition of a specific deployment. It returns an error on any problem.

func (*K8SClient) GetDeploymentConfig added in v1.20.0

func (in *K8SClient) GetDeploymentConfig(namespace, name string) (*osapps_v1.DeploymentConfig, error)

GetDeployment returns the definition of a specific deployment. It returns an error on any problem.

func (*K8SClient) GetDeploymentConfigs added in v1.20.0

func (in *K8SClient) GetDeploymentConfigs(namespace string) ([]osapps_v1.DeploymentConfig, error)

GetDeployments returns an array of deployments for a given namespace. An empty labelSelector will fetch all Deployments for a namespace. It returns an error on any problem.

func (*K8SClient) GetDeployments added in v1.20.0

func (in *K8SClient) GetDeployments(namespace string) ([]apps_v1.Deployment, error)

GetDeployments returns an array of deployments for a given namespace. It returns an error on any problem.

func (*K8SClient) GetEndpoints added in v1.20.0

func (in *K8SClient) GetEndpoints(namespace, name string) (*core_v1.Endpoints, error)

GetEndpoints return the list of endpoint of a specific service. It returns an error on any problem.

func (*K8SClient) GetIstioNetworkingApi added in v1.20.0

func (client *K8SClient) GetIstioNetworkingApi() *rest.RESTClient

GetIstioNetworkingApi returns the istio config rest client

func (*K8SClient) GetIstioObject added in v1.20.0

func (in *K8SClient) GetIstioObject(namespace, resourceType, name string) (IstioObject, error)

func (*K8SClient) GetIstioObjects added in v1.20.0

func (in *K8SClient) GetIstioObjects(namespace, resourceType, labelSelector string) ([]IstioObject, error)

func (*K8SClient) GetIstioSecurityApi added in v1.20.0

func (client *K8SClient) GetIstioSecurityApi() *rest.RESTClient

GetIstioSecurityApi returns the istio security rest client

func (*K8SClient) GetIter8Experiment added in v1.20.0

func (in *K8SClient) GetIter8Experiment(namespace string, name string) (Iter8Experiment, error)

func (*K8SClient) GetIter8Experiments added in v1.20.0

func (in *K8SClient) GetIter8Experiments(namespace string) ([]Iter8Experiment, error)

func (*K8SClient) GetJobs added in v1.20.0

func (in *K8SClient) GetJobs(namespace string) ([]batch_v1.Job, error)

func (*K8SClient) GetK8sApi added in v1.20.0

func (client *K8SClient) GetK8sApi() *kube.Clientset

GetK8sApi returns the clientset referencing all K8s rest clients

func (*K8SClient) GetNamespace added in v1.20.0

func (in *K8SClient) GetNamespace(namespace string) (*core_v1.Namespace, error)

GetNamespace fetches and returns the specified namespace definition from the cluster

func (*K8SClient) GetNamespaces added in v1.20.0

func (in *K8SClient) GetNamespaces(labelSelector string) ([]core_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 (*K8SClient) GetPod added in v1.20.0

func (in *K8SClient) GetPod(namespace, name string) (*core_v1.Pod, error)

GetPod returns the pod definitions for a given pod name. It returns an error on any problem.

func (*K8SClient) GetPodLogs added in v1.20.0

func (in *K8SClient) GetPodLogs(namespace, name string, opts *core_v1.PodLogOptions) (*PodLogs, error)

GetPod returns the pod definitions for a given pod name. It returns an error on any problem.

func (*K8SClient) GetPodProxy added in v1.30.0

func (in *K8SClient) GetPodProxy(namespace, name, path string) ([]byte, error)

func (*K8SClient) GetPods added in v1.20.0

func (in *K8SClient) GetPods(namespace, labelSelector string) ([]core_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 (*K8SClient) GetProject added in v1.20.0

func (in *K8SClient) GetProject(name string) (*osproject_v1.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 (*K8SClient) GetProjects added in v1.20.0

func (in *K8SClient) GetProjects(labelSelector string) ([]osproject_v1.Project, error)

func (*K8SClient) GetProxyStatus added in v1.25.0

func (in *K8SClient) GetProxyStatus() ([]*ProxyStatus, error)

func (*K8SClient) GetRegistryStatus added in v1.35.0

func (in *K8SClient) GetRegistryStatus() ([]*RegistryStatus, error)

func (*K8SClient) GetReplicaSets added in v1.20.0

func (in *K8SClient) GetReplicaSets(namespace string) ([]apps_v1.ReplicaSet, error)

func (*K8SClient) GetReplicationControllers added in v1.20.0

func (in *K8SClient) GetReplicationControllers(namespace string) ([]core_v1.ReplicationController, error)

func (*K8SClient) GetRoute added in v1.20.0

func (in *K8SClient) GetRoute(namespace, name string) (*osroutes_v1.Route, error)

GetRoute returns the external URL endpoint of a specific route name. It returns an error on any problem.

func (*K8SClient) GetSecrets added in v1.29.0

func (in *K8SClient) GetSecrets(namespace string, labelSelector string) ([]core_v1.Secret, error)

GetSecrets returns a list of secrets for a given namespace. If selectorLabels is defined, the list will only contain services matching the specified label selector.

func (*K8SClient) GetSelfSubjectAccessReview added in v1.20.0

func (in *K8SClient) GetSelfSubjectAccessReview(namespace, api, resourceType string, verbs []string) ([]*auth_v1.SelfSubjectAccessReview, error)

GetSelfSubjectAccessReview provides information on Kiali permissions

func (*K8SClient) GetServerVersion added in v1.20.0

func (in *K8SClient) GetServerVersion() (*version.Info, error)

GetServerVersion fetches and returns information about the version Kubernetes that is running

func (*K8SClient) GetService added in v1.20.0

func (in *K8SClient) GetService(namespace, name string) (*core_v1.Service, error)

GetService returns the definition of a specific service. It returns an error on any problem.

func (*K8SClient) GetServices added in v1.20.0

func (in *K8SClient) GetServices(namespace string, selectorLabels map[string]string) ([]core_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. NOTE: The selectorLabels argument is NOT to find services matching the given labels. Assume selectorLabels are the labels of a Deployment. If this imaginary Deployment is selected by the Service (because of its Selector), then that service is returned; else it's omitted.

func (*K8SClient) GetServicesByLabels added in v1.31.0

func (in *K8SClient) GetServicesByLabels(namespace string, labelsSelector string) ([]core_v1.Service, error)

func (*K8SClient) GetStatefulSet added in v1.20.0

func (in *K8SClient) GetStatefulSet(namespace string, name string) (*apps_v1.StatefulSet, error)

func (*K8SClient) GetStatefulSets added in v1.20.0

func (in *K8SClient) GetStatefulSets(namespace string) ([]apps_v1.StatefulSet, error)

func (*K8SClient) GetToken added in v1.20.0

func (client *K8SClient) GetToken() string

GetToken returns the BearerToken used from the config

func (*K8SClient) GetTokenSubject added in v1.29.0

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

GetTokenSubject returns the subject of the authInfo using the TokenReview api

func (*K8SClient) IsIter8Api added in v1.20.0

func (in *K8SClient) IsIter8Api() bool

func (*K8SClient) IsOpenShift added in v1.20.0

func (in *K8SClient) IsOpenShift() bool

func (*K8SClient) Iter8MetricMap added in v1.24.0

func (in *K8SClient) Iter8MetricMap() ([]string, error)

func (*K8SClient) UpdateIstioObject added in v1.20.0

func (in *K8SClient) UpdateIstioObject(api, namespace, resourceType, name, jsonPatch string) (IstioObject, error)

UpdateIstioObject updates an Istio object from either config api or networking api

func (*K8SClient) UpdateIter8Experiment added in v1.20.0

func (in *K8SClient) UpdateIter8Experiment(namespace string, name string, json string) (Iter8Experiment, error)

func (*K8SClient) UpdateNamespace added in v1.22.1

func (in *K8SClient) UpdateNamespace(namespace string, jsonPatch string) (*core_v1.Namespace, error)

func (*K8SClient) UpdateProject added in v1.22.1

func (in *K8SClient) UpdateProject(namespace string, jsonPatch string) (*osproject_v1.Project, error)

func (*K8SClient) UpdateService added in v1.30.0

func (in *K8SClient) UpdateService(namespace string, name string, jsonPatch string) error

func (*K8SClient) UpdateWorkload added in v1.22.0

func (in *K8SClient) UpdateWorkload(namespace string, workloadName string, workloadType string, jsonPatch string) error

type K8SClientInterface added in v1.20.0

type K8SClientInterface interface {
	GetClusterServicesByLabels(labelsSelector string) ([]core_v1.Service, error)
	GetConfigMap(namespace, name string) (*core_v1.ConfigMap, error)
	GetCronJobs(namespace string) ([]batch_v1beta1.CronJob, error)
	GetDaemonSet(namespace string, name string) (*apps_v1.DaemonSet, error)
	GetDaemonSets(namespace string) ([]apps_v1.DaemonSet, error)
	GetDeployment(namespace string, name string) (*apps_v1.Deployment, error)
	GetDeployments(namespace string) ([]apps_v1.Deployment, error)
	GetDeploymentConfig(namespace string, name string) (*osapps_v1.DeploymentConfig, error)
	GetDeploymentConfigs(namespace string) ([]osapps_v1.DeploymentConfig, error)
	GetEndpoints(namespace string, name string) (*core_v1.Endpoints, error)
	GetJobs(namespace string) ([]batch_v1.Job, error)
	GetNamespace(namespace string) (*core_v1.Namespace, error)
	GetNamespaces(labelSelector string) ([]core_v1.Namespace, error)
	GetPod(namespace, name string) (*core_v1.Pod, error)
	GetPodLogs(namespace, name string, opts *core_v1.PodLogOptions) (*PodLogs, error)
	GetPodProxy(namespace, name, path string) ([]byte, error)
	GetPods(namespace, labelSelector string) ([]core_v1.Pod, error)
	GetReplicationControllers(namespace string) ([]core_v1.ReplicationController, error)
	GetReplicaSets(namespace string) ([]apps_v1.ReplicaSet, error)
	GetSecrets(namespace string, labelSelector string) ([]core_v1.Secret, error)
	GetSelfSubjectAccessReview(namespace, api, resourceType string, verbs []string) ([]*auth_v1.SelfSubjectAccessReview, error)
	GetService(namespace string, name string) (*core_v1.Service, error)
	GetServices(namespace string, selectorLabels map[string]string) ([]core_v1.Service, error)
	GetServicesByLabels(namespace string, labelsSelector string) ([]core_v1.Service, error)
	GetStatefulSet(namespace string, name string) (*apps_v1.StatefulSet, error)
	GetStatefulSets(namespace string) ([]apps_v1.StatefulSet, error)
	GetTokenSubject(authInfo *api.AuthInfo) (string, error)
	UpdateNamespace(namespace string, jsonPatch string) (*core_v1.Namespace, error)
	UpdateService(namespace string, name string, jsonPatch string) error
	UpdateWorkload(namespace string, name string, workloadType string, jsonPatch string) error
}

type ListenerDump added in v1.28.0

type ListenerDump struct {
	DynamicListeners []DynamicListener `mapstructure:"dynamic_listeners"`
	StaticListeners  []StaticListener  `mapstructure:"static_listeners"`
}

type MTLSDetails added in v0.15.0

type MTLSDetails struct {
	DestinationRules        []IstioObject `json:"destinationrules"`
	MeshPeerAuthentications []IstioObject `json:"meshpeerauthentications"`
	PeerAuthentications     []IstioObject `json:"peerauthentications"`
	EnabledAutoMtls         bool          `json:"enabledautomtls"`
}

MTLSDetails is a wrapper to group all Istio objects related to non-local mTLS configurations

type OSClientInterface added in v1.20.0

type OSClientInterface interface {
	GetProject(project string) (*osproject_v1.Project, error)
	GetProjects(labelSelector string) ([]osproject_v1.Project, error)
	GetRoute(namespace string, name string) (*osroutes_v1.Route, error)
	UpdateProject(project string, jsonPatch string) (*osproject_v1.Project, error)
}

type PodLogs added in v0.18.0

type PodLogs struct {
	Logs string `json:"logs,omitempty"`
}

type ProxyStatus added in v1.25.0

type ProxyStatus struct {
	SyncStatus
	// contains filtered or unexported fields
}

type RBACDetails added in v0.17.0

type RBACDetails struct {
	AuthorizationPolicies []IstioObject `json:"authorizationpolicies"`
}

RBACDetails is a wrapper for objects related to Istio RBAC (Role Based Access Control)

type RatioMetric added in v1.24.0

type RatioMetric struct {
	Name               string  `json:"name" yaml:"name"`
	Numerator          string  `json:"numerator" yaml:"numerator"`
	Denominator        string  `json:"denominator" yaml:"denominator"`
	ZeroToOne          *bool   `json:"zero_to_one,omitempty" yaml:"zero_to_one,omitempty"`
	PreferredDirection *string `json:"preferred_direction,omitempty" yaml:"preferred_direction,omitempty"`
}

type RegistryService added in v1.35.0

type RegistryService struct {
	Attributes           map[string]interface{}   `json:"Attributes,omitempty"`
	Ports                []map[string]interface{} `json:"ports"`
	ServiceAccounts      []string                 `json:"serviceAccounts,omitempty"`
	CreationTime         time.Time                `json:"creationTime,omitempty"`
	Hostname             string                   `json:"hostname"`
	Address              string                   `json:"address,omitempty"`
	AutoAllocatedAddress string                   `json:"autoAllocatedAddress,omitempty"`
	ClusterVIPs          map[string]string        `json:"cluster-vips,omitempty"`
	Resolution           int                      `json:"Resolution,omitempty"`
	MeshExternal         bool                     `json:"MeshExternal,omitempty"`
}

type RegistryStatus added in v1.35.0

type RegistryStatus struct {
	RegistryService
	// contains filtered or unexported fields
}

type RemoteSecret added in v1.23.0

type RemoteSecret struct {
	APIVersion string                        `yaml:"apiVersion"`
	Clusters   []RemoteSecretClusterListItem `yaml:"clusters"`
	Contexts   []struct {
		Context struct {
			Cluster string `yaml:"cluster"`
			User    string `yaml:"user"`
		} `yaml:"context"`
		Name string `yaml:"name"`
	} `yaml:"contexts"`
	CurrentContext string `yaml:"current-context"`
	Kind           string `yaml:"kind"`
	Preferences    struct {
	} `yaml:"preferences"`
	Users []RemoteSecretUser `yaml:"users"`
}

func GetRemoteSecret added in v1.23.0

func GetRemoteSecret(path string) (*RemoteSecret, error)

func ParseRemoteSecretBytes added in v1.29.0

func ParseRemoteSecretBytes(secretBytes []byte) (*RemoteSecret, error)

ParseRemoteSecretBytes parses a raw file containing a <Kubeconfig file> and returns the parsed file in a RemoteSecret structure.

type RemoteSecretCluster added in v1.23.0

type RemoteSecretCluster struct {
	CertificateAuthorityData string `yaml:"certificate-authority-data"`
	Server                   string `yaml:"server"`
}

type RemoteSecretClusterListItem added in v1.23.0

type RemoteSecretClusterListItem struct {
	Cluster RemoteSecretCluster `yaml:"cluster"`
	Name    string              `yaml:"name"`
}

type RemoteSecretUser added in v1.29.0

type RemoteSecretUser struct {
	Name string                `yaml:"name"`
	User RemoteSecretUserToken `yaml:"user"`
}

type RemoteSecretUserToken added in v1.29.0

type RemoteSecretUserToken struct {
	Token string `yaml:"token"`
}

type RouteConfig added in v1.28.0

type RouteConfig struct {
	Name         string              `mapstructure:"name"`
	VirtualHosts []VirtualHostFilter `mapstructure:"virtual_hosts,omitempty"`
}

type RouteDump added in v1.28.0

type RouteDump struct {
	DynamicRouteConfigs []EnvoyRouteConfig `mapstructure:"dynamic_route_configs"`
	StaticRouteConfigs  []EnvoyRouteConfig `mapstructure:"static_route_configs"`
}

type StaticListener added in v1.28.0

type StaticListener struct {
	LastUpdated string        `mapstructure:"last_updated"`
	VersionInfo string        `mapstructure:"version_info"`
	Listener    EnvoyListener `mapstructure:"listener"`
}

type StringMatch added in v1.24.0

type StringMatch struct {
	Exact  *string `json:"exact,omitempty"`
	Prefix *string `json:"prefix,omitempty"`
	Regex  *string `json:"regex,omitempty"`
}

type SyncStatus added in v1.25.0

type SyncStatus struct {
	ProxyID       string `json:"proxy,omitempty"`
	ProxyVersion  string `json:"proxy_version,omitempty"`
	IstioVersion  string `json:"istio_version,omitempty"`
	ClusterSent   string `json:"cluster_sent,omitempty"`
	ClusterAcked  string `json:"cluster_acked,omitempty"`
	ListenerSent  string `json:"listener_sent,omitempty"`
	ListenerAcked string `json:"listener_acked,omitempty"`
	RouteSent     string `json:"route_sent,omitempty"`
	RouteAcked    string `json:"route_acked,omitempty"`
	EndpointSent  string `json:"endpoint_sent,omitempty"`
	EndpointAcked string `json:"endpoint_acked,omitempty"`
}

SyncStatus is the synchronization status between Pilot and a given Envoy

type VirtualHostFilter added in v1.28.0

type VirtualHostFilter struct {
	Domains []string `mapstructure:"domains,omitempty"`
	Name    string   `mapstructure:"name,omitempty"`
	Routes  []struct {
		Name     string                 `mapstructure:"name"`
		Match    map[string]interface{} `mapstructure:"match"`
		Metadata *EnvoyMetadata         `mapstructure:"metadata,omitempty"`
		Route    *struct {
			Cluster string `mapstructure:"cluster,omitempty"`
		} `mapstructure:"route,omitempty"`
	} `mapstructure:"routes,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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