api

package
v0.0.0-...-bafb678 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTrimmedDate

func GetTrimmedDate(date string) (string, error)

func SanitizeLabel

func SanitizeLabel(value string) string

a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue', or 'my_value', or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')

func SanitizeLabels

func SanitizeLabels(labels map[string]string) (sanitizedLabels map[string]string)

Types

type ActionType

type ActionType string
const (
	ActionDeploySimple  ActionType = "deploy-simple"
	ActionDeployCanary  ActionType = "deploy-canary"
	ActionDeployStable  ActionType = "deploy-stable"
	ActionRestartSimple ActionType = "restart-simple"
	ActionRestartCanary ActionType = "restart-canary"
	ActionRestartStable ActionType = "restart-stable"
	ActionDiffSimple    ActionType = "diff-simple"
	ActionDiffCanary    ActionType = "diff-canary"
	ActionDiffStable    ActionType = "diff-stable"
	ActionDiffDelete    ActionType = "diff-delete"
	ActionDelete        ActionType = "delete"

	ActionRollbackCanary ActionType = "rollback-canary"

	ActionUnknown ActionType = ""
)

type AdditionalPortData

type AdditionalPortData struct {
	Name     string
	Port     int
	Protocol string
}

AdditionalPortData provides information about extra ports on the container

type AdditionalPortParams

type AdditionalPortParams struct {
	Name       string     `json:"name,omitempty" yaml:"name,omitempty"`
	Port       int        `json:"port,omitempty" yaml:"port,omitempty"`
	Protocol   string     `json:"protocol,omitempty" yaml:"protocol,omitempty"`
	Visibility Visibility `json:"visibility,omitempty" yaml:"visibility,omitempty"`
}

AdditionalPortParams provides information about any additional ports exposed and accessible via a service

type AutoscaleParams

type AutoscaleParams struct {
	Enabled       *bool                 `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	MinReplicas   int                   `json:"min,omitempty" yaml:"min,omitempty"`
	MaxReplicas   int                   `json:"max,omitempty" yaml:"max,omitempty"`
	CPUPercentage int                   `json:"cpu,omitempty" yaml:"cpu,omitempty"`
	Safety        AutoscaleSafetyParams `json:"safety,omitempty" yaml:"safety,omitempty"`
}

AutoscaleParams controls autoscaling

type AutoscaleSafetyParams

type AutoscaleSafetyParams struct {
	Enabled        bool   `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	PromQuery      string `json:"promquery,omitempty" yaml:"promquery,omitempty"`
	Ratio          string `json:"ratio,omitempty" yaml:"ratio,omitempty"`
	Delta          string `json:"delta,omitempty" yaml:"delta,omitempty"`
	ScaleDownRatio string `json:"scaledownratio,omitempty" yaml:"scaledownratio,omitempty"`
}

AutoscaleSafetyParams configures the autoscaler to use estafette-hpa-scaler as a safety net

type CPUParams

type CPUParams struct {
	Request string `json:"request,omitempty" yaml:"request,omitempty"`
	Limit   string `json:"limit,omitempty" yaml:"limit,omitempty"`
}

CPUParams sets cpu request and limit values

type CanaryParams

type CanaryParams struct {
	Header      string `json:"header,omitempty" yaml:"header,omitempty"`
	HeaderValue string `json:"headervalue,omitempty" yaml:"headervalue,omitempty"`
	Weight      string `json:"weight,omitempty" yaml:"weight,omitempty"`
	MinReplicas string `json:"minreplicas,omitempty" yaml:"minreplicas,omitempty"`
	MaxReplicas string `json:"minreplicas,omitempty" yaml:"maxreplicas,omitempty"`
}

CanaryParams sets params for canary deployment

type ConfigsParams

type ConfigsParams struct {
	Files               []string               `json:"files,omitempty" yaml:"files,omitempty"`
	Data                map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"`
	InlineFiles         map[string]string      `json:"inline,omitempty" yaml:"inline,omitempty"`
	MountPath           string                 `json:"mountpath,omitempty" yaml:"mountpath,omitempty"`
	RenderedFileContent map[string]string      `json:"-" yaml:"-"`
}

ConfigsParams allows configs to be set dynamically for the application

type ContainerData

