pod

package
v0.0.0-...-477bbb3 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NaisGarTolerationKey   = "nais.io/gar"
	NaisGarNodeSelectorKey = "nais.io/gar-node-pool"
	GarImagePrefix         = "europe-north1-docker.pkg.dev/"
)

Variables

This section is empty.

Functions

func AppClientID

func AppClientID(source resource.Source, cluster string) string

func ConfigureAffinity

func ConfigureAffinity(appName string, tolerations []corev1.Toleration) *corev1.Affinity

func CreateAppContainer

func CreateAppContainer(app Source, ast *resource.Ast, cfg Config) error

func CreateAppObjectMeta

func CreateAppObjectMeta(app Source, ast *resource.Ast, cfg Config) metav1.ObjectMeta

func CreateContainerEnvVars

func CreateContainerEnvVars(app EnvSource, ast *resource.Ast, cfg Config)

func CreateNaisjobContainer

func CreateNaisjobContainer(naisjob *nais_io_v1.Naisjob, ast *resource.Ast, cfg Config) error

func CreateNaisjobObjectMeta

func CreateNaisjobObjectMeta(naisjob *nais_io_v1.Naisjob, ast *resource.Ast, cfg Config) metav1.ObjectMeta

func CreateSpec

func CreateSpec(ast *resource.Ast, cfg Config, appName string, annotations map[string]string, restartPolicy corev1.RestartPolicy, terminationGracePeriodSeconds *int64) (*corev1.PodSpec, error)

func DefaultContainerSecurityContext

func DefaultContainerSecurityContext() *corev1.SecurityContext

func EnvFromSecret

func EnvFromSecret(name string) corev1.EnvFromSource

func FilesFromEmptyDir

func FilesFromEmptyDir(volumeName string, medium nais_io_v1.MediumType) corev1.Volume

func FromFilesPVCVolume

func FromFilesPVCVolume(volumeName, pvcName string) corev1.Volume

func FromFilesSecretVolume

func FromFilesSecretVolume(volumeName, secretName string, items []corev1.KeyToPath) corev1.Volume

func FromFilesSecretVolumeWithMode

func FromFilesSecretVolumeWithMode(volumeName, secretName string, items []corev1.KeyToPath, mode *int32) corev1.Volume

func FromFilesVolumeMount

func FromFilesVolumeMount(name, mountPath, defaultMountPath string, readOnly bool) corev1.VolumeMount

func SetupTolerations

func SetupTolerations(cfg Config, image string) []corev1.Toleration

func WithAdditionalEnvFromSecret

func WithAdditionalEnvFromSecret(ast *resource.Ast, secretName string)

func WithAdditionalSecret

func WithAdditionalSecret(ast *resource.Ast, secretName, mountPath string)

Types

type Config

type Config interface {
	GetClusterName() string
	GetGoogleProjectID() string
	GetHostAliases() []config.HostAlias
	GetImagePullSecrets() []string
	IsLinkerdEnabled() bool
	IsPrometheusOperatorEnabled() bool
	IsGARTolerationEnabled() bool
}

type EnvSource

type EnvSource interface {
	resource.Source
	GetEnv() nais_io_v1.EnvVars
	GetImage() string
}

type Source

type Source interface {
	resource.Source
	GetCommand() []string
	GetEnv() nais_io_v1.EnvVars
	GetEnvFrom() []nais_io_v1.EnvFrom
	GetFilesFrom() []nais_io_v1.FilesFrom
	GetImage() string
	GetLiveness() *nais_io_v1.Probe
	GetLogformat() string
	GetLogtransform() string
	GetPort() int
	GetPreStopHook() *nais_io_v1.PreStopHook
	GetPreStopHookPath() string
	GetPrometheus() *nais_io_v1.PrometheusConfig
	GetReadiness() *nais_io_v1.Probe
	GetResources() *nais_io_v1.ResourceRequirements
	GetStartup() *nais_io_v1.Probe
}

Jump to

Keyboard shortcuts

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