k8s

package
v1.3.19 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package k8s provides utilities for communicating with Kubernetes cluster.

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

Package k8s provides utilities for communicating with Kubernetes cluster.

  • 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
)

Functions

func CleanName

func CleanName(name string) string

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

func Detect

func Detect() error

func ValidateEtlName

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)
	Metrics(podName string) (cpuCores float64, freeMem int64, err 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