type ContainerData struct {
	Repository                      string
	Name                            string
	Tag                             string
	ImagePullPolicy                 string
	CPURequest                      string
	MemoryRequest                   string
	CPULimit                        string
	MemoryLimit                     string
	Port                            int
	PortGrpc                        int
	EnvironmentVariables            map[string]interface{}
	SecretEnvironmentVariables      map[string]interface{}
	Liveness                        ProbeData
	Readiness                       ProbeData
	Metrics                         MetricsData
	UseLifecyclePreStopSleepCommand bool
	PreStopSleepSeconds             int
	ContainerSecurityContext        map[string]interface{}
	ContainerLifeCycle              map[string]interface{}
}

ContainerData has data specific to the application container

type ContainerParams

type ContainerParams struct {
	ImageRepository            string                 `json:"repository,omitempty" yaml:"repository,omitempty"`
	ImageName                  string                 `json:"name,omitempty" yaml:"name,omitempty"`
	ImageTag                   string                 `json:"tag,omitempty" yaml:"tag,omitempty"`
	ImagePullPolicy            string                 `json:"imagePullPolicy,omitempty" yaml:"imagePullPolicy,omitempty"`
	Port                       int                    `json:"port,omitempty" yaml:"port,omitempty"`
	PortGrpc                   int                    `json:"portGrpc,omitempty" yaml:"portGrpc,omitempty"`
	EnvironmentVariables       map[string]interface{} `json:"env,omitempty" yaml:"env,omitempty"`
	SecretEnvironmentVariables map[string]interface{} `json:"secretEnv,omitempty" yaml:"secretEnv,omitempty"`

	CPU            CPUParams       `json:"cpu,omitempty" yaml:"cpu,omitempty"`
	Memory         MemoryParams    `json:"memory,omitempty" yaml:"memory,omitempty"`
	LivenessProbe  ProbeParams     `json:"liveness,omitempty" yaml:"liveness,omitempty"`
	ReadinessProbe ProbeParams     `json:"readiness,omitempty" yaml:"readiness,omitempty"`
	Metrics        MetricsParams   `json:"metrics,omitempty" yaml:"metrics,omitempty"`
	Lifecycle      LifecycleParams `json:"lifecycle,omitempty" yaml:"lifecycle,omitempty"`

	AdditionalPorts []*AdditionalPortParams `json:"additionalports,omitempty" yaml:"additionalports,omitempty"`

	ContainerSecurityContext map[string]interface{} `json:"securityContext,omitempty" yaml:"securityContext,omitempty"`

	ContainerLifeCycle map[string]interface{} `json:"containerLifecycle,omitempty" yaml:"containerLifecycle,omitempty"`
}

ContainerParams defines the container image to deploy

type CredentialsParam

type CredentialsParam struct {
	Credentials string `json:"credentials,omitempty"`
}

CredentialsParam is used to first retrieve credentials and use any defaults set there

func (*CredentialsParam) SetDefaults

func (p *CredentialsParam) SetDefaults(releaseName string)

SetDefaults fills in empty fields with convention-based defaults

func (*CredentialsParam) ValidateRequiredProperties

func (p *CredentialsParam) ValidateRequiredProperties() (bool, []error)

ValidateRequiredProperties checks whether all needed properties are set

type DNSParams

type DNSParams struct {
	UseCloudflareEstafetteExtension *bool `json:"useCloudflareEstafetteExtension,omitempty" yaml:"useCloudflareEstafetteExtension,omitempty"`
	UseExternalDNS                  *bool `json:"useExternalDNS,omitempty" yaml:"useExternalDNS,omitempty"`
}

DNSParams allows setting of annotations for DNS management by external tool

type GKECredentialAdditionalProperties

type GKECredentialAdditionalProperties struct {
	Project               string  `json:"project,omitempty"`
	Cluster               string  `json:"cluster,omitempty"`
	Region                string  `json:"region,omitempty"`
	Zone                  string  `json:"zone,omitempty"`
	ServiceAccountKeyfile string  `json:"serviceAccountKeyfile,omitempty"`
	Defaults              *Params `json:"defaults,omitempty"`
}

GKECredentialAdditionalProperties contains the non standard fields for this type of credentials

type GKECredentials

