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 ¶
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 ¶
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.