cluster

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Namespace ResourceType = iota
	Deployment
	Pod
	Label
	Annotation
	Container

	GlooMeshEnterpriseAgentContainerName      = "enterprise-agent"
	GlooMeshEnterpriseNetworkingContainerName = "enterprise-networking"
	GlooMeshDashboardContainerName            = "apiserver"
	GlooMeshDiscoveryContainerName            = "discovery"
	GlooMeshNetworkingContainerName           = "networking"
)

Variables

This section is empty.

Functions

func ParsePath

func ParsePath(path string) (namespace string, deployment, pod string, container string, err error)

ParsePath parses path into its components. Input must have the form namespace/deployment/pod/container.

func PodKey

func PodKey(namespace, pod string) string

PodKey returns a unique key based on the namespace and pod name.

Types

type ResourceType

type ResourceType int

type Resources

type Resources struct {
	// Root is the first level in the cluster resource hierarchy.
	// Each level in the hierarchy is a map[string]interface{} to the next level.
	// The levels are: namespaces/deployments/pods/containers.
	Root map[string]interface{}
	// Labels maps a pod name to a map of labels key-values.
	Labels map[string]map[string]string
	// Annotations maps a pod name to a map of annotation key-values.
	Annotations map[string]map[string]string
	// Pod maps a pod name to its Pod info. The key is namespace/pod-name.
	Pod map[string]*corev1.Pod
}

Resources defines a tree of cluster resource names.

func GetClusterResources

func GetClusterResources(ctx context.Context, clientset *kubernetes.Clientset) (*Resources, error)

GetClusterResources returns cluster resources for the given REST config and k8s Clientset.

func (*Resources) ContainerRestarts

func (r *Resources) ContainerRestarts(namespace, pod, container string) int

ContainerRestarts returns the number of container restarts for the given container.

func (*Resources) IsDiscoveryContainer

func (r *Resources) IsDiscoveryContainer(clusterVersion, namespace, pod, container string) bool

IsDiscoveryContainer reports whether the given container is the Istio discovery container.

func (*Resources) IsGlooMeshAgentContainer

func (r *Resources) IsGlooMeshAgentContainer(container string) bool

IsGlooMeshAgentContainer reports whether the given container is the Gloo mesh agent.

func (*Resources) IsGlooMeshDashboardContainer

func (r *Resources) IsGlooMeshDashboardContainer(container string) bool

IsGlooMeshDashboardContainer reports whether the given container is the Gloo mesh dashboard.

func (*Resources) IsGlooMeshDiscoveryContainer

func (r *Resources) IsGlooMeshDiscoveryContainer(container string) bool

IsGlooMeshDiscoveryContainer reports whether the given container is the Gloo mesh networking.

func (*Resources) IsGlooMeshEnterpriseNetworkingContainer

func (r *Resources) IsGlooMeshEnterpriseNetworkingContainer(container string) bool

IsGlooMeshEnterpriseNetworkingContainer reports whether the given container is the Gloo mesh networking.

func (*Resources) IsGlooMeshNetworkingContainer

func (r *Resources) IsGlooMeshNetworkingContainer(container string) bool

IsGlooMeshNetworkingContainer reports whether the given container is the Gloo mesh networking.

func (*Resources) PodIstioVersion

func (r *Resources) PodIstioVersion(namespace, pod string) string

PodIstioVersion returns the Istio version for the given pod, if either the proxy or discovery are one of its containers and the tag is in a parseable format.

func (*Resources) String

func (r *Resources) String() string

String implements the Stringer interface.

Jump to

Keyboard shortcuts

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