type GKECredentials struct {
	Name                 string                            `json:"name,omitempty"`
	Type                 string                            `json:"type,omitempty"`
	AdditionalProperties GKECredentialAdditionalProperties `json:"additionalProperties,omitempty"`
}

GKECredentials represents the credentials of type kubernetes-engine as defined in the server config and passed to this trusted image

func (*GKECredentials) GetLocation

func (c *GKECredentials) GetLocation() string

type Kind

type Kind string
const (
	KindDeployment         Kind = "deployment"
	KindHeadlessDeployment Kind = "headless-deployment"
	KindStatefulset        Kind = "statefulset"
	KindJob                Kind = "job"
	KindCronJob            Kind = "cronjob"
	KindConfig             Kind = "config"
	KindConfigToFile       Kind = "config-to-file"

	KindUnknown Kind = ""
)

type LifecycleParams

type LifecycleParams struct {
	PrestopSleep        *bool `json:"prestopsleep,omitempty" yaml:"prestopsleep,omitempty"`
	PrestopSleepSeconds *int  `json:"prestopsleepseconds,omitempty" yaml:"prestopsleepseconds,omitempty"`
}

LifecycleParams sets params for lifecycle commands

type ManifestsParams

type ManifestsParams struct {
	Files []string               `json:"files,omitempty" yaml:"files,omitempty"`
	Data  map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"`
}

ManifestsParams can be used to override or add additional manifests located in the application repository

type MemoryParams

type MemoryParams struct {
	Request string `json:"request,omitempty" yaml:"request,omitempty"`
	Limit   string `json:"limit,omitempty" yaml:"limit,omitempty"`
}

MemoryParams sets memory request and limit values

type MetricsData

type MetricsData struct {
	Scrape bool
	Path   string
	Port   int
}

MetricsData has data to configure prometheus metrics scraping

type MetricsParams

type MetricsParams struct {
	Scrape *bool  `json:"scrape,omitempty" yaml:"scrape,omitempty"`
	Path   string `json:"path,omitempty" yaml:"path,omitempty"`
	Port   int    `json:"port,omitempty" yaml:"port,omitempty"`
}

MetricsParams sets params for scraping prometheus metrics

type OperatingSystem

type OperatingSystem string
const (
	OperatingSystemLinux   OperatingSystem = "linux"
	OperatingSystemWindows OperatingSystem = "windows"

	OperatingSystemUnknown OperatingSystem = ""
)

type Params

