models

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ObjectTypeSingular = map[string]string{
	"gateways":          "gateway",
	"virtualservices":   "virtualservice",
	"destinationrules":  "destinationrule",
	"serviceentries":    "serviceentry",
	"rules":             "rule",
	"quotaspecs":        "quotaspec",
	"quotaspecbindings": "quotaspecbinding",
}

Functions

This section is empty.

Types

type Address

type Address struct {
	Kind string `json:"kind"`
	Name string `json:"name"`
	IP   string `json:"ip"`
}

func (*Address) Parse

func (address *Address) Parse(a v1.EndpointAddress)

type Addresses

type Addresses []Address

func (*Addresses) Parse

func (addresses *Addresses) Parse(as []v1.EndpointAddress)

type AppHealth added in v0.6.0

type AppHealth struct {
	Envoy              []EnvoyHealthWrapper `json:"envoy"`
	DeploymentStatuses []DeploymentStatus   `json:"deploymentStatuses"`
	Requests           RequestHealth        `json:"requests"`
}

AppHealth contains aggregated health from various sources, for a given app

func EmptyAppHealth added in v0.6.0

func EmptyAppHealth() AppHealth

EmptyAppHealth create an empty AppHealth

type Autoscaler

type Autoscaler struct {
	Name      string            `json:"name"`
	Labels    map[string]string `json:"labels"`
	CreatedAt string            `json:"createdAt"`
	// Spec
	MinReplicas                    int32 `json:"minReplicas"`
	MaxReplicas                    int32 `json:"maxReplicas"`
	TargetCPUUtilizationPercentage int32 `json:"targetCPUUtilizationPercentage"`
	// Status
	ObservedGeneration              int64  `json:"observedGeneration,omitempty"`
	LastScaleTime                   string `json:"lastScaleTime,omitempty"`
	CurrentReplicas                 int32  `json:"currentReplicas"`
	DesiredReplicas                 int32  `json:"desiredReplicas"`
	CurrentCPUUtilizationPercentage int32  `json:"currentCPUUtilizationPercentage,omitempty"`
}

func (*Autoscaler) Parse

func (autoscaler *Autoscaler) Parse(d *v1.HorizontalPodAutoscaler)

type ContainerInfo

type ContainerInfo struct {
	Name  string `json:"name"`
	Image string `json:"image"`
}

ContainerInfo holds container name and image

type DeploymentStatus

type DeploymentStatus struct {
	Name              string `json:"name"`
	Replicas          int32  `json:"replicas"`
	AvailableReplicas int32  `json:"available"`
}

DeploymentStatus gives the available / total replicas in a deployment of a pod

type DestinationRule

type DestinationRule struct {
	// The name of the destinationRule
	//
	// required: true
	Name string `json:"name"`
	// The creation date of the destinationRule
	//
	// required: true
	CreatedAt string `json:"createdAt"`
	// The resource version of the destinationRule
	//
	// required: true
	ResourceVersion string      `json:"resourceVersion"`
	Host            interface{} `json:"host"`
	TrafficPolicy   interface{} `json:"trafficPolicy"`
	Subsets         interface{} `json:"subsets"`
}

DestinationRule destinationRule

This is used for returning a DestinationRule

swagger:model destinationRule

func (*DestinationRule) Parse

func (dRule *DestinationRule) Parse(destinationRule kubernetes.IstioObject)

type DestinationRules

type DestinationRules []DestinationRule

DestinationRules destinationRules

This is used for returning an array of DestinationRules

swagger:model destinationRules An array of destinationRule swagger:allOf

func (*DestinationRules) Parse

func (dRules *DestinationRules) Parse(destinationRules []kubernetes.IstioObject)

type Endpoint

type Endpoint struct {
	Addresses Addresses `json:"addresses"`
	Ports     Ports     `json:"ports"`
}

func (*Endpoint) Parse

func (endpoint *Endpoint) Parse(s v1.EndpointSubset)

type Endpoints

type Endpoints []Endpoint

func (*Endpoints) Parse

func (endpoints *Endpoints) Parse(es *v1.Endpoints)

type EnvoyHealthWrapper

type EnvoyHealthWrapper struct {
	prometheus.EnvoyServiceHealth
	Service string `json:"service"`
}

EnvoyHealthWrapper wraps EnvoyServiceHealth with the service name

type Gateway

type Gateway struct {
	Name            string      `json:"name"`
	CreatedAt       string      `json:"createdAt"`
	ResourceVersion string      `json:"resourceVersion"`
	Servers         interface{} `json:"servers"`
	Selector        interface{} `json:"selector"`
}

func (*Gateway) Parse

