Documentation ¶
Overview ¶
Copyright (c) 2020 Tigera, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2021 Tigera, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2019 Tigera, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2017-2020 Tigera, Ic. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright (c) 2017-2020 Tigera, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- func NewAutoHEPController(c config.NodeControllerConfig, client client.Interface) *autoHostEndpointController
- func NewIPAMController(cfg config.NodeControllerConfig, c client.Interface, cs kubernetes.Interface, ...) *ipamController
- func NewNodeController(ctx context.Context, k8sClientset *kubernetes.Clientset, ...) controller.Controller
- func NewNodeDeletionController(client client.Interface, cs *kubernetes.Clientset) *nodeDeleter
- func NewNodeLabelController(c client.Interface) *nodeLabelController
- type DataFeed
- type ErrorNotKubernetes
- type FakeCalicoClient
- func (f *FakeCalicoClient) BGPConfigurations() clientv3.BGPConfigurationInterface
- func (f *FakeCalicoClient) BGPFilter() clientv3.BGPFilterInterface
- func (f *FakeCalicoClient) BGPPeers() clientv3.BGPPeerInterface
- func (f *FakeCalicoClient) Backend() bapi.Client
- func (f *FakeCalicoClient) BlockAffinities() clientv3.BlockAffinityInterface
- func (f *FakeCalicoClient) CalicoNodeStatus() clientv3.CalicoNodeStatusInterface
- func (f *FakeCalicoClient) ClusterInformation() clientv3.ClusterInformationInterface
- func (f *FakeCalicoClient) EnsureInitialized(ctx context.Context, calicoVersion string, clusterType string) error
- func (f *FakeCalicoClient) FelixConfigurations() clientv3.FelixConfigurationInterface
- func (f *FakeCalicoClient) GlobalNetworkPolicies() clientv3.GlobalNetworkPolicyInterface
- func (f *FakeCalicoClient) GlobalNetworkSets() clientv3.GlobalNetworkSetInterface
- func (f *FakeCalicoClient) HostEndpoints() clientv3.HostEndpointInterface
- func (f *FakeCalicoClient) IPAM() ipam.Interface
- func (f *FakeCalicoClient) IPAMConfig() clientv3.IPAMConfigInterface
- func (f *FakeCalicoClient) IPPools() clientv3.IPPoolInterface
- func (f *FakeCalicoClient) IPReservations() clientv3.IPReservationInterface
- func (f *FakeCalicoClient) KubeControllersConfiguration() clientv3.KubeControllersConfigurationInterface
- func (f *FakeCalicoClient) NetworkPolicies() clientv3.NetworkPolicyInterface
- func (f *FakeCalicoClient) NetworkSets() clientv3.NetworkSetInterface
- func (f *FakeCalicoClient) Nodes() clientv3.NodeInterface
- func (f *FakeCalicoClient) Profiles() clientv3.ProfileInterface
- func (f *FakeCalicoClient) WorkloadEndpoints() clientv3.WorkloadEndpointInterface
- type NodeController
- type StatusHandler
- type UpdateHandler
Constants ¶
const ( RateLimitK8s = "k8s" RateLimitCalicoCreate = "calico-create" RateLimitCalicoList = "calico-list" RateLimitCalicoUpdate = "calico-update" RateLimitCalicoDelete = "calico-delete" )
Variables ¶
This section is empty.
Functions ¶
func NewAutoHEPController ¶
func NewAutoHEPController(c config.NodeControllerConfig, client client.Interface) *autoHostEndpointController
func NewIPAMController ¶
func NewIPAMController(cfg config.NodeControllerConfig, c client.Interface, cs kubernetes.Interface, pi, ni cache.Indexer) *ipamController
func NewNodeController ¶
func NewNodeController(ctx context.Context, k8sClientset *kubernetes.Clientset, calicoClient client.Interface, cfg config.NodeControllerConfig, nodeInformer, podInformer cache.SharedIndexInformer) controller.Controller
NewNodeController Constructor for NodeController
func NewNodeDeletionController ¶
func NewNodeDeletionController(client client.Interface, cs *kubernetes.Clientset) *nodeDeleter
NewNodeDeletionController creates a new controller responsible for garbage collection Calico node objects in etcd mode when their corresponding Kubernetes node is deleted.
func NewNodeLabelController ¶
Types ¶
type DataFeed ¶
type DataFeed struct {
// contains filtered or unexported fields
}
func NewDataFeed ¶
func (*DataFeed) OnStatusUpdated ¶
func (d *DataFeed) OnStatusUpdated(status bapi.SyncStatus)
func (*DataFeed) RegisterForNotification ¶
func (d *DataFeed) RegisterForNotification(key model.Key, h UpdateHandler)
RegisterForNotification registers a channel to receive an update when the given kind receives an update. kind should be a pointer to the struct type received over the syncer.
func (*DataFeed) RegisterForSyncStatus ¶
func (d *DataFeed) RegisterForSyncStatus(h StatusHandler)
type ErrorNotKubernetes ¶
type ErrorNotKubernetes struct {
// contains filtered or unexported fields
}
func (*ErrorNotKubernetes) Error ¶
func (e *ErrorNotKubernetes) Error() string
type FakeCalicoClient ¶
type FakeCalicoClient struct {
// contains filtered or unexported fields
}
FakeCalicoClient is a fake client for use in the IPAM tests.
func NewFakeCalicoClient ¶
func NewFakeCalicoClient() *FakeCalicoClient
func (*FakeCalicoClient) BGPConfigurations ¶
func (f *FakeCalicoClient) BGPConfigurations() clientv3.BGPConfigurationInterface
BGPConfigurations returns an interface for managing the BGP configuration resources.
func (*FakeCalicoClient) BGPFilter ¶
func (f *FakeCalicoClient) BGPFilter() clientv3.BGPFilterInterface
BGPFilter returns an interface for managing BGPFilter resources.
func (*FakeCalicoClient) BGPPeers ¶
func (f *FakeCalicoClient) BGPPeers() clientv3.BGPPeerInterface
BGPPeers returns an interface for managing BGP peer resources.
func (*FakeCalicoClient) Backend ¶
func (f *FakeCalicoClient) Backend() bapi.Client
func (*FakeCalicoClient) BlockAffinities ¶
func (f *FakeCalicoClient) BlockAffinities() clientv3.BlockAffinityInterface
func (*FakeCalicoClient) CalicoNodeStatus ¶
func (f *FakeCalicoClient) CalicoNodeStatus() clientv3.CalicoNodeStatusInterface
func (*FakeCalicoClient) ClusterInformation ¶
func (f *FakeCalicoClient) ClusterInformation() clientv3.ClusterInformationInterface
ClusterInformation returns an interface for managing the cluster information resource.
func (*FakeCalicoClient) EnsureInitialized ¶
func (f *FakeCalicoClient) EnsureInitialized(ctx context.Context, calicoVersion string, clusterType string) error
EnsureInitialized is used to ensure the backend datastore is correctly initialized for use by Calico. This method may be called multiple times, and will have no effect if the datastore is already correctly initialized. Most Calico deployment scenarios will automatically implicitly invoke this method and so a general consumer of this API can assume that the datastore is already initialized.
func (*FakeCalicoClient) FelixConfigurations ¶
func (f *FakeCalicoClient) FelixConfigurations() clientv3.FelixConfigurationInterface
FelixConfigurations returns an interface for managing the Felix configuration resources.
func (*FakeCalicoClient) GlobalNetworkPolicies ¶
func (f *FakeCalicoClient) GlobalNetworkPolicies() clientv3.GlobalNetworkPolicyInterface
GlobalNetworkPolicies returns an interface for managing global network policy resources.
func (*FakeCalicoClient) GlobalNetworkSets ¶
func (f *FakeCalicoClient) GlobalNetworkSets() clientv3.GlobalNetworkSetInterface
GlobalNetworkSets returns an interface for managing global network sets resources.
func (*FakeCalicoClient) HostEndpoints ¶
func (f *FakeCalicoClient) HostEndpoints() clientv3.HostEndpointInterface
HostEndpoints returns an interface for managing host endpoint resources.
func (*FakeCalicoClient) IPAM ¶
func (f *FakeCalicoClient) IPAM() ipam.Interface
IPAM returns an interface for managing IP address assignment and releasing.
func (*FakeCalicoClient) IPAMConfig ¶
func (f *FakeCalicoClient) IPAMConfig() clientv3.IPAMConfigInterface
func (*FakeCalicoClient) IPPools ¶
func (f *FakeCalicoClient) IPPools() clientv3.IPPoolInterface
IPPools returns an interface for managing IP pool resources.
func (*FakeCalicoClient) IPReservations ¶
func (f *FakeCalicoClient) IPReservations() clientv3.IPReservationInterface
func (*FakeCalicoClient) KubeControllersConfiguration ¶
func (f *FakeCalicoClient) KubeControllersConfiguration() clientv3.KubeControllersConfigurationInterface
KubeControllersConfiguration returns an interface for managing the KubeControllersConfiguration resource.
func (*FakeCalicoClient) NetworkPolicies ¶
func (f *FakeCalicoClient) NetworkPolicies() clientv3.NetworkPolicyInterface
NetworkPolicies returns an interface for managing namespaced network policy resources.
func (*FakeCalicoClient) NetworkSets ¶
func (f *FakeCalicoClient) NetworkSets() clientv3.NetworkSetInterface
NetworkSets returns an interface for managing network sets resources.
func (*FakeCalicoClient) Nodes ¶
func (f *FakeCalicoClient) Nodes() clientv3.NodeInterface
Nodes returns an interface for managing node resources.
func (*FakeCalicoClient) Profiles ¶
func (f *FakeCalicoClient) Profiles() clientv3.ProfileInterface
Profiles returns an interface for managing profile resources.
func (*FakeCalicoClient) WorkloadEndpoints ¶
func (f *FakeCalicoClient) WorkloadEndpoints() clientv3.WorkloadEndpointInterface
WorkloadEndpoints returns an interface for managing workload endpoint resources.
type NodeController ¶
type NodeController struct {
// contains filtered or unexported fields
}
NodeController implements the Controller interface. It is responsible for monitoring kubernetes nodes and responding to delete events by removing them from the Calico datastore.
func (*NodeController) Run ¶
func (c *NodeController) Run(stopCh chan struct{})
Run starts the node controller. It does start-of-day preparation and then launches worker threads.
type StatusHandler ¶
type StatusHandler func(bapi.SyncStatus)