type Params struct {
	// control params
	Action                  ActionType      `json:"action,omitempty" yaml:"action,omitempty"`
	Kind                    Kind            `json:"kind,omitempty" yaml:"kind,omitempty"`
	DryRun                  bool            `json:"dryrun,omitempty" yaml:"dryrun,omitempty"`
	ProgressDeadlineSeconds int             `json:"progressDeadlineSeconds,omitempty" yaml:"progressDeadlineSeconds,omitempty"`
	BuildVersion            string          `json:"-" yaml:"-"`
	ChaosProof              bool            `json:"chaosproof,omitempty" yaml:"chaosproof,omitempty"`
	OperatingSystem         OperatingSystem `json:"os,omitempty" yaml:"os,omitempty"`
	Manifests               ManifestsParams `json:"manifests,omitempty" yaml:"manifests,omitempty"`
	TrustedIPRanges         []string        `json:"trustedips,omitempty" yaml:"trustedips,omitempty"`
	Canary                  CanaryParams    `json:"canary,omitempty" yaml:"canary,omitempty"`

	// app params
	App                             string                 `json:"app,omitempty" yaml:"app,omitempty"`
	Namespace                       string                 `json:"namespace,omitempty" yaml:"namespace,omitempty"`
	Schedule                        string                 `json:"schedule,omitempty" yaml:"schedule,omitempty"`
	RestartPolicy                   string                 `json:"restartPolicy,omitempty" yaml:"restartPolicy,omitempty"`
	Completions                     int                    `json:"completions,omitempty" yaml:"completions,omitempty"`
	Parallelism                     int                    `json:"parallelism,omitempty" yaml:"parallelism,omitempty"`
	BackoffLimit                    *int                   `json:"backoffLimit,omitempty" yaml:"backoffLimit,omitempty"`
	ConcurrencyPolicy               string                 `json:"concurrencypolicy,omitempty" yaml:"concurrencypolicy,omitempty"`
	PodManagementPolicy             string                 `json:"podManagementpolicy,omitempty" yaml:"podManagementpolicy,omitempty"`
	Replicas                        int                    `json:"replicas,omitempty" yaml:"replicas,omitempty"`
	StorageClass                    string                 `json:"storageclass,omitempty" yaml:"storageclass,omitempty"`
	StorageSize                     string                 `json:"storagesize,omitempty" yaml:"storagesize,omitempty"`
	StorageMountPath                string                 `json:"storagemountpath,omitempty" yaml:"storagemountpath,omitempty"`
	Labels                          map[string]string      `json:"labels,omitempty" yaml:"labels,omitempty"`
	Visibility                      Visibility             `json:"visibility,omitempty" yaml:"visibility,omitempty"`
	ContainerNativeLoadBalancing    bool                   `json:"containerNativeLoadBalancing,omitempty" yaml:"containerNativeLoadBalancing,omitempty"`
	IapOauthCredentialsClientID     string                 `json:"iapOauthClientID,omitempty" yaml:"iapOauthClientID,omitempty"`
	IapOauthCredentialsClientSecret string                 `json:"iapOauthClientSecret,omitempty" yaml:"iapOauthClientSecret,omitempty"`
	EspEndpointsProjectID           string                 `json:"espEndpointsProjectID,omitempty" yaml:"espEndpointsProjectID,omitempty"`
	EspConfigID                     string                 `json:"espConfigID,omitempty" yaml:"espConfigID,omitempty"`
	EspOpenAPIYamlPath              string                 `json:"espOpenapiYamlPath,omitempty" yaml:"espOpenapiYamlPath,omitempty"`
	EspServiceTypeClusterIP         bool                   `json:"espServiceTypeClusterIP,omitempty" yaml:"espServiceTypeClusterIP,omitempty"`
	WhitelistedIPS                  []string               `json:"whitelist,omitempty" yaml:"whitelist,omitempty"`
	Hosts                           []string               `json:"hosts,omitempty" yaml:"hosts,omitempty"`
	HostsRouteOnly                  []string               `json:"hostsrouteonly,omitempty" yaml:"hostsrouteonly,omitempty"`
	InternalHosts                   []string               `json:"internalhosts,omitempty" yaml:"internalhosts,omitempty"`
	InternalHostsRouteOnly          []string               `json:"internalhostsrouteonly,omitempty" yaml:"internalhostsrouteonly,omitempty"`
	ApigeeSuffix                    string                 `json:"apigeesuffix,omitempty" yaml:"apigeesuffix,omitempty"`
	Basepath                        string                 `json:"basepath,omitempty" yaml:"basepath,omitempty"`
	Autoscale                       AutoscaleParams        `json:"autoscale,omitempty" yaml:"autoscale,omitempty"`
	VerticalPodAutoscaler           VPAParams              `json:"vpa,omitempty" yaml:"vpa,omitempty"`
	Request                         RequestParams          `json:"request,omitempty" yaml:"request,omitempty"`
	Secrets                         SecretsParams          `json:"secrets,omitempty" yaml:"secrets,omitempty"`
	Configs                         ConfigsParams          `json:"configs,omitempty" yaml:"configs,omitempty"`
	VolumeMounts                    []VolumeMountParams    `json:"volumemounts,omitempty" yaml:"volumemounts,omitempty"`
	CertificateSecret               string                 `json:"certificatesecret,omitempty" yaml:"certificatesecret,omitempty"`
	AllowHTTP                       bool                   `json:"allowhttp,omitempty" yaml:"allowhttp,omitempty"`
	EnablePayloadLogging            bool                   `json:"enablePayloadLogging,omitempty" yaml:"enablePayloadLogging,omitempty"`
	UseGoogleCloudCredentials       bool                   `json:"useGoogleCloudCredentials,omitempty" yaml:"useGoogleCloudCredentials,omitempty"`
	WorkloadIdentity                *bool                  `json:"workloadIdentity,omitempty" yaml:"workloadIdentity,omitempty"`
	PodSecurityContext              map[string]interface{} `json:"securityContext,omitempty" yaml:"securityContext,omitempty"`
	DNS                             DNSParams              `json:"dns,omitempty" yaml:"dns,omitempty"`

	DisableServiceAccountKeyRotation       *bool                     `json:"disableServiceAccountKeyRotation,omitempty" yaml:"disableServiceAccountKeyRotation,omitempty"`
	LegacyGoogleCloudServiceAccountKeyFile string                    `json:"legacyGoogleCloudServiceAccountKeyFile,omitempty" yaml:"legacyGoogleCloudServiceAccountKeyFile,omitempty"`
	GoogleCloudCredentialsApp              string                    `json:"googleCloudCredentialsApp,omitempty" yaml:"googleCloudCredentialsApp,omitempty"`
	ProbeService                           *bool                     `json:"probeService,omitempty" yaml:"probeService,omitempty"`
	TopologyAwareHints                     *bool                     `json:"topologyAwareHints,omitempty" yaml:"topologyAwareHints,omitempty"`
	Tolerations                            []*map[string]interface{} `json:"tolerations,omitempty" yaml:"tolerations,omitempty"`
	Affinity                               *map[string]interface{}   `json:"affinity,omitempty" yaml:"affinity,omitempty"`

	// container params
	Container              ContainerParams           `json:"container,omitempty" yaml:"container,omitempty"`
	InjectHTTPProxySidecar *bool                     `json:"injecthttpproxysidecar,omitempty" yaml:"injecthttpproxysidecar,omitempty"`
	InitContainers         []*map[string]interface{} `json:"initcontainers,omitempty" yaml:"initcontainers,omitempty"`
	Sidecar                SidecarParams             `json:"sidecar,omitempty" yaml:"sidecar,omitempty"`
	Sidecars               []*SidecarParams          `json:"sidecars,omitempty" yaml:"sidecars,omitempty"`
	CustomSidecars         []*map[string]interface{} `json:"customsidecars,omitempty" yaml:"customsidecars,omitempty"`
	StrategyType           StrategyType              `json:"strategytype,omitempty" yaml:"strategytype,omitempty"`
	AtomicID               string                    `json:"-" yaml:"-"`
	RollingUpdate          RollingUpdateParams       `json:"rollingupdate,omitempty" yaml:"rollingupdate,omitempty"`

	// set default image for sidecars
	DefaultOpenrestySidecarImage     string `json:"defaultOpenrestySidecarImage,omitempty" yaml:"defaultOpenrestySidecarImage,omitempty"`
	DefaultESPSidecarImage           string `json:"defaultESPSidecarImage,omitempty" yaml:"defaultESPSidecarImage,omitempty"`
	DefaultESPv2SidecarImage         string `json:"defaultESPv2SidecarImage,omitempty" yaml:"defaultESPv2SidecarImage,omitempty"`
	DefaultCloudSQLProxySidecarImage string `json:"defaultCloudSQLProxySidecarImage,omitempty" yaml:"defaultCloudSQLProxySidecarImage,omitempty"`

	// params for image pull secret
	ImagePullSecretUser     string `json:"imagePullSecretUser,omitempty" yaml:"imagePullSecretUser,omitempty"`
	ImagePullSecretPassword string `json:"imagePullSecretPassword,omitempty" yaml:"imagePullSecretPassword,omitempty"`
}

