istio: Index | Files

package cluster

import ""


Package Files


func ParsePath Uses

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 Uses

func PodKey(namespace, pod string) string

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

type ResourceType Uses

type ResourceType int
const (
    Namespace ResourceType = iota

type Resources Uses

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 Uses

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 Uses

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

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

func (*Resources) IsDiscoveryContainer Uses

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

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

func (*Resources) PodIstioVersion Uses

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 Uses

func (r *Resources) String() string

String implements the Stringer interface.

Package cluster imports 13 packages (graph) and is imported by 3 packages. Updated 2020-11-14. Refresh now. Tools for package owners.