Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AutocompleteClusterIdentityTaskID = taskid.NewDefaultImplementationID[*inspectioncore_contract.AutocompleteResult[GoogleCloudClusterIdentity]](GoogleCloudCommonK8STaskIDPrefix + "autocomplete/cluster-names")
AutocompleteClusterIdentityTaskID is the task ID for returning cluster name candidates as AutocompleteClusterNameList.
var AutocompleteLocationForClusterTaskID taskid.TaskImplementationID[*inspectioncore_contract.AutocompleteResult[string]] = taskid.NewImplementationID(googlecloudcommon_contract.AutocompleteLocationTaskID.Ref(), "location-for-k8s-cluster")
AutocompleteLocationForClusterTaskID is the task ID for overriding the default location autocomplete by returning the location of the given cluster.
var AutocompleteMetricsK8sContainerTaskID = taskid.NewDefaultImplementationID[string](GoogleCloudCommonK8STaskIDPrefix + "autocomplete/metrics/k8s_container")
AutocompleteMetricsK8sContainerTaskID is the task ID for returning metrics type returning k8s_container resource type.
var AutocompleteMetricsK8sNodeTaskID = taskid.NewDefaultImplementationID[string](GoogleCloudCommonK8STaskIDPrefix + "autocomplete/metrics/k8s_node")
AutocompleteMetricsK8sNodeTaskID is the task ID for returning metrics type returning k8s_node resource type.
var AutocompleteNamespacesTaskID = taskid.NewDefaultImplementationID[*inspectioncore_contract.AutocompleteResult[string]](GoogleCloudCommonK8STaskIDPrefix + "autocomplete/namespaces")
AutocompleteNamespacesTaskID is the task ID for returning namespace candidates as AutocompleteResult.
var AutocompleteNodeNamesTaskID = taskid.NewDefaultImplementationID[*inspectioncore_contract.AutocompleteResult[string]](GoogleCloudCommonK8STaskIDPrefix + "autocomplete/node-names")
AutocompleteNodeNamesTaskID is the task ID for returning node name candidates as AutocompleteResult.
var AutocompletePodNamesTaskID = taskid.NewDefaultImplementationID[*inspectioncore_contract.AutocompleteResult[string]](GoogleCloudCommonK8STaskIDPrefix + "autocomplete/pod-names")
AutocompletePodNamesTaskID is the task ID for returning pod name candidates as AutocompleteResult.
var ClusterIdentityTaskID = taskid.NewDefaultImplementationID[GoogleCloudClusterIdentity](GoogleCloudCommonK8STaskIDPrefix + "cluster-identity")
ClusterIdentityTaskID is the task ID for getting the cluster identity. Fields are usually from form inputs.
var ClusterNamePrefixTaskRef = taskid.NewTaskReference[ClusterPrefixPolicy](GoogleCloudCommonK8STaskIDPrefix + "cluster-name-prefix")
ClusterNamePrefixTaskRef is the task reference ID for generating the cluster name prefix used in query. For GKE, it's just a task to return empty prefix policy always. For Anthos on AWS, it should return "awsClusters/". For Anthos on Azure, it will be "azureClusters/".
var GoogleCloudCommonK8STaskIDPrefix = "cloud.google.com/k8s/"
GoogleCloudCommonK8STaskIDPrefix is the prefix for common task used for K8s on Google Cloud related tasks IDs.
var HeaderSuggestedFileNameTaskID = taskid.NewDefaultImplementationID[struct{}](GoogleCloudCommonK8STaskIDPrefix + "header-suggested-file-name")
HeaderSuggestedFileNameTaskID is the task ID for the suggested file name of the inspection file included in the header metadata. This name is used for the default name of downloaded file.
var InputClusterNameTaskID = taskid.NewDefaultImplementationID[string](GoogleCloudCommonK8STaskIDPrefix + "input-cluster-name")
InputClusterNameTaskID is the task ID for the cluster name.
var InputKindFilterTaskID = taskid.NewDefaultImplementationID[*queryutil.SetFilterParseResult](GoogleCloudCommonK8STaskIDPrefix + "input-kinds")
InputKindFilterTaskID is the task ID for the kind filter.
var InputNamespaceFilterTaskID = taskid.NewDefaultImplementationID[*queryutil.SetFilterParseResult](GoogleCloudCommonK8STaskIDPrefix + "input-namespaces")
InputNamespaceFilterTaskID is the task ID for the namespace filter.
var InputNodeNameFilterTaskID = taskid.NewDefaultImplementationID[[]string](GoogleCloudCommonK8STaskIDPrefix + "input/node-name-filter")
InputNodeNameFilterTaskID receives space splitted node names to filter node specific logs.
var NEGNamesDiscoveryTaskID = taskid.NewDefaultImplementationID[NEGNameToResourceIdentityMap](GoogleCloudCommonK8STaskIDPrefix + "neg-names-discovery")
NEGNamesDiscoveryTaskID is the task ID for extracting NEG names from audit logs.
var NEGNamesInventoryTaskBuilder = inspectiontaskbase.NewInventoryTaskBuilder(NEGNamesInventoryTaskID)
var NEGNamesInventoryTaskID = taskid.NewDefaultImplementationID[NEGNameToResourceIdentityMap](GoogleCloudCommonK8STaskIDPrefix + "neg-names-inventory")
var NEGToBackendServiceInventoryBuilder = inspectiontaskbase.NewInventoryTaskBuilder(NEGToBackendServiceInventoryTaskID)
NEGToBackendServiceInventoryBuilder is the inventory task builder for NEG to BackendService mappings.
var NEGToBackendServiceInventoryTaskID = taskid.NewDefaultImplementationID[NEGToBackendServiceMap](GoogleCloudCommonK8STaskIDPrefix + "neg-to-backend-service-inventory")
NEGToBackendServiceInventoryTaskID is the task ID for the inventory task that provides NEG to BackendService mappings.
Functions ¶
func ExtractNEGToBackendService ¶ added in v0.54.0
ExtractNEGToBackendService extracts the NEG name and BackendService name from a given message.
Types ¶
type ClusterNameUsage ¶ added in v0.55.2
type ClusterNameUsage string
ClusterNameUsage represents a usage context layer of a cluster name.
const ( // ClusterNameUsageK8sCluster is the usage context for Kubernetes internal common logs. ClusterNameUsageK8sCluster ClusterNameUsage = "k8s_cluster" // ClusterNameUsageK8sPlatformAudit is the usage context for Kubernetes platform management audit logs. ClusterNameUsageK8sPlatformAudit ClusterNameUsage = "k8s_platform_audit" // ClusterNameUsageCSM is the usage context for Cloud Service Mesh logs. ClusterNameUsageCSM ClusterNameUsage = "csm" )
type ClusterPrefixPolicy ¶ added in v0.55.2
type ClusterPrefixPolicy struct {
// Prefix is the single cluster prefix string.
Prefix string
// RequiredUsages represents the list of usages that require the prefix.
RequiredUsages []ClusterNameUsage
}
ClusterPrefixPolicy defines a policy to apply a prefix to a cluster name based on the usage context.
func (ClusterPrefixPolicy) Apply ¶ added in v0.55.2
func (c ClusterPrefixPolicy) Apply(usage ClusterNameUsage, clusterName string) string
Apply applies the prefix to the given cluster name if the usage is listed in RequiredUsages.
func (ClusterPrefixPolicy) PrefixFor ¶ added in v0.55.2
func (c ClusterPrefixPolicy) PrefixFor(usage ClusterNameUsage) string
PrefixFor returns the prefix for the given usage context if the usage is listed in RequiredUsages.
type GoogleCloudClusterIdentity ¶ added in v0.52.0
type GoogleCloudClusterIdentity struct {
// ProjectID is the project ID of the cluster.
ProjectID string
// PrefixPolicy is the prefix policy applied to the cluster name.
PrefixPolicy ClusterPrefixPolicy
// ClusterName is the name of the cluster.
ClusterName string
// Location is the location of the cluster.
Location string
}
GoogleCloudClusterIdentity is the tuple identify a cluster in Google Cloud.
func (*GoogleCloudClusterIdentity) NameFor ¶ added in v0.55.2
func (g *GoogleCloudClusterIdentity) NameFor(usage ClusterNameUsage) string
NameFor returns the cluster name representation for the given usage context.
func (*GoogleCloudClusterIdentity) PrefixFor ¶ added in v0.55.2
func (g *GoogleCloudClusterIdentity) PrefixFor(usage ClusterNameUsage) string
PrefixFor returns the cluster prefix for the given usage context.
func (*GoogleCloudClusterIdentity) UniqueDigest ¶ added in v0.52.0
func (g *GoogleCloudClusterIdentity) UniqueDigest() string
UniqueDigest returns an unique string for the cluster identity. This can be used as the cache key depending on a cluster.
type NEGNameToResourceIdentityMap ¶ added in v0.50.0
type NEGNameToResourceIdentityMap = map[string]commonlogk8saudit_contract.ResourceIdentity
type NEGToBackendServiceMap ¶ added in v0.54.0
NEGToBackendServiceMap is a map from NEG name to BackendService name.