inspect

package
v0.0.0-...-fb71679 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package inspect implements inspector functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClusterInfo

type ClusterInfo struct {
	Clusters []struct {
		Cluster struct {
			Server string `yaml:"server"`
		} `yaml:"cluster"`
	} `yaml:"clusters"`
}

ClusterInfo contains information about the cluster.

type Inspector

type Inspector struct {
	K8sClientset kubernetes.Interface
	Context      context.Context
}

Inspector contains the inspect settings.

func (*Inspector) GetControlPlaneHostname

func (i *Inspector) GetControlPlaneHostname() (string, error)

GetControlPlaneHostname checks the tkg-metadata ConfigMap and returns the hostname of control plane Return the IP address or the hostname of the control plane

func (*Inspector) GetServiceEndpoint

func (i *Inspector) GetServiceEndpoint(namespace, name string) (string, error)

GetServiceEndpoint takes the service name and namespace to construct the correct service endpoint Return external accessible service endpoint

func (Inspector) GetTKGMetadata

func (i Inspector) GetTKGMetadata() (*TKGMetadata, error)

GetTKGMetadata reads the data from tkg-metadata ConfigMap Note: The tkg-metadata will not get updated as today if user has some day2 configurations against the cluster. That means some mutable fields will have stale data. Use this function with caution when the data you want to read could be updated by user

type TKGMetadata

type TKGMetadata struct {
	/*
		The configmap contains the metadata like the following, but we only care about type and provider
		metadata.yaml: |
			cluster:
		      name: tkg-cluster-wc-765
		      type: workload
		      plan: dev
		      kubernetesProvider: VMware Tanzu Kubernetes Grid
		      tkgVersion: 1.2.1
		      infrastructure:
		        provider: vsphere
		    bom:
		      configmapRef:
		        name: tkg-bom
	*/
	Cluster TKGMetadataCluster `yaml:"cluster"`
}

TKGMetadata contains Tanzu Kubernetes Grid metadata.

type TKGMetadataCluster

type TKGMetadataCluster struct {
	Name           string `yaml:"name"`
	Type           string `yaml:"type"`
	Infrastructure struct {
		Provider string `yaml:"provider"`
	} `yaml:"infrastructure"`
}

Jump to

Keyboard shortcuts

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