func (gw *Gateway) Parse(gateway kubernetes.IstioObject)

type Gateways

type Gateways []Gateway

func (*Gateways) Parse

func (gws *Gateways) Parse(gateways []kubernetes.IstioObject)

type GrafanaInfo

type GrafanaInfo struct {
	URL                   string `json:"url"`
	ServiceDashboardPath  string `json:"serviceDashboardPath"`
	WorkloadDashboardPath string `json:"workloadDashboardPath"`
	VarNamespace          string `json:"varNamespace"`
	VarService            string `json:"varService"`
	VarWorkload           string `json:"varWorkload"`
}

GrafanaInfo provides information to access Grafana dashboards

type IstioCheck

type IstioCheck struct {
	// Description of the check
	// required: true
	// example: Weight sum should be 100
	Message string `json:"message"`

	// Indicates the level of importance: error or warning
	// required: true
	// example: error
	Severity string `json:"severity"`

	// String that describes where in the yaml file is the check located
	// example: spec/http[0]/route
	Path string `json:"path"`
}

IstioCheck represents an individual check. swagger:model

func BuildCheck

func BuildCheck(message, severity, path string) IstioCheck

type IstioConfigDetails

type IstioConfigDetails struct {
	Namespace        Namespace         `json:"namespace"`
	ObjectType       string            `json:"objectType"`
	Gateway          *Gateway          `json:"gateway"`
	VirtualService   *VirtualService   `json:"virtualService"`
	DestinationRule  *DestinationRule  `json:"destinationRule"`
	ServiceEntry     *ServiceEntry     `json:"serviceEntry"`
	Rule             *IstioRuleDetails `json:"rule"`
	QuotaSpec        *QuotaSpec        `json:"quotaSpec"`
	QuotaSpecBinding *QuotaSpecBinding `json:"quotaSpecBinding"`
}

type IstioConfigList

type IstioConfigList struct {
	// The namespace of istioConfiglist
	//
	// required: true
	Namespace         Namespace         `json:"namespace"`
	Gateways          Gateways          `json:"gateways"`
	VirtualServices   VirtualServices   `json:"virtualServices"`
	DestinationRules  DestinationRules  `json:"destinationRules"`
	ServiceEntries    ServiceEntries    `json:"serviceEntries"`
	Rules             IstioRules        `json:"rules"`
	QuotaSpecs        QuotaSpecs        `json:"quotaSpecs"`
	QuotaSpecBindings QuotaSpecBindings `json:"quotaSpecBindings"`
}

IstioConfigList istioConfigList

This type is used for returning a response of IstioConfigList

swagger:model IstioConfigList

type IstioHandler

type IstioHandler struct {
	Name    string      `json:"name"`
	Adapter string      `json:"adapter"`
	Spec    interface{} `json:"spec"`
}

func CastIstioHandler

func CastIstioHandler(handler kubernetes.IstioObject) *IstioHandler

type IstioInstance

type IstioInstance struct {
	Name     string      `json:"name"`
	Template string      `json:"template"`
	Spec     interface{} `json:"spec"`
}

func CastIstioInstance

func CastIstioInstance(instance kubernetes.IstioObject) *IstioInstance

type IstioRule

type IstioRule struct {
	// The name of the istioRule
	//
	// required: true
	Name    string      `json:"name"`
	Match   interface{} `json:"match"`
	Actions interface{} `json:"actions"`
}

IstioRule istioRule

This type type is used for returning a IstioRule

swagger:model istioRule

func CastIstioRule

func CastIstioRule(rule kubernetes.IstioObject) IstioRule

type IstioRuleAction

type IstioRuleAction struct {
	Handler   *IstioHandler    `json:"handler"`
	Instances []*IstioInstance `json:"instances"`
}

func CastIstioRuleAction

func CastIstioRuleAction(action *kubernetes.IstioRuleAction) *IstioRuleAction

func CastIstioRuleActions

func CastIstioRuleActions(actions []*kubernetes.IstioRuleAction) []*IstioRuleAction

type IstioRuleDetails

type IstioRuleDetails struct {
	Name      string             `json:"name"`
	Namespace Namespace          `json:"namespace"`
	Match     interface{}        `json:"match"`
	Actions   []*IstioRuleAction `json:"actions"`
}

func CastIstioRuleDetails

func CastIstioRuleDetails(rule *kubernetes.IstioRuleDetails) *IstioRuleDetails

type IstioRuleList

type IstioRuleList struct {
	Namespace Namespace   `json:"namespace"`
	Rules     []IstioRule `json:"rules"`
}

type IstioRules

type IstioRules []IstioRule

