calico

package
v0.0.0-...-0ecbde9 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func K3dCalicoBGPPeeringObjects

func K3dCalicoBGPPeeringObjects(opts K3dCalicoBGPPeeringOptions) map[string][]Object

K3dCalicoBGPPeeringObjects returns the objects needed for connecting k3d clusters via BGP.

func RegisterCalicoGVK

func RegisterCalicoGVK(scheme *runtime.Scheme)

RegisterCalicoGVK is a helper method for adding calico objects returned by this package to the scheme.

Types

type K3dCalicoBGPPeeringOptions

type K3dCalicoBGPPeeringOptions struct {
	ClusterConfig map[string]K3dClusterBGPConfig
}

K3dCalicoBGPPeeringOptions determines how to set up bpg peering among several k3d clusters.

type K3dClusterBGPConfig

type K3dClusterBGPConfig struct {
	// AddressAllocation determines the pod cidr, service cidr, asNumber
	// as follows:
	// PodCIDR: 10.<alloc>.0.0/17
	// ServiceCIDR: 10.<alloc>.128.0/17
	// ASNumber: 64512 + <alloc>
	AddressAllocation int
	PeeringNodes      []string
}

K3dClusterBGPConfig describes the bgp config of a cluster.

func (*K3dClusterBGPConfig) GetASNumber

func (c *K3dClusterBGPConfig) GetASNumber() uint32

GetASNumber returns the AS number for the cluster.

func (*K3dClusterBGPConfig) GetPodCIDR

func (c *K3dClusterBGPConfig) GetPodCIDR() string

GetPodCIDR returns the pod cidr for the cluster.

func (*K3dClusterBGPConfig) GetServiceCIDR

func (c *K3dClusterBGPConfig) GetServiceCIDR() string

GetServiceCIDR returns the service cidr for the cluster.

type Object

type Object interface {
	runtime.Object
	metav1.Object
}

func DecodeYAML

func DecodeYAML(asset string) []Object

DecodeYAML returns decoded Kubernetes YAML manifests from the internal/yaml directory. If asset cannot be found or if asset is invalid YAML, DecodeYAML panics.

func FromRuntime

func FromRuntime(object runtime.Object) (Object, error)

FromRuntime converts a runtime.Object into an Object. This may fail if the input object is an ObjectList.

func K3DCalicoCNI

func K3DCalicoCNI(opts K3dClusterBGPConfig) []Object

K3DCalicoCNI returns objects that can be used for installing calico as the CNI plugin for the k8s cluster. This is *only* intended for use with k3d environment for local development or testing.

Jump to

Keyboard shortcuts

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