pod

package
v0.0.0-...-709f317 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 15 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 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 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
	GetAllowedKernelCapabilities() []string
	GetImagePullSecrets() []string
	IsLinkerdEnabled() bool
	IsPrometheusOperatorEnabled() bool
	IsGARTolerationEnabled() bool
}

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