Documentation ¶
Index ¶
- Constants
- func ConvertK8sResourceToCalicoResource(res Resource) error
- func K8sErrorToCalico(ke error, id interface{}) error
- func K8sNodeToCalico(k8sNode *kapiv1.Node, usePodCIDR bool) (*model.KVPair, error)
- func SetCalicoMetadataFromK8sAnnotations(calicoRes Resource, k8sRes Resource)
- func SetK8sAnnotationsFromCalicoMetadata(k8sRes Resource, calicoRes Resource)
- type ConvertK8sResourceToKVPair
- type IPPoolv1v3Converter
- type K8sNodeResourceClient
- type K8sResourceClient
- func NewBGPConfigClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewBGPPeerClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewBlockAffinityClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewClusterInfoClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewFelixConfigClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewGlobalNetworkPolicyClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewGlobalNetworkSetClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewHostEndpointClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewIPAMBlockClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewIPAMConfigClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewIPAMHandleClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewIPPoolClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewNetworkPolicyClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewNetworkSetClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
- func NewNodeClient(c *kubernetes.Clientset, usePodCIDR bool) K8sResourceClient
- func NewPodCIDRBlockAffinityClient(c *kubernetes.Clientset) K8sResourceClient
- func NewProfileClient(c *kubernetes.Clientset) K8sResourceClient
- func NewWorkloadEndpointClient(c *kubernetes.Clientset) K8sResourceClient
- type Resource
- type ResourceList
- type VersionConverter
- type WorkloadEndpointClient
- func (c *WorkloadEndpointClient) Create(ctx context.Context, kvp *model.KVPair) (*model.KVPair, error)
- func (c *WorkloadEndpointClient) Delete(ctx context.Context, key model.Key, revision string, uid *types.UID) (*model.KVPair, error)
- func (c *WorkloadEndpointClient) DeleteKVP(ctx context.Context, kvp *model.KVPair) (*model.KVPair, error)
- func (c *WorkloadEndpointClient) EnsureInitialized() error
- func (c *WorkloadEndpointClient) Get(ctx context.Context, key model.Key, revision string) (*model.KVPair, error)
- func (c *WorkloadEndpointClient) List(ctx context.Context, list model.ListInterface, revision string) (*model.KVPairList, error)
- func (c *WorkloadEndpointClient) Update(ctx context.Context, kvp *model.KVPair) (*model.KVPair, error)
- func (c *WorkloadEndpointClient) Watch(ctx context.Context, list model.ListInterface, revision string) (api.WatchInterface, error)
Constants ¶
const ( BGPConfigResourceName = "BGPConfigurations" BGPConfigCRDName = "bgpconfigurations.crd.projectcalico.org" )
const ( BGPPeerResourceName = "BGPPeers" BGPPeerCRDName = "bgppeers.crd.projectcalico.org" )
const ( ClusterInfoResourceName = "ClusterInformations" ClusterInfoCRDName = "clusterinformations.crd.projectcalico.org" )
const ( FelixConfigResourceName = "FelixConfigurations" FelixConfigCRDName = "felixconfigurations.crd.projectcalico.org" )
const ( GlobalNetworkPolicyResourceName = "GlobalNetworkPolicies" GlobalNetworkPolicyCRDName = "globalnetworkpolicies.crd.projectcalico.org" )
const ( GlobalNetworkSetResourceName = "GlobalNetworkSets" GlobalNetworkSetCRDName = "globalnetworksets.crd.projectcalico.org" )
const ( HostEndpointResourceName = "HostEndpoints" HostEndpointCRDName = "hostendpoints.crd.projectcalico.org" )
const ( BlockAffinityResourceName = "BlockAffinities" BlockAffinityCRDName = "blockaffinities.crd.projectcalico.org" )
const ( IPAMBlockResourceName = "IPAMBlocks" IPAMBlockCRDName = "ipamblocks.crd.projectcalico.org" )
const ( IPAMConfigResourceName = "IPAMConfigs" IPAMConfigCRDName = "ipamconfigs.crd.projectcalico.org" )
const ( IPAMHandleResourceName = "IPAMHandles" IPAMHandleCRDName = "ipamhandles.crd.projectcalico.org" )
const ( IPPoolResourceName = "IPPools" IPPoolCRDName = "ippools.crd.projectcalico.org" )
const ( NetworkPolicyResourceName = "NetworkPolicies" NetworkPolicyCRDName = "networkpolicies.crd.projectcalico.org" )
const ( NetworkSetResourceName = "NetworkSets" NetworkSetCRDName = "networksets.crd.projectcalico.org" )
Variables ¶
This section is empty.
Functions ¶
func ConvertK8sResourceToCalicoResource ¶
Retrieve all of the Calico Metadata from the k8s resource annotations for CRD backed resources. This should remove the relevant Calico Metadata annotation when it has finished.
func K8sErrorToCalico ¶
K8sErrorToCalico returns the equivalent libcalico error for the given kubernetes error.
func K8sNodeToCalico ¶
K8sNodeToCalico converts a Kubernetes format node, with Calico annotations, to a Calico Node.
func SetCalicoMetadataFromK8sAnnotations ¶
Extract the Calico resource Metadata from the k8s resource annotations for non-CRD backed resources. This extracts the Annotations and Labels stored as a annotation, and fills in the CreationTimestamp and UID from the k8s resource.
func SetK8sAnnotationsFromCalicoMetadata ¶
Store Calico Metadata in the k8s resource annotations for non-CRD backed resources. Currently this just stores Annotations and Labels and drops all other metadata attributes.
Types ¶
type ConvertK8sResourceToKVPair ¶
Function signature for conversion function to convert a K8s resouce to a KVPair equivalent.
type IPPoolv1v3Converter ¶
type IPPoolv1v3Converter struct{}
IPPoolv1v3Converter implements VersionConverter interface.
func (IPPoolv1v3Converter) ConvertFromK8s ¶
func (c IPPoolv1v3Converter) ConvertFromK8s(inRes Resource) (Resource, error)
ConvertFromK8s converts v1 IPPool Resource to v3 IPPool resource
type K8sNodeResourceClient ¶
type K8sNodeResourceClient interface { K8sResourceClient ExtractResourcesFromNode(node *apiv1.Node) ([]*model.KVPair, error) }
K8sNodeResourceClient extends the K8sResourceClient to add a helper method to extract resources from the supplied K8s Node. This convenience interface is expected to be removed in a future libcalico-go release.
type K8sResourceClient ¶
type K8sResourceClient interface { // Create creates the object specified in the KVPair, which must not // already exist. On success, returns a KVPair for the object with // revision information filled-in. Create(ctx context.Context, object *model.KVPair) (*model.KVPair, error) // Update modifies the existing object specified in the KVPair. // On success, returns a KVPair for the object with revision // information filled-in. If the input KVPair has revision // information then the update only succeeds if the revision is still // current. Update(ctx context.Context, object *model.KVPair) (*model.KVPair, error) // Delete removes the object specified by the Key. If the call // contains revision information, the delete only succeeds if the // revision is still current. Delete(ctx context.Context, key model.Key, revision string, uid *types.UID) (*model.KVPair, error) // DeleteKVP removes the object specified by the KVPair. If the KVPair // contains revision information, the delete only succeeds if the // revision is still current. DeleteKVP(ctx context.Context, object *model.KVPair) (*model.KVPair, error) // Get returns the object identified by the given key as a KVPair with // revision information. Get(ctx context.Context, key model.Key, revision string) (*model.KVPair, error) // List returns a slice of KVPairs matching the input list options. // list should be passed one of the model.<Type>ListOptions structs. // Non-zero fields in the struct are used as filters. List(ctx context.Context, list model.ListInterface, revision string) (*model.KVPairList, error) // Watch returns a WatchInterface used for watching resources matching the // input list options. Watch(ctx context.Context, list model.ListInterface, revision string) (api.WatchInterface, error) // EnsureInitialized ensures that the backend is initialized // any ready to be used. EnsureInitialized() error }
K8sResourceClient is the interface to the k8s datastore for CRUD operations on an individual resource (one for each of the *model* types supported by the K8s backend).
Defining a separate client interface from api.Client allows the k8s-specific client to diverge.
func NewBGPConfigClient ¶
func NewBGPConfigClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewBGPPeerClient ¶
func NewBGPPeerClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewBlockAffinityClient ¶
func NewBlockAffinityClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewClusterInfoClient ¶
func NewClusterInfoClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewFelixConfigClient ¶
func NewFelixConfigClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewGlobalNetworkPolicyClient ¶
func NewGlobalNetworkPolicyClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewGlobalNetworkSetClient ¶
func NewGlobalNetworkSetClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewHostEndpointClient ¶
func NewHostEndpointClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewIPAMBlockClient ¶
func NewIPAMBlockClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewIPAMConfigClient ¶
func NewIPAMConfigClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewIPAMHandleClient ¶
func NewIPAMHandleClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewIPPoolClient ¶
func NewIPPoolClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewNetworkPolicyClient ¶
func NewNetworkPolicyClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewNetworkSetClient ¶
func NewNetworkSetClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewNodeClient ¶
func NewNodeClient(c *kubernetes.Clientset, usePodCIDR bool) K8sResourceClient
func NewPodCIDRBlockAffinityClient ¶
func NewPodCIDRBlockAffinityClient(c *kubernetes.Clientset) K8sResourceClient
func NewProfileClient ¶
func NewProfileClient(c *kubernetes.Clientset) K8sResourceClient
func NewWorkloadEndpointClient ¶
func NewWorkloadEndpointClient(c *kubernetes.Clientset) K8sResourceClient
type Resource ¶
type Resource interface { runtime.Object metav1.ObjectMetaAccessor }
Interface that all Kubernetes and Calico resources implement.
func ConvertCalicoResourceToK8sResource ¶
Store Calico Metadata in the in the k8s resource annotations for CRD backed resources. This should store all Metadata except for those stored in Annotations and Labels and store them in annotations.
type ResourceList ¶
type ResourceList interface { runtime.Object metav1.ListMetaAccessor }
Interface that all Kubernetes and Calico resource lists implement.
type VersionConverter ¶
VersionConverter converts v1 or v3 k8s resources into v3 resources. For a v3 resource, the conversion should be a no-op.
type WorkloadEndpointClient ¶
type WorkloadEndpointClient struct {
// contains filtered or unexported fields
}
Implements the api.Client interface for WorkloadEndpoints.
func (*WorkloadEndpointClient) EnsureInitialized ¶
func (c *WorkloadEndpointClient) EnsureInitialized() error
func (*WorkloadEndpointClient) List ¶
func (c *WorkloadEndpointClient) List(ctx context.Context, list model.ListInterface, revision string) (*model.KVPairList, error)
func (*WorkloadEndpointClient) Watch ¶
func (c *WorkloadEndpointClient) Watch(ctx context.Context, list model.ListInterface, revision string) (api.WatchInterface, error)
Source Files ¶
- bgpconfig.go
- bgppeer.go
- client.go
- clusterinfo.go
- customresource.go
- errors.go
- felixconfig.go
- globalnetworkpolicies.go
- globalnetworkset.go
- hostendpoint.go
- ipam_affinity.go
- ipam_block.go
- ipam_block_pod_cidr.go
- ipam_config.go
- ipam_handle.go
- ippool.go
- networkpolicy.go
- networkset.go
- node.go
- profile.go
- resources.go
- watcher.go
- workloadendpoint.go