config

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright paskal.maksim@gmail.com Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetVersion

func GetVersion() string

func Load

func Load(ctx context.Context) error

func Validate

func Validate(ctx context.Context) error

Types

type Canary added in v1.1.2

type Canary struct {
	Enabled           bool
	Strategy          CanaryStrategy
	QualityGate       *CanaryQualityGate
	Phase1            *CanaryPhase1
	Phase2            *CanaryPhase2
	ServiceMesh       string
	ServiceMeshConfig string

	Services []*CanaryService
	// contains filtered or unexported fields
}

func (*Canary) GetServiceMesh added in v1.1.2

func (c *Canary) GetServiceMesh() types.ServiceMesh

func (*Canary) InitServiceMesh added in v1.1.2

func (c *Canary) InitServiceMesh(_ context.Context) error

type CanaryPhase1 added in v1.1.2

type CanaryPhase1 struct {
	Strategy                CanaryPhase1Strategy
	MaxExecutionTimeSeconds *uint16

	// CanaryPhase1CanaryStrategy
	CanaryPercentMin      *types.CanaryProviderPercent
	CanaryPercentMax      *types.CanaryProviderPercent
	CanaryPercentStep     *uint8
	CanaryIntervalSeconds *uint16
}

func (*CanaryPhase1) GetCanaryInterval added in v1.1.2

func (cp1 *CanaryPhase1) GetCanaryInterval() time.Duration

func (*CanaryPhase1) GetMaxExecutionTime added in v1.1.2

func (cp1 *CanaryPhase1) GetMaxExecutionTime() time.Duration

type CanaryPhase1Strategy added in v1.1.2

type CanaryPhase1Strategy string
const (
	CanaryPhase1CanaryStrategy CanaryPhase1Strategy = "CanaryStrategy"
	CanaryPhase1ABTestStrategy CanaryPhase1Strategy = "ABTestStrategy"
)

func (CanaryPhase1Strategy) Validate added in v1.1.2

func (value CanaryPhase1Strategy) Validate() error

type CanaryPhase2 added in v1.1.2

type CanaryPhase2 struct {
	MaxExecutionTimeSeconds *uint16
}

func (*CanaryPhase2) GetMaxExecutionTime added in v1.1.2

func (cp2 *CanaryPhase2) GetMaxExecutionTime() time.Duration

type CanaryQualityGate added in v1.1.2

type CanaryQualityGate struct {
	ErrorBudgetCount           int
	ErrorBudgetPeriodInSeconds int
}

func (*CanaryQualityGate) GetErrorBudgetPeriod added in v1.1.2

func (q *CanaryQualityGate) GetErrorBudgetPeriod() time.Duration

type CanaryService added in v1.1.2

type CanaryService struct {
	Name string
}

type CanaryStrategy added in v1.1.2

type CanaryStrategy string
const (
	CanaryStrategyAllPhases  CanaryStrategy = "CanaryStrategyAllPhases"
	CanaryStrategyOnlyPhase1 CanaryStrategy = "CanaryStrategyOnlyPhase1"
	CanaryStrategyOnlyPhase2 CanaryStrategy = "CanaryStrategyOnlyPhase2"
)

func (CanaryStrategy) HasPhase1 added in v1.1.2

func (e CanaryStrategy) HasPhase1() bool

func (CanaryStrategy) HasPhase2 added in v1.1.2

func (e CanaryStrategy) HasPhase2() bool

func (CanaryStrategy) Validate added in v1.1.2

func (e CanaryStrategy) Validate() error

type ConfigMap

type ConfigMap struct {
	Name string
}

type Deployment

type Deployment struct {
	Hpa         *Hpa
	Pdb         *Pdb
	Name        string
	MinReplicas int32
}

func (*Deployment) GetHpa

func (d *Deployment) GetHpa(values *Type) Hpa

func (*Deployment) GetMinReplicas

func (d *Deployment) GetMinReplicas(values *Type) int32

func (*Deployment) GetPdb

func (d *Deployment) GetPdb(values *Type) Pdb

type Hpa

type Hpa struct {
	Enabled            bool
	MinReplicas        int32
	MaxReplicas        int32
	AverageUtilization int32
}

type Pdb

type Pdb struct {
	Enabled        bool
	MinAvailable   int
	MaxUnavailable int
}

func (*Pdb) GetMaxUnavailable added in v1.1.1

func (pdb *Pdb) GetMaxUnavailable() *intstr.IntOrString

func (*Pdb) GetMinAvailable added in v1.1.1

func (pdb *Pdb) GetMinAvailable() *intstr.IntOrString

type Prometheus added in v1.1.2

type Prometheus struct {
	URL          string
	AuthUser     string
	AuthPassword string

	AllowedMetricsRegex string

	LocalConfigPath             string
	ReadyWaitStepSeconds        uint
	ScrapeIntervalSeconds       uint
	CreateConfigIntervalSeconds uint

	// to reduce the number of metrics in prometheus, select only pods with these labels
	// if empty, all pods will be selected in local prometheus
	PodLabelSelector []string
}

func (*Prometheus) Enabled added in v1.1.2

func (p *Prometheus) Enabled() bool

func (*Prometheus) GetCreateConfigInterval added in v1.1.2

func (p *Prometheus) GetCreateConfigInterval() time.Duration

func (*Prometheus) GetEndpoint added in v1.1.2

func (p *Prometheus) GetEndpoint(action string) string

func (*Prometheus) GetReadyWaitStep added in v1.1.2

func (p *Prometheus) GetReadyWaitStep() time.Duration

func (*Prometheus) GetScrapeInterval added in v1.1.2

func (p *Prometheus) GetScrapeInterval() time.Duration

func (*Prometheus) HasLocalPrometheus added in v1.1.2

func (p *Prometheus) HasLocalPrometheus() bool

type Service

type Service struct {
	Name string
}

type Type

type Type struct {
	Canary                   *Canary
	Version                  types.Version
	CurrentVersion           types.Version
	Name                     string
	Namespace                string
	Environment              string
	Deployments              []*Deployment
	Services                 []*Service
	ConfigMaps               []*ConfigMap
	WebHooks                 []*WebHook
	Pdb                      Pdb
	PodCheckIntervalSeconds  int32
	PodCheckAvailableTimes   int32
	MaxProcessingTimeSeconds int32
	Hpa                      Hpa
	MinReplicas              int32
	CreateService            bool
	DeleteOrigins            bool

	Prometheus *Prometheus
	// contains filtered or unexported fields
}

func Get

func Get() *Type

func (*Type) CanRollBack added in v1.1.2

func (t *Type) CanRollBack() bool

func (*Type) GetMaxProcessingTime added in v1.1.2

func (t *Type) GetMaxProcessingTime() time.Duration

func (*Type) GetPodCheckInterval added in v1.1.2

func (t *Type) GetPodCheckInterval() time.Duration

func (*Type) HasCanary added in v1.1.2

func (t *Type) HasCanary() bool

func (*Type) SetCanNotRollback added in v1.1.2

func (t *Type) SetCanNotRollback()

after that time rollback will not available.

func (*Type) String

func (t *Type) String() string

type WebHook

type WebHook struct {
	URL     string
	Headers map[string]string
	Body    string
	Method  string
}

Jump to

Keyboard shortcuts

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