IstioRules istioRules

This type type is used for returning an array of IstioRules

swagger:model istioRules An array of istioRule swagger:allOf

func CastIstioRulesCollection

func CastIstioRulesCollection(rules *kubernetes.IstioRules) IstioRules

type IstioValidation

type IstioValidation struct {
	// Name of the object itself
	// required: true
	// example: reviews
	Name string `json:"name"`

	// Type of the object
	// required: true
	// example: virtualservice
	ObjectType string `json:"objectType"`

	// Represents validity of the object: in case of warning, validity remains as true
	// required: true
	// example: false
	Valid bool `json:"valid"`

	// Array of checks. It might be empty.
	Checks []*IstioCheck `json:"checks"`
}

IstioValidation represents a list of checks associated to an Istio object. swagger:model

type IstioValidationKey

type IstioValidationKey struct {
	ObjectType string
	Name       string
}

IstioValidationKey is the key value composed of an Istio ObjectType and Name.

type IstioValidations

type IstioValidations map[IstioValidationKey]*IstioValidation

IstioValidations represents a set of IstioValidation grouped by IstioValidationKey.

func (IstioValidations) FilterByKey added in v0.6.0

func (iv IstioValidations) FilterByKey(objectType, name string) IstioValidations

func (IstioValidations) MarshalJSON

func (iv IstioValidations) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (IstioValidations) MergeValidations

func (iv IstioValidations) MergeValidations(validations IstioValidations) IstioValidations

type JaegerInfo

type JaegerInfo struct {
	URL string `json:"url"`
}

JaegerInfo provides information to access Jaeger UI

type Namespace

type Namespace struct {
	// The id of the namespace.
	//
	// example:  istio-system
	// required: true
	Name string `json:"name"`
}

A Namespace provide a scope for names This type is used to describe a set of objects.

swagger:model namespace

func CastNamespace

func CastNamespace(ns v1.Namespace) Namespace

func CastNamespaceCollection

func CastNamespaceCollection(nsl *v1.NamespaceList) []Namespace

func GetNamespaces

func GetNamespaces() ([]Namespace, error)

type NamespaceAppHealth added in v0.6.0

type NamespaceAppHealth map[string]*AppHealth

NamespaceAppHealth is an alias of map of app name x health

type NamespaceValidations

type NamespaceValidations map[string]IstioValidations

NamespaceValidations represents a set of IstioValidations grouped by namespace

type NamespaceWorkloadHealth added in v0.6.0

type NamespaceWorkloadHealth map[string]*WorkloadHealth

NamespaceWorkloadHealth is an alias of map of workload name x health

type Pod

type Pod struct {
	Name                string            `json:"name"`
	Labels              map[string]string `json:"labels"`
	CreatedAt           string            `json:"createdAt"`
	CreatedBy           []Reference       `json:"createdBy"`
	IstioContainers     []*ContainerInfo  `json:"istioContainers"`
	IstioInitContainers []*ContainerInfo  `json:"istioInitContainers"`
}

Pod holds a subset of v1.Pod data that is meaningful in Kiali

func (*Pod) HasIstioSideCar added in v0.6.0

func (pod *Pod) HasIstioSideCar() bool

func (*Pod) Parse

func (pod *Pod) Parse(p *v1.Pod)

Parse extracts desired information from k8s Pod info

type Pods

type Pods []*Pod

Pods alias for list of Pod structs

func (Pods) HasIstioSideCar added in v0.6.0

func (pods Pods) HasIstioSideCar() bool

func (*Pods) Parse

func (pods *Pods) Parse(list []v1.Pod)

Parse extracts desired information from k8s []Pod info

type Port

type Port struct {
	Name     string `json:"name"`
	Protocol string `json:"protocol"`
	Port     int32  `json:"port"`
}

func (*Port) Parse

func (port *Port) Parse(p v1.ServicePort)

func (*Port) ParseEndpointPort

func (port *Port) ParseEndpointPort(p v1.EndpointPort)

type Ports

type Ports []Port

func (*Ports) Parse

func (ports *Ports) Parse(ps []v1.ServicePort)

func (*Ports) ParseEndpointPorts

func (ports *Ports) ParseEndpointPorts(ps []v1.EndpointPort)

type QuotaSpec added in v0.5.0

type QuotaSpec struct {
	Name            string      `json:"name"`
	CreatedAt       string      `json:"createdAt"`
	ResourceVersion string      `json:"resourceVersion"`
	Rules           interface{} `json:"rules"`
}

func (*QuotaSpec) Parse added in v0.5.0

func (qs *QuotaSpec) Parse(quotaSpec kubernetes.IstioObject)

