models

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 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 Deployment

type Deployment struct {
	Name                string            `json:"name"`
	TemplateAnnotations map[string]string `json:"templateAnnotations"`
	Labels              map[string]string `json:"labels"`
	CreatedAt           string            `json:"createdAt"`
	ResourceVersion     string            `json:"resourceVersion"`
	Replicas            int32             `json:"replicas"`
	AvailableReplicas   int32             `json:"availableReplicas"`
	UnavailableReplicas int32             `json:"unavailableReplicas"`
	Autoscaler          Autoscaler        `json:"autoscaler"`
}

func (*Deployment) Parse

func (deployment *Deployment) Parse(d *v1beta1.Deployment)

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 Deployments

type Deployments []*Deployment

func (*Deployments) AddAutoscalers

func (deployments *Deployments) AddAutoscalers(as *v1.HorizontalPodAutoscalerList)

func (*Deployments) Parse

func (deployments *Deployments) Parse(ds *v1beta1.DeploymentList)

type DestinationPolicies

type DestinationPolicies []DestinationPolicy

func (*DestinationPolicies) Parse

func (policies *DestinationPolicies) Parse(destinationPolicies []kubernetes.IstioObject)

type DestinationPolicy

type DestinationPolicy struct {
	Name            string      `json:"name"`
	CreatedAt       string      `json:"createdAt"`
	ResourceVersion string      `json:"resourceVersion"`
	Source          interface{} `json:"source"`
	Destination     interface{} `json:"destination"`
	LoadBalancing   interface{} `json:"loadbalancing"`
	CircuitBreaker  interface{} `json:"circuitBreaker"`
}

func (*DestinationPolicy) Parse

func (policy *DestinationPolicy) Parse(destinationPolicy kubernetes.IstioObject)

type DestinationRule

type DestinationRule struct {
	Name            string      `json:"name"`
	CreatedAt       string      `json:"createdAt"`
	ResourceVersion string      `json:"resourceVersion"`
	Host            interface{} `json:"host"`
	TrafficPolicy   interface{} `json:"trafficPolicy"`
	Subsets         interface{} `json:"subsets"`
}

func (*DestinationRule) Parse

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

type DestinationRules

type DestinationRules []DestinationRule

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.EnvoyHealth
	Fetched bool `json:"-"`
}

EnvoyHealthWrapper wraps EnvoyHealth with memo flag

func (*EnvoyHealthWrapper) FillIfMissing

func (in *EnvoyHealthWrapper) FillIfMissing(supplier func() prometheus.EnvoyHealth)

FillIfMissing sets EnvoyHealth if necessary. Supplier must return (healthy, total)

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"`
	VariablesSuffix  string `json:"variablesSuffix"`
	Dashboard        string `json:"dashboard"`
	VarServiceSource string `json:"varServiceSource"`
	VarServiceDest   string `json:"varServiceDest"`
}

GrafanaInfo provides information to access Grafana dashboards

type Health

type Health struct {
	Envoy              EnvoyHealthWrapper `json:"envoy"`
	DeploymentStatuses []DeploymentStatus `json:"deploymentStatuses"`
	Requests           RequestHealth      `json:"requests"`
	DeploymentsFetched bool               `json:"-"`
}

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

func (*Health) FillDeploymentStatusesIfMissing

func (in *Health) FillDeploymentStatusesIfMissing(supplier func() []DeploymentStatus)

FillDeploymentStatusesIfMissing sets DeploymentStatuses if necessary

type IstioCheck

type IstioCheck struct {
	Message  string `json:"message"`  // Description of the check
	Severity string `json:"severity"` // Indicates the level of importance: error or warning
	Path     string `json:"path"`     // String that describes where in the yaml file is the check located
}

IstioCheck represents an individual check.

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"`
	RouteRule         *RouteRule         `json:"routeRule"`
	DestinationPolicy *DestinationPolicy `json:"destinationPolicy"`
	VirtualService    *VirtualService    `json:"virtualService"`
	DestinationRule   *DestinationRule   `json:"destinationRule"`
	Rule              *IstioRuleDetails  `json:"rule"`
}

type IstioConfigList

