k8s

package
v0.0.0-...-be2aeb8 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2024 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Instance

func Instance(pod *corev1.Pod, env string) *model.Instance

func Message

func Message(job *batchv1.Job) string

Types

type AppCondition

type AppCondition string
const (
	AppConditionRolloutComplete       AppCondition = "RolloutComplete"
	AppConditionFailedSynchronization AppCondition = "FailedSynchronization"
	AppConditionSynchronized          AppCondition = "Synchronized"
	AppConditionUnknown               AppCondition = "Unknown"
)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(tenant string, cfg config.K8S, errors metric.Int64Counter, teamsClient teams.Client, log logrus.FieldLogger) (*Client, error)

func (*Client) App

func (c *Client) App(ctx context.Context, name, team, env string) (*model.App, error)

func (*Client) AppExists

func (c *Client) AppExists(env, team, app string) bool

AppExists returns true if the given app exists in the given environment. The app informer should be synced before calling this function.

func (*Client) Apps

func (c *Client) Apps(ctx context.Context, team string) ([]*model.App, error)

func (*Client) Informers

func (c *Client) Informers() map[string]*Informers

Informers returns a map of informers, keyed by environment

func (*Client) Instances

func (c *Client) Instances(ctx context.Context, team, env, name string) ([]*model.Instance, error)

func (*Client) Log

func (c *Client) Log(ctx context.Context, cluster, namespace, pod, container string, tailLines int64) ([]*model.LogLine, error)

func (*Client) LogStream

func (c *Client) LogStream(ctx context.Context, cluster, namespace, selector, container string, instances []string) (<-chan *model.LogLine, error)

func (*Client) Manifest

func (c *Client) Manifest(ctx context.Context, name, team, env string) (string, error)

func (*Client) NaisJob

func (c *Client) NaisJob(ctx context.Context, name, team, env string) (*model.NaisJob, error)

func (*Client) NaisJobManifest

func (c *Client) NaisJobManifest(ctx context.Context, name, team, env string) (string, error)

func (*Client) NaisJobs

func (c *Client) NaisJobs(ctx context.Context, team string) ([]*model.NaisJob, error)

func (*Client) Runs

func (c *Client) Runs(ctx context.Context, team, env, name string) ([]*model.Run, error)

func (*Client) Search

func (c *Client) Search(ctx context.Context, q string, filter *model.SearchFilter) []*search.Result

func (*Client) ToNaisJob

func (c *Client) ToNaisJob(u *unstructured.Unstructured, env string) (*model.NaisJob, error)

type ClusterConfigMap

type ClusterConfigMap map[string]rest.Config

func CreateClusterConfigMap

func CreateClusterConfigMap(tenant string, cfg config.K8S) (ClusterConfigMap, error)

type Informers

type Informers struct {
	AppInformer     informers.GenericInformer
	PodInformer     corev1inf.PodInformer
	NaisjobInformer informers.GenericInformer
	JobInformer     batchv1inf.JobInformer
	TopicInformer   informers.GenericInformer
	EventInformer   corev1inf.EventInformer
}

Jump to

Keyboard shortcuts

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