type QuotaSpecBinding added in v0.5.0

type QuotaSpecBinding struct {
	Name            string      `json:"name"`
	CreatedAt       string      `json:"createdAt"`
	ResourceVersion string      `json:"resourceVersion"`
	QuotaSpecs      interface{} `json:"quotaSpecs"`
	Services        interface{} `json:"services"`
}

func (*QuotaSpecBinding) Parse added in v0.5.0

func (qsb *QuotaSpecBinding) Parse(quotaSpecBinding kubernetes.IstioObject)

type QuotaSpecBindings added in v0.5.0

type QuotaSpecBindings []QuotaSpecBinding

func (*QuotaSpecBindings) Parse added in v0.5.0

func (qsbs *QuotaSpecBindings) Parse(quotaSpecBindings []kubernetes.IstioObject)

type QuotaSpecs added in v0.5.0

type QuotaSpecs []QuotaSpec

func (*QuotaSpecs) Parse added in v0.5.0

func (qss *QuotaSpecs) Parse(quotaSpecs []kubernetes.IstioObject)

type Reference

type Reference struct {
	Name string `json:"name"`
	Kind string `json:"kind"`
}

Reference holds some information on the pod creator

type RequestHealth

type RequestHealth struct {
	RequestCount      float64 `json:"requestCount"`
	RequestErrorCount float64 `json:"requestErrorCount"`
}

RequestHealth holds several stats about recent request errors

type Service

type Service struct {
	Name            string            `json:"name"`
	CreatedAt       string            `json:"createdAt"`
	ResourceVersion string            `json:"resourceVersion"`
	Namespace       Namespace         `json:"namespace"`
	Labels          map[string]string `json:"labels"`
	Type            string            `json:"type"`
	Ip              string            `json:"ip"`
	Ports           Ports             `json:"ports"`
}

func (*Service) Parse added in v0.6.0

func (s *Service) Parse(service *v1.Service)

type ServiceDetails added in v0.6.0

type ServiceDetails struct {
	Name             string              `json:"name"`
	Namespace        Namespace           `json:"namespace"`
	Service          Service             `json:"service"`
	Endpoints        Endpoints           `json:"endpoints"`
	VirtualServices  VirtualServices     `json:"virtualServices"`
	DestinationRules DestinationRules    `json:"destinationRules"`
	Dependencies     map[string][]string `json:"dependencies"`
	Pods             Pods                `json:"pods"`
	Workloads        Workloads           `json:"deployments"`
	Health           ServiceHealth       `json:"health"`
}

func (*ServiceDetails) SetServiceDetails added in v0.6.0

func (s *ServiceDetails) SetServiceDetails(serviceDetails *kubernetes.ServiceDetails, istioDetails *kubernetes.IstioDetails, prometheusDetails map[string][]prometheus.Workload)

type ServiceEntries added in v0.5.0

type ServiceEntries []ServiceEntry

func (*ServiceEntries) Parse added in v0.5.0

func (ses *ServiceEntries) Parse(serviceEntries []kubernetes.IstioObject)

type ServiceEntry added in v0.5.0

type ServiceEntry struct {
	Name            string      `json:"name"`
	CreatedAt       string      `json:"createdAt"`
	ResourceVersion string      `json:"resourceVersion"`
	Hosts           interface{} `json:"hosts"`
	Addresses       interface{} `json:"addresses"`
	Ports           interface{} `json:"ports"`
	Location        interface{} `json:"location"`
	Resolution      interface{} `json:"resolution"`
	Endpoints       interface{} `json:"endpoints"`
}

func (*ServiceEntry) Parse added in v0.5.0

func (se *ServiceEntry) Parse(serviceEntry kubernetes.IstioObject)

type ServiceHealth added in v0.6.0

type ServiceHealth struct {
	Envoy    prometheus.EnvoyServiceHealth `json:"envoy"`
	Requests RequestHealth                 `json:"requests"`
}

ServiceHealth contains aggregated health from various sources, for a given service

type ServiceList

type ServiceList struct {
	Namespace Namespace         `json:"namespace"`
	Services  []ServiceOverview `json:"services"`
}

type ServiceOverview

type ServiceOverview struct {
	// Name of the Service
	// required: true
	// example: reviews-v1
	Name string `json:"name"`
	// Define if Pods related to this Service has an IstioSidecar deployed
	// required: true
	// example: true
	IstioSidecar bool `json:"istioSidecar"`
	// Has label app
	// required: true
	// example: true
	AppLabel bool `json:"appLabel"`
}

type Services added in v0.6.0

type Services []*Service