type IstioConfigList struct {
	Namespace           Namespace           `json:"namespace"`
	Gateways            Gateways            `json:"gateways"`
	RouteRules          RouteRules          `json:"routeRules"`
	DestinationPolicies DestinationPolicies `json:"destinationPolicies"`
	VirtualServices     VirtualServices     `json:"virtualServices"`
	DestinationRules    DestinationRules    `json:"destinationRules"`
	Rules               IstioRules          `json:"rules"`
}

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 {
	Name    string      `json:"name"`
	Match   interface{} `json:"match"`
	Actions interface{} `json:"actions"`
}

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

func CastIstioRulesCollection

func CastIstioRulesCollection(rules *kubernetes.IstioRules) IstioRules

type IstioValidation

type IstioValidation struct {
	Name       string        `json:"name"`       // Name of the object itself
	ObjectType string        `json:"objectType"` // Type of the object
	Valid      bool          `json:"valid"`      // Represents validity of the object: in case of warning, validity remainds as true
	Checks     []*IstioCheck `json:"checks"`     // Array of checks
}

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

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) 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 {
	Name string `json:"name"`
}

func CastNamespace

func CastNamespace(ns v1.Namespace) Namespace

func CastNamespaceCollection

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

func GetNamespaces

func GetNamespaces() ([]Namespace, error)

type NamespaceValidations

type NamespaceValidations map[string]IstioValidations

NamespaceValidations represents a set of IstioValidations grouped by namespace

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) 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) 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 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"`
	Fetched           bool    `json:"-"`
}

RequestHealth holds several stats about recent request errors

func (*RequestHealth) FillIfMissing

func (in *RequestHealth) FillIfMissing(supplier func() (float64, float64))

FillIfMissing sets RequestHealth if necessary. Supplier must return (errors, total)

type RouteRule

type RouteRule struct {
	Name             string      `json:"name"`
	CreatedAt        string      `json:"createdAt"`
	ResourceVersion  string      `json:"resourceVersion"`
	Destination      interface{} `json:"destination"`
	Precedence       interface{} `json:"precedence"`
	Match            interface{} `json:"match"`
	Route            interface{} `json:"route"`
	Redirect         interface{} `json:"redirect"`
	Rewrite          interface{} `json:"rewrite"`
	WebsocketUpgrade interface{} `json:"websocketUpgrade"`
	HttpReqTimeout   interface{} `json:"httpReqTimeout"`
	HttpReqRetries   interface{} `json:"httpReqRetries"`
	HttpFault        interface{} `json:"httpFault"`
	L4Fault          interface{} `json:"l4Fault"`
	Mirror           interface{} `json:"mirror"`
	CorsPolicy       interface{} `json:"corsPolicy"`
	AppendHeaders    interface{} `json:"appendHeaders"`
	RouteWarning     string      `json:"routeWarning"`
}

func (*RouteRule) Parse

func (rule *RouteRule) Parse(routeRule kubernetes.IstioObject)

type RouteRules

type RouteRules []RouteRule

func (*RouteRules) Parse

func (rules *RouteRules) Parse(routeRules []kubernetes.IstioObject)

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"`
	Endpoints           Endpoints           `json:"endpoints"`
	RouteRules          RouteRules          `json:"routeRules"`
	DestinationPolicies DestinationPolicies `json:"destinationPolicies"`
	VirtualServices     VirtualServices     `json:"virtualServices"`
	DestinationRules    DestinationRules    `json:"destinationRules"`
	Dependencies        map[string][]string `json:"dependencies"`
	Pods                Pods                `json:"pods"`
	Deployments         Deployments         `json:"deployments"`
	Health              Health              `json:"health"`
}

func (*Service) SetServiceDetails

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

type ServiceList

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

type ServiceOverview

type ServiceOverview struct {
	Name         string `json:"name"`
	Health       Health `json:"health"`
	IstioSidecar bool   `json:"istioSidecar"`
}

type VirtualService

type VirtualService struct {
	Name            string      `json:"name"`
	CreatedAt       string      `json:"createdAt"`
	ResourceVersion string      `json:"resourceVersion"`
	Hosts           interface{} `json:"hosts"`
	Gateways        interface{} `json:"gateways"`
	Http            interface{} `json:"http"`
	Tcp             interface{} `json:"tcp"`
}

func (*VirtualService) Parse

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

type VirtualServices

type VirtualServices []VirtualService

func (*VirtualServices) Parse

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

Jump to

Keyboard shortcuts

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