config

package
v0.2.3-rc Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Default = "default"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Replicas   int32             `json:"replicas"`
	Namespace  string            `json:"namespace"`
	Name       string            `json:"name,omitempty"`
	Containers []Container       `json:"containers,omitempty"`
	JobLabels  map[string]string `json:"job_labels,omitempty"`
	Volumes    []Volume          `json:"volumes,omitempty"`
	TTLSeconds *int32            `json:"ttl_seconds,omitempty"`
}

func ReadConfig

func ReadConfig(r resource.Resource, confJSON json.RawMessage, dc DriverConf) (*Config, error)

type ConfigMap

type ConfigMap struct {
	Name  string `json:"name"`
	Mount string `json:"mount"`
}

type Container

type Container struct {
	Name              string            `json:"name"`
	Image             string            `json:"image"`
	ImagePullPolicy   string            `json:"image_pull_policy,omitempty"`
	Command           []string          `json:"command,omitempty"`
	Args              []string          `json:"args,omitempty"`
	SecretsVolumes    []Secret          `json:"secrets_volumes,omitempty"`
	ConfigMapsVolumes []ConfigMap       `json:"config_maps_volumes,omitempty"`
	Limits            UsageSpec         `json:"limits,omitempty"`
	Requests          UsageSpec         `json:"requests,omitempty"`
	EnvConfigMaps     []string          `json:"env_config_maps,omitempty"`
	EnvVariables      map[string]string `json:"env_variables,omitempty"`
	PreStopCmd        []string          `json:"pre_stop_cmd,omitempty"`
	PostStartCmd      []string          `json:"post_start_cmd,omitempty"`
}

type DriverConf

type DriverConf struct {
	Namespace         string                       `json:"namespace"`         // maybe we shouldn't restrict namespace?
	RequestsAndLimits map[string]RequestsAndLimits `json:"requestsAndLimits"` // to use when not provided
	EnvVariables      map[string]string            `json:"env_variables"`
}

type RequestsAndLimits

type RequestsAndLimits struct {
	Limits   UsageSpec `json:"limits,omitempty"`
	Requests UsageSpec `json:"requests,omitempty"`
}

type Secret

type Secret struct {
	Name  string `json:"name"`
	Mount string `json:"mount"`
}

type UsageSpec

type UsageSpec struct {
	CPU    string `json:"cpu,omitempty" validate:"required"`
	Memory string `json:"memory,omitempty" validate:"required"`
}

type Volume

type Volume struct {
	Name string
	Kind string
}

Jump to

Keyboard shortcuts

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