Documentation ¶
Index ¶
- type Annotator
- type Interface
- type InterfaceOVN
- type Kube
- func (k *Kube) Events() kv1core.EventInterface
- func (k *Kube) GetAnnotationsOnPod(namespace, name string) (map[string]string, error)
- func (k *Kube) GetNamespaces(labelSelector metav1.LabelSelector) ([]*kapi.Namespace, error)
- func (k *Kube) GetNode(name string) (*kapi.Node, error)
- func (k *Kube) GetNodes() ([]*kapi.Node, error)
- func (k *Kube) GetPod(namespace, name string) (*kapi.Pod, error)
- func (k *Kube) GetPods(namespace string, opts metav1.ListOptions) ([]*kapi.Pod, error)
- func (k *Kube) PatchNode(old, new *kapi.Node) error
- func (k *Kube) RemoveTaintFromNode(nodeName string, taint *kapi.Taint) error
- func (k *Kube) SetAnnotationsOnNamespace(namespaceName string, annotations map[string]interface{}) error
- func (k *Kube) SetAnnotationsOnNode(nodeName string, annotations map[string]interface{}) error
- func (k *Kube) SetAnnotationsOnPod(namespace, podName string, annotations map[string]interface{}) error
- func (k *Kube) SetAnnotationsOnService(namespace, name string, annotations map[string]interface{}) error
- func (k *Kube) SetLabelsOnNode(nodeName string, labels map[string]interface{}) error
- func (k *Kube) SetTaintOnNode(nodeName string, taint *kapi.Taint) error
- func (k *Kube) UpdateNodeStatus(node *kapi.Node) error
- func (k *Kube) UpdatePodStatus(pod *kapi.Pod) error
- type KubeOVN
- func (k *KubeOVN) CreateCloudPrivateIPConfig(cloudPrivateIPConfig *ocpcloudnetworkapi.CloudPrivateIPConfig) (*ocpcloudnetworkapi.CloudPrivateIPConfig, error)
- func (k *KubeOVN) DeleteCloudPrivateIPConfig(name string) error
- func (k *KubeOVN) GetEgressFirewalls() ([]*egressfirewall.EgressFirewall, error)
- func (k *KubeOVN) GetEgressIP(name string) (*egressipv1.EgressIP, error)
- func (k *KubeOVN) GetEgressIPs() ([]*egressipv1.EgressIP, error)
- func (k *KubeOVN) PatchEgressIP(name string, patchData []byte) error
- func (k *KubeOVN) UpdateCloudPrivateIPConfig(cloudPrivateIPConfig *ocpcloudnetworkapi.CloudPrivateIPConfig) (*ocpcloudnetworkapi.CloudPrivateIPConfig, error)
- func (k *KubeOVN) UpdateEgressFirewall(egressfirewall *egressfirewall.EgressFirewall) error
- func (k *KubeOVN) UpdateEgressIP(eIP *egressipv1.EgressIP) error
- func (k *KubeOVN) UpdateEgressServiceStatus(namespace, name, host string) error
- func (k *KubeOVN) UpdateIPAMClaimIPs(updatedIPAMClaim *ipamclaimsapi.IPAMClaim) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Annotator ¶
type Annotator interface { Set(key string, value interface{}) error Delete(key string) Run() error }
Annotator represents the exported methods for handling node annotations Implementations should enforce thread safety on the declared methods
func NewNamespaceAnnotator ¶
NewNamespaceAnnotator returns a new annotator for Namespace objects
func NewNodeAnnotator ¶
NewNodeAnnotator returns a new annotator for Node objects
type Interface ¶
type Interface interface { SetAnnotationsOnPod(namespace, podName string, annotations map[string]interface{}) error SetAnnotationsOnService(namespace, serviceName string, annotations map[string]interface{}) error SetAnnotationsOnNode(nodeName string, annotations map[string]interface{}) error SetAnnotationsOnNamespace(namespaceName string, annotations map[string]interface{}) error SetTaintOnNode(nodeName string, taint *kapi.Taint) error RemoveTaintFromNode(nodeName string, taint *kapi.Taint) error SetLabelsOnNode(nodeName string, labels map[string]interface{}) error PatchNode(old, new *kapi.Node) error UpdateNodeStatus(node *kapi.Node) error UpdatePodStatus(pod *kapi.Pod) error GetAnnotationsOnPod(namespace, name string) (map[string]string, error) GetNodes() ([]*kapi.Node, error) GetNamespaces(labelSelector metav1.LabelSelector) ([]*kapi.Namespace, error) GetPods(namespace string, opts metav1.ListOptions) ([]*kapi.Pod, error) GetPod(namespace, name string) (*kapi.Pod, error) GetNode(name string) (*kapi.Node, error) Events() kv1core.EventInterface }
Interface represents the exported methods for dealing with getting/setting kubernetes resources
type InterfaceOVN ¶
type InterfaceOVN interface { Interface UpdateEgressFirewall(egressfirewall *egressfirewall.EgressFirewall) error UpdateEgressIP(eIP *egressipv1.EgressIP) error PatchEgressIP(name string, patchData []byte) error GetEgressIP(name string) (*egressipv1.EgressIP, error) GetEgressIPs() ([]*egressipv1.EgressIP, error) GetEgressFirewalls() ([]*egressfirewall.EgressFirewall, error) CreateCloudPrivateIPConfig(cloudPrivateIPConfig *ocpcloudnetworkapi.CloudPrivateIPConfig) (*ocpcloudnetworkapi.CloudPrivateIPConfig, error) UpdateCloudPrivateIPConfig(cloudPrivateIPConfig *ocpcloudnetworkapi.CloudPrivateIPConfig) (*ocpcloudnetworkapi.CloudPrivateIPConfig, error) DeleteCloudPrivateIPConfig(name string) error UpdateEgressServiceStatus(namespace, name, host string) error UpdateIPAMClaimIPs(updatedIPAMClaim *ipamclaimsapi.IPAMClaim) error }
InterfaceOVN represents the exported methods for dealing with getting/setting kubernetes and OVN resources
type Kube ¶
type Kube struct {
KClient kubernetes.Interface
}
Kube works with kube client only Implements Interface
func (*Kube) Events ¶
func (k *Kube) Events() kv1core.EventInterface
Events returns events to use when creating an EventSinkImpl
func (*Kube) GetAnnotationsOnPod ¶
GetAnnotationsOnPod obtains the pod annotations from kubernetes apiserver, given the name and namespace
func (*Kube) GetNamespaces ¶
GetNamespaces returns the list of all Namespace objects matching the labelSelector
func (*Kube) GetPod ¶
GetPod obtains the pod from kubernetes apiserver, given the name and namespace
func (*Kube) GetPods ¶
GetPods returns the list of all Pod objects in a namespace matching the options
func (*Kube) PatchNode ¶
PatchNode patches the old node object with the changes provided in the new node object.
func (*Kube) RemoveTaintFromNode ¶
RemoveTaintFromNode removes all the taints that have the same key and effect from the node. If the taint doesn't exist, it doesn't do anything.
func (*Kube) SetAnnotationsOnNamespace ¶
func (k *Kube) SetAnnotationsOnNamespace(namespaceName string, annotations map[string]interface{}) error
SetAnnotationsOnNamespace takes the namespace name and map of key/value string pairs to set as annotations
func (*Kube) SetAnnotationsOnNode ¶
SetAnnotationsOnNode takes the node name and map of key/value string pairs to set as annotations
func (*Kube) SetAnnotationsOnPod ¶
func (k *Kube) SetAnnotationsOnPod(namespace, podName string, annotations map[string]interface{}) error
SetAnnotationsOnPod takes the pod object and map of key/value string pairs to set as annotations
func (*Kube) SetAnnotationsOnService ¶
func (k *Kube) SetAnnotationsOnService(namespace, name string, annotations map[string]interface{}) error
SetAnnotationsOnService takes a service namespace and name and a map of key/value string pairs to set as annotations
func (*Kube) SetLabelsOnNode ¶
SetLabelsOnNode takes the node name and map of key/value string pairs to set as labels
func (*Kube) SetTaintOnNode ¶
SetTaintOnNode tries to add a new taint to the node. If the taint already exists, it doesn't do anything.
func (*Kube) UpdateNodeStatus ¶
UpdateNodeStatus takes the node object and sets the provided update status
type KubeOVN ¶
type KubeOVN struct { Kube ANPClient anpclientset.Interface EIPClient egressipclientset.Interface EgressFirewallClient egressfirewallclientset.Interface CloudNetworkClient ocpcloudnetworkclientset.Interface EgressServiceClient egressserviceclientset.Interface APBRouteClient adminpolicybasedrouteclientset.Interface EgressQoSClient egressqosclientset.Interface IPAMClaimsClient ipamclaimssclientset.Interface }
KubeOVN works with all kube and ovn resources Implements InterfaceOVN
func (*KubeOVN) CreateCloudPrivateIPConfig ¶
func (k *KubeOVN) CreateCloudPrivateIPConfig(cloudPrivateIPConfig *ocpcloudnetworkapi.CloudPrivateIPConfig) (*ocpcloudnetworkapi.CloudPrivateIPConfig, error)
func (*KubeOVN) DeleteCloudPrivateIPConfig ¶
func (*KubeOVN) GetEgressFirewalls ¶
func (k *KubeOVN) GetEgressFirewalls() ([]*egressfirewall.EgressFirewall, error)
GetEgressFirewalls returns the list of all EgressFirewall objects from kubernetes
func (*KubeOVN) GetEgressIP ¶
func (k *KubeOVN) GetEgressIP(name string) (*egressipv1.EgressIP, error)
GetEgressIP returns the EgressIP object from kubernetes
func (*KubeOVN) GetEgressIPs ¶
func (k *KubeOVN) GetEgressIPs() ([]*egressipv1.EgressIP, error)
GetEgressIPs returns the list of all EgressIP objects from kubernetes
func (*KubeOVN) PatchEgressIP ¶
func (*KubeOVN) UpdateCloudPrivateIPConfig ¶
func (k *KubeOVN) UpdateCloudPrivateIPConfig(cloudPrivateIPConfig *ocpcloudnetworkapi.CloudPrivateIPConfig) (*ocpcloudnetworkapi.CloudPrivateIPConfig, error)
func (*KubeOVN) UpdateEgressFirewall ¶
func (k *KubeOVN) UpdateEgressFirewall(egressfirewall *egressfirewall.EgressFirewall) error
UpdateEgressFirewall updates the EgressFirewall with the provided EgressFirewall data
func (*KubeOVN) UpdateEgressIP ¶
func (k *KubeOVN) UpdateEgressIP(eIP *egressipv1.EgressIP) error
UpdateEgressIP updates the EgressIP with the provided EgressIP data
func (*KubeOVN) UpdateEgressServiceStatus ¶
func (*KubeOVN) UpdateIPAMClaimIPs ¶
func (k *KubeOVN) UpdateIPAMClaimIPs(updatedIPAMClaim *ipamclaimsapi.IPAMClaim) error