Documentation ¶
Index ¶
- Constants
- Variables
- func Daemon(config DaemonConfig) *appsv1.DaemonSet
- func FieldPath(name, path string) v1.EnvVar
- func IsCNIPlugin(n string) bool
- func IsInstanaAgent(pod PodInfo) bool
- func PingHost(host string, useGateway bool) v1.EnvVar
- func Pinger(config PingerConfig) *appsv1.DaemonSet
- func ResourceRequirements(resources Resources) v1.ResourceRequirements
- func Service(config DaemonConfig) *v1.Service
- type AgentEvent
- type AgentInfo
- type Applyable
- type Command
- type ContainerInfo
- type Counter
- type DaemonConfig
- type Index
- type Info
- type KubernetesCommand
- type KubernetesQuery
- func (q *KubernetesQuery) AgentInfo(namespace string, name string) (*AgentInfo, error)
- func (q *KubernetesQuery) AllNodes() ([]NodeInfo, error)
- func (q *KubernetesQuery) AllPods() ([]PodInfo, error)
- func (q *KubernetesQuery) Host() string
- func (q *KubernetesQuery) InstanaLeader() (string, error)
- func (q *KubernetesQuery) ServerVersion() (string, error)
- func (q *KubernetesQuery) Time() time.Time
- type LeaderLease
- type LinkedConfigMap
- type NodeInfo
- type PingerConfig
- type PodInfo
- type Query
- type Resources
- type Set
- type Summary
Constants ¶
const ( // DaemonSet is the related owner key for that type of k8s entity. DaemonSet = "DaemonSet" // ReplicaSet is the related owner key for that type of k8s entity. ReplicaSet = "ReplicaSet" // StatefulSet is the related owner key for that type of k8s entity. StatefulSet = "StatefulSet" )
const ( // DaemonSetName is the resource name for the envchecker daemon set. DaemonSetName = "envchecker" // ManagedBy is the resource managed by identifier. ManagedBy = "envcheckctl" // PingerName is the resource name for the pinger daemon set. PingerName = "pinger" )
const ( // LabelManagedBy is the string for the k8s default managed-by key. LabelManagedBy = "app.kubernetes.io/managed-by" // LabelName is the string for the k8s default name key. LabelName = "app.kubernetes.io/name" // LabelVersion is the string for the k8s default version key. LabelVersion = "app.kubernetes.io/version" )
Variables ¶
var ( // ErrLeaderUndefined is returned when the instana endpoint exists but no leader annotation exists. ErrLeaderUndefined = fmt.Errorf("endpoint found but leader undefined") // ErrInvalidLeaseFormat is returned when the leader annotation does not contain a valid LeaderLease. ErrInvalidLeaseFormat = fmt.Errorf("invalid lease format") )
var Local = v1.ServiceInternalTrafficPolicyLocal
Functions ¶
func Daemon ¶ added in v0.0.4
func Daemon(config DaemonConfig) *appsv1.DaemonSet
Daemon creates the envchecker daemon set resource from the provided DaemonConfig.
func FieldPath ¶ added in v0.0.4
FieldPath returns a single env var based on the given field name and path.
func IsCNIPlugin ¶ added in v0.0.13
func IsInstanaAgent ¶ added in v0.0.13
func PingHost ¶ added in v0.0.6
PingHost outputs the "PINGHOST" env var key value based on host and useGateway.
func Pinger ¶ added in v0.0.4
func Pinger(config PingerConfig) *appsv1.DaemonSet
Pinger creates the pinger DaemonSet resource from the provided PingerConfig.
func ResourceRequirements ¶ added in v0.0.4
func ResourceRequirements(resources Resources) v1.ResourceRequirements
ResourceRequirements builds a kubernetes resource requirements from the provided Resources.
func Service ¶ added in v0.0.12
func Service(config DaemonConfig) *v1.Service
Types ¶
type AgentEvent ¶ added in v0.0.9
AgentEvent represents a single K8S event associated with the agent.
type AgentInfo ¶ added in v0.0.9
type AgentInfo struct { Available int32 Desired int32 EventList []AgentEvent Misscheduled int32 Ready int32 }
AgentInfo provides general information relating to the agent.
type Applyable ¶ added in v0.0.13
Applyable is the interface to receive pod info from a pod collection.
type Command ¶ added in v0.0.4
type Command interface { CreateDaemon(DaemonConfig) error CreatePinger(PingerConfig) error CreateService(DaemonConfig) error }
Command provides an interface for creating envcheck entities in a cluster.
type ContainerInfo ¶
ContainerInfo is summary details for a container.
type DaemonConfig ¶ added in v0.0.4
DaemonConfig is the configuration for the envchecker daemon set.
func (*DaemonConfig) Address ¶ added in v0.0.4
func (dc *DaemonConfig) Address() string
Address provides the combined host and port pair as an address.
type Index ¶
type Index struct { Containers Set DaemonSets Set Deployments Set Namespaces Set Nodes Set Pods Set Running Set StatefulSets Set AgentRestarts Counter AgentStatus Counter ChartVersions Counter CNIPlugins Counter ContainerRuntimes Counter InstanceTypes Counter KernelVersions Counter KubeletVersions Counter LinkedConfigMaps Counter OSImages Counter ProxyVersions Counter Zones Counter PodStatus Counter Owners Counter }
Index provides indexes for a number of the cluster entities.
func NewIndex ¶ added in v0.0.4
func NewIndex() *Index
NewIndex builds a new empty index for PodInfo.
type Info ¶
type Info struct { Name string NodeCount int Nodes []NodeInfo PodCount int Pods []PodInfo ServerVersion string Version string Started time.Time Finished time.Time }
Info is a data structure for relevant cluster data.
type KubernetesCommand ¶ added in v0.0.4
type KubernetesCommand struct { appsv1.AppsV1Interface corev1.CoreV1Interface }
KubernetesCommand is a k8s implementation of the Command interface.
func NewCommand ¶ added in v0.0.4
func NewCommand(kubeconfig string) (*KubernetesCommand, error)
NewCommand allocates and returns a new Command.
func (*KubernetesCommand) CreateDaemon ¶ added in v0.0.4
func (kc *KubernetesCommand) CreateDaemon(config DaemonConfig) error
CreateDaemon creates an envchecker daemonset in the current K8S environment.
func (*KubernetesCommand) CreatePinger ¶ added in v0.0.4
func (kc *KubernetesCommand) CreatePinger(config PingerConfig) error
CreatePinger creates a pinger daemonset in the current K8S environment.
func (*KubernetesCommand) CreateService ¶ added in v0.0.4
func (kc *KubernetesCommand) CreateService(config DaemonConfig) error
CreateService creates an envchecker service in the current K8S environment.
type KubernetesQuery ¶ added in v0.0.3
type KubernetesQuery struct {
// contains filtered or unexported fields
}
KubernetesQuery is a concrete Kubernetes client to query various cluster info.
func New ¶
func New(kubeconfig string) (*KubernetesQuery, error)
New builds a new KubernetesQuery implementation with the given kubeconfig.
func NewQuery ¶ added in v0.0.4
func NewQuery(h string, cs typev1.CoreV1Interface, apps appv1.AppsV1Interface, version func() (*version.Info, error)) *KubernetesQuery
NewQuery allocates and returns a new Query.
func (*KubernetesQuery) AgentInfo ¶ added in v0.0.9
func (q *KubernetesQuery) AgentInfo(namespace string, name string) (*AgentInfo, error)
AgentInfo queries the api-server for details about the Instana agent.
func (*KubernetesQuery) AllNodes ¶ added in v0.0.13
func (q *KubernetesQuery) AllNodes() ([]NodeInfo, error)
func (*KubernetesQuery) AllPods ¶ added in v0.0.3
func (q *KubernetesQuery) AllPods() ([]PodInfo, error)
AllPods retrieves all pod info from the cluster.
func (*KubernetesQuery) Host ¶ added in v0.0.3
func (q *KubernetesQuery) Host() string
Host provides the host info for the cluster.
func (*KubernetesQuery) InstanaLeader ¶ added in v0.0.8
func (q *KubernetesQuery) InstanaLeader() (string, error)
InstanaLeader returns the instana agent leader pod name.
func (*KubernetesQuery) ServerVersion ¶ added in v0.0.16
func (q *KubernetesQuery) ServerVersion() (string, error)
func (*KubernetesQuery) Time ¶ added in v0.0.8
func (q *KubernetesQuery) Time() time.Time
Time returns the current time.
type LeaderLease ¶ added in v0.0.8
type LeaderLease struct {
HolderIdentity string `json:"holderIdentity"`
}
LeaderLease is the lease struct for the leader elector sidecar.
type LinkedConfigMap ¶ added in v0.0.13
type PingerConfig ¶ added in v0.0.4
type PingerConfig struct { Namespace string Image string Version string Host string Port int32 UseGateway bool }
PingerConfig is the input configuration for the pinger DaemonSet.
type PodInfo ¶
type PodInfo struct { Annotations map[string]string `json:",omitempty"` ChartVersion string Containers []ContainerInfo LinkedConfigMaps []LinkedConfigMap Host string IsRunning bool Name string Namespace string Owners map[string]string Restarts int Status string }
PodInfo is summary details for a pod.
type Query ¶ added in v0.0.3
type Query interface { // AllPods returns the list of pods from the related cluster. AllPods() ([]PodInfo, error) AllNodes() ([]NodeInfo, error) Host() string InstanaLeader() (string, error) ServerVersion() (string, error) Time() time.Time }
Query is a query interface for the cluster.
type Resources ¶ added in v0.0.4
Resources is the system resource contraints associated with an entity.