func (*Services) Parse added in v0.6.0

func (ss *Services) Parse(services []v1.Service)

type VirtualService

type VirtualService struct {
	// The name of the virtualService
	//
	// required: true
	Name string `json:"name"`
	// The creation date of the virtualService
	//
	// required: true
	CreatedAt string `json:"createdAt"`
	// The resource version of the virtualService
	//
	// required: true
	ResourceVersion string      `json:"resourceVersion"`
	Hosts           interface{} `json:"hosts"`
	Gateways        interface{} `json:"gateways"`
	Http            interface{} `json:"http"`
	Tcp             interface{} `json:"tcp"`
}

VirtualService virtualService

This type is used for returning a VirtualService

swagger:model virtualService

func (*VirtualService) Parse

func (vService *VirtualService) Parse(virtualService kubernetes.IstioObject)

type VirtualServices

type VirtualServices []VirtualService

VirtualServices virtualServices

This type is used for returning an array of VirtualServices

swagger:model virtualServices An array of virtualService swagger:allOf

func (*VirtualServices) Parse

func (vServices *VirtualServices) Parse(virtualServices []kubernetes.IstioObject)

type Workload added in v0.6.0

type Workload struct {
	// Workload name
	// required: true
	// example: reviews
	Name string `json:"name"`

	// Kubernetes annotations
	// required: true
	TemplateAnnotations map[string]string `json:"templateAnnotations"`

	// Kubernetes labels
	// required: true
	Labels map[string]string `json:"labels"`

	// Creation timestamp (in RFC3339 format)
	// required: true
	// example: 2018-07-31T12:24:17Z
	CreatedAt string `json:"createdAt"`

	// Kubernetes ResourceVersion
	// required: true
	// example: 192892127
	ResourceVersion string `json:"resourceVersion"`

	// Number of desired replicas
	// required: true
	// example: 2
	Replicas int32 `json:"replicas"`

	// Number of available replicas
	// required: true
	// example: 1
	AvailableReplicas int32 `json:"availableReplicas"`

	// Number of unavailable replicas
	// required: true
	// example: 1
	UnavailableReplicas int32 `json:"unavailableReplicas"`

	// Autoscaler bound to the workload
	Autoscaler Autoscaler `json:"autoscaler"`

	// Pods bound to the workload
	Pods Pods `json:"pods"`

	// Services that match workload selector
	Services Services `json:"services"`
}

func (*Workload) Parse added in v0.6.0

func (workload *Workload) Parse(d *v1beta1.Deployment)

func (*Workload) SetDetails added in v0.6.0

func (workload *Workload) SetDetails(deploymentDetails *kubernetes.DeploymentDetails)

type WorkloadHealth added in v0.6.0

type WorkloadHealth struct {
	DeploymentStatus DeploymentStatus `json:"deploymentStatus"`
	Requests         RequestHealth    `json:"requests"`
}

WorkloadHealth contains aggregated health from various sources, for a given workload

type WorkloadList added in v0.6.0

type WorkloadList struct {
	// Namespace where the workloads live in
	// required: true
	// example: bookinfo
	Namespace Namespace `json:"namespace"`

	// Workloads for a given namespace
	// required: true
	Workloads []WorkloadOverview `json:"workloads"`
}

func (*WorkloadList) Parse added in v0.6.0

func (workloadList *WorkloadList) Parse(namespace string, ds *v1beta1.DeploymentList)

type WorkloadOverview added in v0.6.0

type WorkloadOverview struct {
	// Name of the workload
	// required: true
	// example: reviews-v1
	Name string `json:"name"`

	// Type of the workload
	// required: true
	// example: deployment
	Type string `json:"type"`

	// Define if Pods related to this Service has an IstioSidecar deployed
	// required: true
	// example: true
	IstioSidecar bool `json:"istioSidecar"`
	// Define if Pods related to this Service has the label App
	// required: true
	// example: true
	AppLabel bool `json:"appLabel"`
	// Define if Pods related to this Service has the label Version
	// required: true
	// example: true
	VersionLabel bool `json:"versionLabel"`
}

func (*WorkloadOverview) Parse added in v0.6.0

func (workload *WorkloadOverview) Parse(d v1beta1.Deployment)

type Workloads added in v0.6.0

type Workloads []*Workload

func (*Workloads) AddAutoscalers added in v0.6.0

func (workloads *Workloads) AddAutoscalers(as *v1.HorizontalPodAutoscalerList)

func (*Workloads) Parse added in v0.6.0

func (workloads *Workloads) Parse(ds *v1beta1.DeploymentList)

Jump to

Keyboard shortcuts

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