k8s

package
v0.0.0-...-6186498 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContainerPOD     = "POD"
	ClusterNameLabel = "alpha.eksctl.io/cluster-name"
)

Variables

This section is empty.

Functions

func GetLabels

func GetLabels(a ...interface{}) map[string]string

func Run

func Run()

Types

type AuthType

type AuthType string
const (
	InCluster   AuthType = "InCluster"
	Credentials AuthType = "UsernamePassword"
	BearerToken AuthType = "BearerToken"
	ConfigFile  AuthType = "ConfigFile"
)

type Cluster

type Cluster struct {
	Name    string `yaml:"name"`
	Cluster struct {
		// CAData contains PEM-encoded certificate authority certificates.
		CAData string `yaml:"certificate-authority-data"`
		// Server is the address of the kubernetes cluster (https://hostname:port).
		Server string `yaml:"server"`
	} `yaml:"cluster"`
}

type ExtConfig

type ExtConfig struct {
	EndPoint string                                                 `json:"kubernetesClusterEndpoint"`
	Views    map[KubernetesView]map[string]transit.MetricDefinition `json:"views"`
	// Groups        []transit.ResourceGroup                                `json:"groups"`
	CheckInterval time.Duration             `json:"checkIntervalMinutes"`
	Ownership     transit.HostOwnershipType `json:"ownership,omitempty"`
	AuthType      AuthType                  `json:"authType"`
	Insecure      bool                      `json:"insecure"`

	KubernetesUserName     string `json:"kubernetesUserName,omitempty"`
	KubernetesUserPassword string `json:"kubernetesUserPassword,omitempty"`
	KubernetesBearerToken  string `json:"kubernetesBearerToken,omitempty"`
	KubernetesConfigFile   string `json:"kubernetesConfigFile,omitempty"`

	GWMapping
}

ExtConfig defines the MonitorConnection extensions configuration extended with general configuration fields

type GWMapping

type GWMapping struct {
	HostGroup mapping.Mappings `json:"mapHostgroup"`
	HostName  mapping.Mappings `json:"mapHostname"`
}

func (*GWMapping) Prepare

func (m *GWMapping) Prepare()

Prepare compiles mappings

type KubernetesConnector

type KubernetesConnector struct {
	ExtConfig
	// contains filtered or unexported fields
}

func (*KubernetesConnector) Collect

Collect inventory and metrics for all kinds of Kubernetes resources. Sort resources into groups and return inventory of host resources and inventory of groups

func (*KubernetesConnector) Initialize

func (connector *KubernetesConnector) Initialize(ctx context.Context) error

func (*KubernetesConnector) Ping

func (connector *KubernetesConnector) Ping() error

type KubernetesResource

type KubernetesResource struct {
	Name     string
	Type     transit.ResourceType
	Status   transit.MonitorStatus
	Message  string
	Labels   map[string]string
	Services map[string]transit.MonitoredService
}

type KubernetesView

type KubernetesView string
const (
	ViewNodes KubernetesView = "Nodes"
	ViewPods  KubernetesView = "Pods"
)

type KubernetesYaml

type KubernetesYaml struct {
	Kind     string    `yaml:"kind"`
	Users    []User    `yaml:"users"`
	Clusters []Cluster `yaml:"clusters"`
}

KubernetesYaml defines config structure kubectl config view --flatten

type MonitoredState

type MonitoredState struct {
	State      map[string]KubernetesResource
	Groups     map[string]transit.ResourceGroup
	Mismatched map[string]bool
}

type User

type User struct {
	Name string `yaml:"name"`
	User struct {
		CertData string `yaml:"client-certificate-data"`
		KeyData  string `yaml:"client-key-data"`
		Token    string `yaml:"token"`
	} `yaml:"user"`
}

Jump to

Keyboard shortcuts

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