Params is used to parameterize the deployment, set from custom properties in the manifest

func (*Params) HasSecrets

func (p *Params) HasSecrets() bool

func (*Params) ReplaceSidecarTagsWithDigest

func (p *Params) ReplaceSidecarTagsWithDigest()

ReplaceSidecarTagsWithDigest replaces image tags for sidecars with a digest

func (*Params) SetDefaults

func (p *Params) SetDefaults(gitSource, gitOwner, gitName, appLabel, buildVersion, releaseName string, releaseAction ActionType, releaseID string, estafetteLabels map[string]string)

SetDefaults fills in empty fields with convention-based defaults

func (*Params) ValidateRequiredProperties

func (p *Params) ValidateRequiredProperties() (bool, []error, []string)

ValidateRequiredProperties checks whether all needed properties are set

type ProbeData

type ProbeData struct {
	Path                string
	Port                int
	InitialDelaySeconds int
	TimeoutSeconds      int
	PeriodSeconds       int
	IncludeOnContainer  bool
	FailureThreshold    int
	SuccessThreshold    int
}

ProbeData has data specific to liveness and readiness probes

type ProbeParams

type ProbeParams struct {
	Enabled             *bool  `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	Path                string `json:"path,omitempty" yaml:"path,omitempty"`
	Port                int    `json:"port,omitempty" yaml:"port,omitempty"`
	InitialDelaySeconds int    `json:"delay,omitempty" yaml:"delay,omitempty"`
	TimeoutSeconds      int    `json:"timeout,omitempty" yaml:"timeout,omitempty"`
	PeriodSeconds       int    `json:"period,omitempty" yaml:"period,omitempty"`
	FailureThreshold    int    `json:"failureThreshold,omitempty" yaml:"failureThreshold,omitempty"`
	SuccessThreshold    int    `json:"successThreshold,omitempty" yaml:"successThreshold,omitempty"`
}

ProbeParams sets params for liveness or readiness probe

type RequestParams

type RequestParams struct {
	IngressBackendProtocol string `json:"ingressbackendprotocol,omitempty" yaml:"ingressbackendprotocol,omitempty"`
	Timeout                string `json:"timeout,omitempty" yaml:"timeout,omitempty"`
	KeepaliveTimeout       string `json:"keepaliveTimeout,omitempty" yaml:"keepaliveTimeout,omitempty"`
	MaxBodySize            string `json:"maxbodysize,omitempty" yaml:"maxbodysize,omitempty"`
	ProxyBufferSize        string `json:"proxybuffersize,omitempty" yaml:"proxybuffersize,omitempty"`
	ProxyBuffersNumber     int    `json:"proxybuffersnumber,omitempty" yaml:"proxybuffersnumber,omitempty"`
	ClientBodyBufferSize   string `json:"clientbodybuffersize,omitempty" yaml:"clientbodybuffersize,omitempty"`
	LoadBalanceAlgorithm   string `json:"loadbalance,omitempty" yaml:"loadbalance,omitempty"`
	AuthSecret             string `json:"authsecret,omitempty" yaml:"authsecret,omitempty"`
	VerifyDepth            int    `json:"verifydepth,omitempty" yaml:"verifydepth,omitempty"`
	ConfigurationSnippet   string `json:"configurationSnippet,omitempty" yaml:"configurationSnippet,omitempty"`
}

RequestParams controls timeouts, max body size, etc

type RollingUpdateParams

type RollingUpdateParams struct {
	MaxSurge       string `json:"maxsurge,omitempty" yaml:"maxsurge,omitempty"`
	MaxUnavailable string `json:"maxunavailable,omitempty" yaml:"maxunavailable,omitempty"`
	Timeout        string `json:"timeout,omitempty" yaml:"timeout,omitempty"`
}

RollingUpdateParams sets params for controlling rolling update speed

type SecretsParams

type SecretsParams struct {
	Keys      map[string]interface{} `json:"keys,omitempty" yaml:"keys,omitempty"`
	MountPath string                 `json:"mountpath,omitempty" yaml:"mountpath,omitempty"`
}

SecretsParams allows secrets to be set dynamically for the application

type ServiceData

type ServiceData struct {
	ServiceType                         string
	Name                                string
	UseDNSAnnotationsOnService          bool `default:"false"`
	UseBackendConfigAnnotationOnService bool `default:"false"`
	UseNegAnnotationOnService           bool `default:"false"`
}

ServiceData has data specific to service

type ServiceType

type ServiceType string
const (
	ServiceTypeLoadBalancer ServiceType = "LoadBalancer"
	ServiceTypeClusterIP    ServiceType = "ClusterIP"
	ServiceTypeNodePort     ServiceType = "NodePort"

	ServiceTypeUnknown ServiceType = ""
)

type SidecarData

type SidecarData struct {
	Type                       string
	Image                      string
	EnvironmentVariables       map[string]interface{}
	SecretEnvironmentVariables map[string]interface{}
	HasEnvironmentVariables    bool
	CPURequest                 string
	MemoryRequest              string
	CPULimit                   string
	MemoryLimit                string
	SidecarSpecificProperties  map[string]interface{}
	HasCustomProperties        bool
	CustomPropertiesYAML       string
}

SidecarData configures the injected sidecar

type SidecarParams

type SidecarParams struct {
	Type                              SidecarType            `json:"type,omitempty" yaml:"type,omitempty"`
	Image                             string                 `json:"image,omitempty" yaml:"image,omitempty"`
	EnvironmentVariables              map[string]interface{} `json:"env,omitempty" yaml:"env,omitempty"`
	SecretEnvironmentVariables        map[string]interface{} `json:"secretEnv,omitempty" yaml:"secretEnv,omitempty"`
	CPU                               CPUParams              `json:"cpu,omitempty" yaml:"cpu,omitempty"`
	Memory                            MemoryParams           `json:"memory,omitempty" yaml:"memory,omitempty"`
	HealthCheckPath                   string                 `json:"healthcheckpath,omitempty" yaml:"healthcheckpath,omitempty"`
	DbInstanceConnectionName          string                 `json:"dbinstanceconnectionname,omitempty" yaml:"dbinstanceconnectionname,omitempty"`
	SQLProxyPort                      int                    `json:"sqlproxyport,omitempty" yaml:"sqlproxyport,omitempty"`
	SQLProxyTerminationTimeoutSeconds int                    `json:"sqlproxyterminationtimeoutseconds,omitempty" yaml:"sqlproxyterminationtimeoutseconds,omitempty"`
	CustomProperties                  map[string]interface{} `yaml:",inline"`
}

SidecarParams sets params for sidecar injection

type SidecarType

type SidecarType string
const (
	SidecarTypeOpenresty     SidecarType = "openresty"
	SidecarTypeESP           SidecarType = "esp"
	SidecarTypeESPv2         SidecarType = "espv2"
	SidecarTypeCloudSQLProxy SidecarType = "cloudsqlproxy"
	SidecarTypeIstio         SidecarType = "istio"

	SidecarTypeUnknown SidecarType = ""
)

type StrategyType

type StrategyType string
const (
	StrategyTypeRollingUpdate StrategyType = "RollingUpdate"
	StrategyTypeRecreate      StrategyType = "Recreate"
	StrategyTypeAtomicUpdate  StrategyType = "AtomicUpdate"

	StrategyTypeUnknown StrategyType = ""
)

type TemplateData

type TemplateData struct {
	Name                            string
	NameWithTrack                   string
	Namespace                       string
	Schedule                        string
	RestartPolicy                   string
	Completions                     int
	Parallelism                     int
	BackoffLimit                    int
	ProgressDeadlineSeconds         int
	ConcurrencyPolicy               string
	Labels                          map[string]string
	PodLabels                       map[string]string
	AppLabelSelector                string
	Hosts                           []string
	HostsJoined                     string
	InternalHosts                   []string
	InternalHostsJoined             string
	AllHosts                        []string
	AllHostsJoined                  string
	ApigeeHosts                     []string
	ApigeeHostsJoined               string
	IngressPath                     string
	InternalIngressPath             string
	UseIngress                      bool
	UseNginxIngress                 bool
	UseGCEIngress                   bool
	PathType                        string
	UseDNSAnnotationsOnIngress      bool
	UseCloudflareProxy              bool
	UseCloudflareEstafetteExtension bool
	UseExternalDNS                  bool

	Service               ServiceData
	UsePrometheusProbe    bool
	UseTopologyAwareHints bool

	MinReplicas                          int
	MaxReplicas                          int
	TargetCPUPercentage                  int
	UseHpaScaler                         bool
	HpaScalerPromQuery                   string
	HpaScalerRequestsPerReplica          string
	HpaScalerDelta                       string
	HpaScalerScaleDownMaxRatio           string
	VpaUpdateMode                        string
	PreferPreemptibles                   bool
	UseWindowsNodes                      bool
	Container                            ContainerData
	Sidecars                             []SidecarData
	HasCustomSidecars                    bool
	CustomSidecars                       []*map[string]interface{}
	HasInitContainers                    bool
	InitContainers                       []*map[string]interface{}
	PodSecurityContext                   map[string]interface{}
	HasOpenrestySidecar                  bool
	UseESP                               bool
	UseWorkloadIdentity                  bool
	HasEspConfigID                       bool
	EspConfigID                          string
	EspService                           string
	EspRequestTimeout                    int
	MountVolumes                         bool
	MountSslCertificate                  bool
	MountApplicationSecrets              bool
	Secrets                              map[string]interface{}
	SecretMountPath                      string
	MountConfigmap                       bool
	ConfigmapFiles                       map[string]string
	ConfigMountPath                      string
	MountPayloadLogging                  bool
	MountServiceAccountSecret            bool
	DisableServiceAccountKeyRotation     bool
	UseLegacyServiceAccountKey           bool
	LegacyServiceAccountKey              string
	GoogleCloudCredentialsAppName        string
	GoogleCloudCredentialsLabels         map[string]string
	StrategyType                         string
	RollingUpdateMaxSurge                string
	RollingUpdateMaxUnavailable          string
	LimitTrustedIPRanges                 bool
	TrustedIPRanges                      []string
	ManifestData                         map[string]interface{}
	IncludeTrackLabel                    bool
	TrackLabel                           string
	AddSafeToEvictAnnotation             bool
	MountAdditionalVolumes               bool
	AdditionalVolumeMounts               []VolumeMountData
	AdditionalContainerPorts             []AdditionalPortData
	AdditionalServicePorts               []AdditionalPortData
	OverrideDefaultWhitelist             bool
	NginxIngressBackendProtocol          string
	NginxIngressWhitelist                string
	NginxIngressClientBodyBufferSize     string
	NginxIngressProxyConnectTimeout      int
	NginxIngressProxySendTimeout         int
	NginxIngressProxyReadTimeout         int
	NginxIngressProxyBodySize            string
	NginxIngressProxyBufferSize          string
	NginxIngressProxyBuffersNumber       string
	SetsNginxIngressLoadBalanceAlgorithm bool
	NginxIngressLoadBalanceAlgorithm     string
	NginxIngressConfigurationSnippet     string
	UseHTTPS                             bool
	AllowHTTP                            bool
	BackendConfigTimeout                 int
	NginxAuthTLSSecret                   string
	NginxAuthTLSVerifyDepth              int
	Tolerations                          []*map[string]interface{}
	HasTolerations                       bool
	Affinity                             *map[string]interface{}

	IncludeReplicas                 bool
	Replicas                        int
	PodManagementPolicy             string
	StorageClass                    string
	StorageSize                     string
	StorageMountPath                string
	IapOauthCredentialsClientID     string
	IapOauthCredentialsClientSecret string
	IsSimpleEnvvarValue             func(interface{}) bool
	ToYAML                          func(interface{}) string
	RenderToYAML                    func(v interface{}, data interface{}) string
	UseCertificateSecret            bool
	CertificateSecretName           string

	HasImagePullSecret bool
	DockerConfig       map[string]map[string]map[string]string

	IncludeAtomicIDSelector bool
	AtomicID                string
	Canary                  CanaryParams
}

TemplateData contains the root data for rendering the Kubernetes manifests

type UpdateMode

type UpdateMode string
const (
	UpdateModeUnknown  UpdateMode = ""
	UpdateModeOff      UpdateMode = "Off"
	UpdateModeInitial  UpdateMode = "Initial"
	UpdateModeRecreate UpdateMode = "Recreate"
	UpdateModeAuto     UpdateMode = "Auto"
)

type VPAParams

type VPAParams struct {
	Enabled    *bool      `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	UpdateMode UpdateMode `json:"updateMode,omitempty" yaml:"updateMode,omitempty"`
}

type Visibility

type Visibility string
const (
	VisibilityPrivate         Visibility = "private"
	VisibilityPublic          Visibility = "public"
	VisibilityPublicWhitelist Visibility = "public-whitelist"
	VisibilityESP             Visibility = "esp"
	VisibilityESPv2           Visibility = "espv2"
	VisibilityIAP             Visibility = "iap"
	VisibilityApigee          Visibility = "apigee"

	VisibilityUnknown Visibility = ""
)

type VolumeMountData

type VolumeMountData struct {
	Name       string
	MountPath  string
	VolumeYAML string
}

VolumeMountData configures additional volume mounts for shared secrets, existing volumes, etc

type VolumeMountParams

type VolumeMountParams struct {
	Name      string                 `json:"name,omitempty" yaml:"name,omitempty"`
	MountPath string                 `json:"mountpath,omitempty" yaml:"mountpath,omitempty"`
	Volume    map[string]interface{} `json:"volume,omitempty" yaml:"volume,omitempty"`
}

VolumeMountParams allows additional mounts for already existing volumes, secrets, etc

Jump to

Keyboard shortcuts

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