Documentation ¶
Index ¶
- Constants
- func ConvertK8sResourceToCalicoResource(res Resource) error
- func K8sErrorToCalico(ke error, id interface{}) error
- func K8sNodeToCalico(k8sNode *kapiv1.Node) (*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 NewNodeClient(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" )
Variables ¶
This section is empty.
Functions ¶
func ConvertK8sResourceToCalicoResource ¶ added in v1.7.4
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 ¶ added in v1.2.0
K8sNodeToCalico converts a Kubernetes format node, with Calico annotations, to a Calico Node.
func SetCalicoMetadataFromK8sAnnotations ¶ added in v1.7.4
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 ¶ added in v1.7.4
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 ¶ added in v1.7.4
Function signature for conversion function to convert a K8s resouce to a KVPair equivalent.
type IPPoolv1v3Converter ¶ added in v1.7.4
type IPPoolv1v3Converter struct{}
IPPoolv1v3Converter implements VersionConverter interface.
func (IPPoolv1v3Converter) ConvertFromK8s ¶ added in v1.7.4
func (c IPPoolv1v3Converter) ConvertFromK8s(inRes Resource) (Resource, error)
ConvertFromK8s converts v1 IPPool Resource to v3 IPPool resource
type K8sNodeResourceClient ¶ added in v1.5.0
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 ¶ added in v1.5.0
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 ¶ added in v1.7.4
func NewBGPConfigClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewBGPPeerClient ¶ added in v1.7.4
func NewBGPPeerClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewBlockAffinityClient ¶ added in v1.7.4
func NewBlockAffinityClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewClusterInfoClient ¶ added in v1.7.4
func NewClusterInfoClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewFelixConfigClient ¶ added in v1.7.4
func NewFelixConfigClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewGlobalNetworkPolicyClient ¶ added in v1.6.0
func NewGlobalNetworkPolicyClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewGlobalNetworkSetClient ¶ added in v1.7.4
func NewGlobalNetworkSetClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewHostEndpointClient ¶ added in v1.7.4
func NewHostEndpointClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewIPAMBlockClient ¶ added in v1.7.4
func NewIPAMBlockClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewIPAMConfigClient ¶ added in v1.7.4
func NewIPAMConfigClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewIPAMHandleClient ¶ added in v1.7.4
func NewIPAMHandleClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewIPPoolClient ¶ added in v1.5.0
func NewIPPoolClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewNetworkPolicyClient ¶ added in v1.7.4
func NewNetworkPolicyClient(c *kubernetes.Clientset, r *rest.RESTClient) K8sResourceClient
func NewNodeClient ¶ added in v1.2.0
func NewNodeClient(c *kubernetes.Clientset) K8sResourceClient
func NewProfileClient ¶ added in v1.7.4
func NewProfileClient(c *kubernetes.Clientset) K8sResourceClient
func NewWorkloadEndpointClient ¶ added in v1.7.4
func NewWorkloadEndpointClient(c *kubernetes.Clientset) K8sResourceClient
type Resource ¶ added in v1.7.4
type Resource interface { runtime.Object metav1.ObjectMetaAccessor }
Interface that all Kubernetes and Calico resources implement.
func ConvertCalicoResourceToK8sResource ¶ added in v1.7.4
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 ¶ added in v1.7.4
type ResourceList interface { runtime.Object metav1.ListMetaAccessor }
Interface that all Kubernetes and Calico resource lists implement.
type VersionConverter ¶ added in v1.7.4
VersionConverter converts v1 or v3 k8s resources into v3 resources. For a v3 resource, the conversion should be a no-op.
type WorkloadEndpointClient ¶ added in v1.7.4
type WorkloadEndpointClient struct {
// contains filtered or unexported fields
}
Implements the api.Client interface for WorkloadEndpoints.
func (*WorkloadEndpointClient) EnsureInitialized ¶ added in v1.7.4
func (c *WorkloadEndpointClient) EnsureInitialized() error
func (*WorkloadEndpointClient) List ¶ added in v1.7.4
func (c *WorkloadEndpointClient) List(ctx context.Context, list model.ListInterface, revision string) (*model.KVPairList, error)
func (*WorkloadEndpointClient) Watch ¶ added in v1.7.4
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_config.go
- ipam_handle.go
- ippool.go
- networkpolicy.go
- node.go
- profile.go
- resources.go
- watcher.go
- workloadendpoint.go