k8s

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 6 Imported by: 9

Documentation

Index

Constants

View Source
const (
	KindPod        = "Pod"
	KindJob        = "Job"
	KindCronJob    = "CronJob"
	KindReplicaSet = "ReplicaSet"

	Deployments            = "deployments"
	ReplicaSets            = "replicasets"
	ReplicationControllers = "replicationcontrollers"
	StatefulSets           = "statefulsets"
	DaemonSets             = "daemonsets"
	CronJobs               = "cronjobs"
	Services               = "services"
	Jobs                   = "jobs"
	Pods                   = "pods"
	ConfigMaps             = "configmaps"
	Roles                  = "roles"
	RoleBindings           = "rolebindings"
	NetworkPolicys         = "networkpolicies"
	Ingresss               = "ingresses"
	ResourceQuotas         = "resourcequotas"
	LimitRanges            = "limitranges"
	ClusterRoles           = "clusterroles"
	ClusterRoleBindings    = "clusterrolebindings"
	PodSecurityPolicies    = "podsecuritypolicies"
)

Variables

This section is empty.

Functions

func IsClusterResource added in v0.2.2

func IsClusterResource(gvr schema.GroupVersionResource) bool

IsClusterResource returns if a GVR is a cluster resource

Types

type Cluster

type Cluster interface {
	// GetCurrentContext returns local kubernetes current-context
	GetCurrentContext() string
	// GetCurrentNamespace returns local kubernetes current namespace
	GetCurrentNamespace() string
	// GetDynamicClient returns a dynamic k8s client
	GetDynamicClient() dynamic.Interface
	// GetGVRs returns cluster GroupVersionResource to query kubernetes, receives
	// a boolean to determine if returns namespaced GVRs only or all GVRs
	GetGVRs(bool) ([]schema.GroupVersionResource, error)
	// GetGVR returns resource GroupVersionResource to query kubernetes, receives
	// a string with the resource kind
	GetGVR(string) (schema.GroupVersionResource, error)
}

Cluster interface represents the operations needed to scan a cluster

func GetCluster

func GetCluster(context string) (Cluster, error)

GetCluster returns a current configured cluster, receives context to use, if empty uses default

Jump to

Keyboard shortcuts

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