discovery

package
v0.3.3-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package discovery contains functionality to discover the type of etcd used in back up and restore operations as well as what Kubernetes distro is used.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountKeysFor

func CountKeysFor(endpoint string, distro types.KubernetesDistro) (int, int, error)

CountKeysFor iterates over well-known keys of a given Kubernetes distro and returns the number of keys and their values total size, in the respective key range/subtree. Example:

numkeys, totalsize, err := discovery.Walk4Stats("http://localhost:2379", types.OpenShift)

func ProbeEtcd

func ProbeEtcd(endpoint string) (string, bool, error)

ProbeEtcd probes an endpoint at path /version to figure which version of etcd it is and in which mode (secure or insecure) it is used. Example:

version, secure, err := ProbeEtcd("http://localhost:2379")

func ProbeKubernetesDistro

func ProbeKubernetesDistro(endpoint string) (types.KubernetesDistro, error)

ProbeKubernetesDistro probes an etcd cluster for which Kubernetes distribution is present by scanning the available keys. Example:

distro, err := ProbeKubernetesDistro("http://localhost:2379")

func Visit2

func Visit2(kapi client.KeysAPI, path string, fn types.Reap) error

Visit2 recursively visits an etcd2 server from the root and applies the reap function on leaf nodes (keys that don't have sub-keys), otherwise descents the tree.

func Visit3

func Visit3(c3 *clientv3.Client, path string, distro types.KubernetesDistro, fn types.Reap) error

Visit3 visits all paths of an etcd3 server and applies the reap function on the keys.

Types

This section is empty.

Jump to

Keyboard shortcuts

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