k8s

package
v1.3.22 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 20 Imported by: 1

Documentation

Overview

Package k8s: initialization, client, and misc. helpers

  • Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.

Package k8s: initialization, client, and misc. helpers

  • Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.

Package k8s: initialization, client, and misc. helpers

  • Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved.

Package k8s: initialization, client, and misc. helpers

  • Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.

Index

Constants

View Source
const (
	Default = "default"
	Pod     = "pod"
	Svc     = "svc"
)

Variables

View Source
var (
	NodeName string // assign upon successful initialization

	ErrK8sRequired = errors.New("the operation requires Kubernetes")
)

Functions

func CleanName

func CleanName(name string) string

POD name (K8s doesn't allow `_` and uppercase)

func Init added in v1.3.22

func Init()

func InitMetricsClient added in v1.3.22

func InitMetricsClient()

func IsK8s added in v1.3.22

func IsK8s() bool

func Metrics added in v1.3.22

func Metrics(podName string) (float64, int64, error)

func ValidateEtlName added in v1.3.16

func ValidateEtlName(name string) error

Types

type Client

type Client interface {
	Create(v any) error
	Delete(entityType, entityName string) error
	CheckExists(entityType, entityName string) (bool, error)
	Pod(name string) (*corev1.Pod, error)
	Pods() (*corev1.PodList, error)
	Service(name string) (*corev1.Service, error)
	Node(name string) (*corev1.Node, error)
	Logs(podName string) ([]byte, error)
	Health(podName string) (string, error)
	CheckMetricsAvailability() error
}

Client is simplified version of default `kubernetes.Interface` client.

func GetClient

func GetClient() (Client, error)

Jump to

Keyboard shortcuts

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