k8s

package
v1.14.0-snapshot.6 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ResourcesCell provides a set of handles to Kubernetes resources used throughout the
	// agent. Each of the resources share a client-go informer and backing store so we only
	// have one watch API call for each resource kind and that we maintain only one copy of each object.
	//
	// See pkg/k8s/resource/resource.go for documentation on the Resource[T] type.
	ResourcesCell = cell.Module(
		"k8s-resources",
		"Agent Kubernetes resources",

		cell.Provide(
			k8s.ServiceResource,
			k8s.EndpointsResource,

			func(lc hive.Lifecycle, cs client.Clientset) (LocalNodeResource, error) {
				return k8s.NodeResource(
					lc, cs,
					func(opts *metav1.ListOptions) {
						opts.FieldSelector = fields.ParseSelectorOrDie("metadata.name=" + nodeTypes.GetName()).String()
					},
				)
			},
			func(lc hive.Lifecycle, cs client.Clientset) (LocalCiliumNodeResource, error) {
				return k8s.CiliumNodeResource(
					lc, cs,
					func(opts *metav1.ListOptions) {
						opts.FieldSelector = fields.ParseSelectorOrDie("metadata.name=" + nodeTypes.GetName()).String()
					},
				)
			},
			func(lc hive.Lifecycle, cs client.Clientset) (LocalPodResource, error) {
				return k8s.PodResource(
					lc, cs,
					func(opts *metav1.ListOptions) {
						opts.FieldSelector = fields.ParseSelectorOrDie("spec.nodeName=" + nodeTypes.GetName()).String()
					},
				)
			},
			k8s.NamespaceResource,
			k8s.CiliumNetworkPolicyResource,
			k8s.CiliumClusterwideNetworkPolicyResource,
			k8s.CiliumCIDRGroupResource,
		),
	)
)

Functions

This section is empty.

Types

type LocalCiliumNodeResource

type LocalCiliumNodeResource resource.Resource[*cilium_api_v2.CiliumNode]

LocalCiliumNodeResource is a resource.Resource[*cilium_api_v2.Node] but one which will only stream updates for the CiliumNode object associated with the node we are currently running on.

type LocalNodeResource

type LocalNodeResource resource.Resource[*slim_corev1.Node]

LocalNodeResource is a resource.Resource[*corev1.Node] but one which will only stream updates for the node object associated with the node we are currently running on.

type LocalPodResource

type LocalPodResource resource.Resource[*slim_corev1.Pod]

LocalPodResource is a resource.Resource[*slim_corev1.Pod] but one which will only stream updates for pod objects scheduled on the node we are currently running on.

type Resources

Resources is a convenience struct to group all the agent k8s resources as cell constructor parameters.

Jump to

Keyboard shortcuts

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