Documentation ¶
Index ¶
- func GetKubeConfig() (*kubernetes.Clientset, error)
- func GetKubeConfigfromFile() (*kubernetes.Clientset, error)
- func GetKubev1alpha1Config() (*k8sv1alpha1.K8sV1alpha1Client, error)
- type Interface
- type Kube
- func (k *Kube) AppendAnnotationOnPod(pod *kapi.Pod, key, value string) error
- func (k *Kube) GetAnnotationsOnPod(namespace, name string) (map[string]string, error)
- func (k *Kube) GetCertManagerClient() (*cm.CertmanagerV1Client, error)
- func (k *Kube) GetCertificate(client *cm.CertmanagerV1Client, namespace, name string) (*cmv1.Certificate, error)
- func (k *Kube) GetControlPlaneServiceIPRange() (kubeadmtypes.Networking, error)
- func (k *Kube) GetEndpoints(namespace string) (*kapi.EndpointsList, error)
- func (k *Kube) GetNamespace(name string) (*kapi.Namespace, error)
- func (k *Kube) GetNamespaces() (*kapi.NamespaceList, error)
- func (k *Kube) GetNetworkPolicies(namespace string) (*kapisnetworking.NetworkPolicyList, error)
- func (k *Kube) GetNode(name string) (*kapi.Node, error)
- func (k *Kube) GetNodes() (*kapi.NodeList, error)
- func (k *Kube) GetPod(namespace, name string) (*kapi.Pod, error)
- func (k *Kube) GetPods(namespace string) (*kapi.PodList, error)
- func (k *Kube) GetPodsByLabels(namespace string, selector labels.Selector) (*kapi.PodList, error)
- func (k *Kube) GetSecret(namespace, name string) (*kapi.Secret, error)
- func (k *Kube) GetSecrets(namespace string) (*kapi.SecretList, error)
- func (k *Kube) GetService(namespace, name string) (*kapi.Service, error)
- func (k *Kube) SetAnnotationOnNamespace(ns *kapi.Namespace, key, value string) error
- func (k *Kube) SetAnnotationOnNode(node *kapi.Node, key, value string) error
- func (k *Kube) SetAnnotationOnPod(pod *kapi.Pod, key, value string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKubeConfig ¶
func GetKubeConfig() (*kubernetes.Clientset, error)
GetKubeConfig return kubernetes Clientset
func GetKubeConfigfromFile ¶
func GetKubeConfigfromFile() (*kubernetes.Clientset, error)
GetKubeConfigfromFile return kubernetes Clientset
func GetKubev1alpha1Config ¶
func GetKubev1alpha1Config() (*k8sv1alpha1.K8sV1alpha1Client, error)
GetKubev1alpha1Config return k8s v1alpha1 Clientset
Types ¶
type Interface ¶
type Interface interface { SetAnnotationOnPod(pod *kapi.Pod, key, value string) error SetAnnotationOnNode(node *kapi.Node, key, value string) error SetAnnotationOnNamespace(ns *kapi.Namespace, key, value string) error GetAnnotationsOnPod(namespace, name string) (map[string]string, error) GetPod(namespace, name string) (*kapi.Pod, error) GetPods(namespace string) (*kapi.PodList, error) GetPodsByLabels(namespace string, selector labels.Selector) (*kapi.PodList, error) GetNodes() (*kapi.NodeList, error) GetNode(name string) (*kapi.Node, error) GetService(namespace, name string) (*kapi.Service, error) GetEndpoints(namespace string) (*kapi.EndpointsList, error) GetNamespace(name string) (*kapi.Namespace, error) GetNamespaces() (*kapi.NamespaceList, error) GetNetworkPolicies(namespace string) (*kapisnetworking.NetworkPolicyList, error) GetCertManagerClient() (*cm.CertmanagerV1Client, error) GetSecret(namespace, name string) (*kapi.Secret, error) GetSecrets(namespace string) (*kapi.SecretList, error) GetCertificates(client *cm.CertmanagerV1Client, name string) }
Interface represents the exported methods for dealing with getting/setting kubernetes resources
type Kube ¶
type Kube struct {
KClient kubernetes.Interface
}
Kube is the structure object upon which the Interface is implemented
func (*Kube) AppendAnnotationOnPod ¶
AppendAnnotationOnPod takes the pod object and key/value string pair to set it as an annotation
func (*Kube) GetAnnotationsOnPod ¶
GetAnnotationsOnPod obtains the pod annotations from kubernetes apiserver, given the name and namespace
func (*Kube) GetCertManagerClient ¶
func (k *Kube) GetCertManagerClient() (*cm.CertmanagerV1Client, error)
GetCertManagerClient returns a client for cert-manager
func (*Kube) GetCertificate ¶
func (k *Kube) GetCertificate(client *cm.CertmanagerV1Client, namespace, name string) (*cmv1.Certificate, error)
func (*Kube) GetControlPlaneServiceIPRange ¶
func (k *Kube) GetControlPlaneServiceIPRange() (kubeadmtypes.Networking, error)
GetControlPlaneServiceIPRange return the service IP
func (*Kube) GetEndpoints ¶
func (k *Kube) GetEndpoints(namespace string) (*kapi.EndpointsList, error)
GetEndpoints returns all the Endpoint resources from kubernetes apiserver, given namespace
func (*Kube) GetNamespace ¶
GetNamespace returns the Namespace resource from kubernetes apiserver, given its name
func (*Kube) GetNamespaces ¶
func (k *Kube) GetNamespaces() (*kapi.NamespaceList, error)
GetNamespaces returns all Namespace resource from kubernetes apiserver
func (*Kube) GetNetworkPolicies ¶
func (k *Kube) GetNetworkPolicies(namespace string) (*kapisnetworking.NetworkPolicyList, error)
GetNetworkPolicies returns all network policy objects from kubernetes
func (*Kube) GetPod ¶
GetPod obtains the Pod resource from kubernetes apiserver, given the name and namespace
func (*Kube) GetPods ¶
GetPods obtains the Pod resource from kubernetes apiserver, given the name and namespace
func (*Kube) GetPodsByLabels ¶
GetPodsByLabels obtains the Pod resources from kubernetes apiserver, given the namespace and label
func (*Kube) GetSecrets ¶
func (k *Kube) GetSecrets(namespace string) (*kapi.SecretList, error)
GetSecrets returns list of all secrets within the namespace
func (*Kube) GetService ¶
GetService returns the Service resource from kubernetes apiserver, given its name and namespace
func (*Kube) SetAnnotationOnNamespace ¶
SetAnnotationOnNamespace takes the Namespace object and key/value pair to set it as an annotation
func (*Kube) SetAnnotationOnNode ¶
SetAnnotationOnNode takes the node object and key/value string pair to set it as an annotation