k8s

package
v0.6.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	KubernetesName           = "kubernetes"
	KubernetesConfigFileName = ".melange.k8s.yaml"
)

Variables

This section is empty.

Functions

func NewRunner

func NewRunner(ctx context.Context) (container.Runner, error)

Types

type KubernetesRunnerConfig

type KubernetesRunnerConfig struct {
	Provider    string            `json:"provider" yaml:"provider"`
	Context     string            `json:"context" yaml:"context"`
	Repo        string            `json:"repo" yaml:"repo"`
	Namespace   string            `json:"namespace" yaml:"namespace"`
	Annotations map[string]string `json:"annotations,omitempty" yaml:"annotations,omitempty"`
	Labels      map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`

	StartTimeout metav1.Duration `json:"startTimeout" yaml:"startTimeout" split_words:"true"`

	// This field and everything below it is ignored by the environment variable parser
	PodTemplate *KubernetesRunnerConfigPodTemplate `json:"podTemplate,omitempty" yaml:"podTemplate,omitempty" ignored:"true"`
	// contains filtered or unexported fields
}

KubernetesRunnerConfig handles the configuration for the Kubernetes runner It sources from various locations, in the following order of precedence:

  1. The "global" config file
  2. Defaults

TODO: Add loaders from package config and environment

func NewKubernetesConfig

func NewKubernetesConfig(opt ...KubernetesRunnerConfigOptions) (*KubernetesRunnerConfig, error)

NewKubernetesConfig returns a default Kubernetes runner config setup

type KubernetesRunnerConfigOptions

type KubernetesRunnerConfigOptions func(*KubernetesRunnerConfig)

func WithKubernetesRunnerConfigBaseConfigFile

func WithKubernetesRunnerConfigBaseConfigFile(path string) KubernetesRunnerConfigOptions

WithKubernetesRunnerConfigBaseConfigFile sets the path to a config file with KubernetesRunner-specific options

type KubernetesRunnerConfigPodTemplate

type KubernetesRunnerConfigPodTemplate struct {
	ServiceAccountName string               `json:"serviceAccountName,omitempty" yaml:"serviceAccountName,omitempty"`
	NodeSelector       map[string]string    `json:"nodeSelector,omitempty" yaml:"nodeSelector,omitempty"`
	Env                []corev1.EnvVar      `json:"env,omitempty" yaml:"env,omitempty"`
	Affinity           *corev1.Affinity     `json:"affinity,omitempty" yaml:"affinity,omitempty"`
	RuntimeClassName   *string              `json:"runtimeClassName,omitempty" yaml:"runtimeClassName,omitempty"`
	Volumes            []corev1.Volume      `json:"volumes,omitempty" yaml:"volumes,omitempty"`
	VolumeMounts       []corev1.VolumeMount `json:"volumeMounts,omitempty" yaml:"volumeMounts,omitempty"`
}

Jump to

Keyboard shortcuts

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