plan

package
v0.0.0-...-12d0706 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultAlertAfter           = "2m"
	DefaultTagKey               = "destination_workload"
	RuleNameTemplate            = "%s-%s-%s"
	Canary            AlertType = "canary"
	SLI               AlertType = "sli"
)
View Source
const (
	StatusPort                 = "status"
	PrometheusScrapeLabel      = "prometheus.io/scrape"
	PrometheusScrapeLabelValue = "true"
)
View Source
const (
	IstioInjectionLabelName = "istio-injection"
)

Variables

View Source
var (
	CanarySLIFailingQueryTemplate = template.Must(template.New("canaryTaggedAlerts").
									Parse(`100 * (1 - {{.ErrorQuery}}{ {{.TagKey}}="{{.TagValue}}" } / {{.TotalQuery}}{ {{.TagKey}}="{{.TagValue}}" }) + {{.CanaryAllowance}} < (100 * (1 - sum({{.ErrorQuery}}) / sum({{.TotalQuery}})))`))
	SLIFailingQueryTemplate = template.Must(template.New("sliTaggedAlerts").
							Parse(`100 * (1 - {{.ErrorQuery}}{ {{.TagKey}}="{{.TagValue}}" } / {{.TotalQuery}}{ {{.TagKey}}="{{.TagValue}}" }) < {{.ObjectivePercent}}`))
)

Functions

func DefaultDNSConfig

func DefaultDNSConfig() *corev1.PodDNSConfig

Types

type AlertType

type AlertType string

type ConfigMapList

type ConfigMapList struct {
	Item *corev1.ConfigMapList
}

func NewConfigMapList

func NewConfigMapList() *ConfigMapList

func (*ConfigMapList) GetItems

func (s *ConfigMapList) GetItems() (r []runtime.Object)

func (*ConfigMapList) GetList

func (s *ConfigMapList) GetList() (r runtime.Object)

type DeleteAlerts

type DeleteAlerts struct {
	App       string
	Namespace string
	Tag       string
	AlertType AlertType
}

func (*DeleteAlerts) Apply

func (p *DeleteAlerts) Apply(ctx context.Context, cli client.Client, scalingFactor float64, log logr.Logger) error

type DeleteApp

type DeleteApp struct {
	Namespace string
}

func (*DeleteApp) Apply

func (p *DeleteApp) Apply(ctx context.Context, cli client.Client, scalingFactor float64, log logr.Logger) error

type DeleteRevision

type DeleteRevision struct {
	Labels    map[string]string
	Namespace string
}

func (*DeleteRevision) Apply

func (p *DeleteRevision) Apply(ctx context.Context, cli client.Client, scalingFactor float64, log logr.Logger) error

type EnsureNamespace

type EnsureNamespace struct {
	Name      string
	OwnerName string
	OwnerType string
}

func (*EnsureNamespace) Apply

func (p *EnsureNamespace) Apply(ctx context.Context, cli client.Client, scalingFactor float64, log logr.Logger) error

type HorizontalPodAutoscalerList

type HorizontalPodAutoscalerList struct {
	Item *autoscalingv1.HorizontalPodAutoscalerList
}

func NewHorizontalPodAutoscalerList

func NewHorizontalPodAutoscalerList() *HorizontalPodAutoscalerList

func (*HorizontalPodAutoscalerList) GetItems

func (s *HorizontalPodAutoscalerList) GetItems() (r []runtime.Object)

func (*HorizontalPodAutoscalerList) GetList

func (s *HorizontalPodAutoscalerList) GetList() (r runtime.Object)

type List

type List interface {
	GetItems() []runtime.Object
	GetList() runtime.Object
}

type ReplicaSetList

type ReplicaSetList struct {
	Item *appsv1.ReplicaSetList
}

func NewReplicaSetList

func NewReplicaSetList() *ReplicaSetList

func (*ReplicaSetList) GetItems

func (s *ReplicaSetList) GetItems() (r []runtime.Object)

func (*ReplicaSetList) GetList

func (s *ReplicaSetList) GetList() (r runtime.Object)

type RetireRevision

type RetireRevision struct {
	Tag       string
	Namespace string
}

func (*RetireRevision) Apply

func (p *RetireRevision) Apply(ctx context.Context, cli client.Client, scalingFactor float64, log logr.Logger) error

type Revision

type Revision struct {
	Tag              string
	Weight           uint32
	TagRoutingHeader string
}

type SLIQuery

type SLIQuery struct {
	ErrorQuery       string
	TotalQuery       string
	TagKey           string
	TagValue         string
	CanaryAllowance  float64
	ObjectivePercent float64
}

type ScaleRevision

type ScaleRevision struct {
	Tag       string
	Namespace string
	Min       int32
	Max       int32
	Labels    map[string]string
	CPUTarget *int32
}

func (*ScaleRevision) Apply

func (p *ScaleRevision) Apply(ctx context.Context, cli client.Client, scalingFactor float64, log logr.Logger) error

type SecretList

type SecretList struct {
	Item *corev1.SecretList
}

func NewSecretList

func NewSecretList() *SecretList

func (*SecretList) GetItems

func (s *SecretList) GetItems() (r []runtime.Object)

func (*SecretList) GetList

func (s *SecretList) GetList() (r runtime.Object)

type SyncAlerts

type SyncAlerts struct {
	App                    string
	Namespace              string
	Tag                    string
	Target                 string
	AlertType              AlertType
	ServiceLevelObjectives []picchuv1alpha1.ServiceLevelObjective
}

func (*SyncAlerts) Apply

func (p *SyncAlerts) Apply(ctx context.Context, cli client.Client, scalingFactor float64, log logr.Logger) error

type SyncApp

type SyncApp struct {
	App               string
	Namespace         string
	Labels            map[string]string
	DefaultDomain     string
	PublicGateway     string
	PrivateGateway    string
	DeployedRevisions []Revision
	AlertRules        []monitoringv1.Rule
	Ports             []picchuv1alpha1.PortInfo
	TrafficPolicy     *istiov1alpha3.TrafficPolicy
}

func (*SyncApp) Apply

func (p *SyncApp) Apply(ctx context.Context, cli client.Client, scalingFactor float64, log logr.Logger) error

type SyncRevision

type SyncRevision struct {
	App                string
	Tag                string
	Namespace          string
	Labels             map[string]string // Labels applied to all resources
	Configs            []runtime.Object  // Secret and ConfigMap objects supported and mapped to environment
	Ports              []picchuv1alpha1.PortInfo
	Replicas           int32
	Image              string
	Resources          corev1.ResourceRequirements
	IAMRole            string // AWS iam role
	ServiceAccountName string // k8s ServiceAccount
	LivenessProbe      *corev1.Probe
	ReadinessProbe     *corev1.Probe
	MinReadySeconds    int32
}

func (*SyncRevision) Apply

func (p *SyncRevision) Apply(ctx context.Context, cli client.Client, scalingFactor float64, log logr.Logger) error

Jump to

Keyboard shortcuts

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