Documentation ¶
Index ¶
- func GetK8sPodInfo(client *kubernetes.Clientset, podName, podNamespace string) (labels map[string]string, annotations map[string]string, err error)
- func NewK8sClient(kuber Kubernetes, policy Policy) (*kubernetes.Clientset, error)
- func ResourceControllerName(client *kubernetes.Clientset, podName, namespace string) (string, error)
- type Args
- type Kubernetes
- type Policy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetK8sPodInfo ¶
func GetK8sPodInfo(client *kubernetes.Clientset, podName, podNamespace string) (labels map[string]string, annotations map[string]string, err error)
GetK8sPodInfo gets the labels and annotations of the pod
func NewK8sClient ¶
func NewK8sClient(kuber Kubernetes, policy Policy) (*kubernetes.Clientset, error)
NewK8sClient creates a k8s client
func ResourceControllerName ¶
func ResourceControllerName(client *kubernetes.Clientset, podName, namespace string) ( string, error)
ResourceControllerName gets the name of ResourceController based on given reference.
Types ¶
type Args ¶
type Args struct { types.CommonArgs IP net.IP K8S_POD_NAME types.UnmarshallableString K8S_POD_NAMESPACE types.UnmarshallableString K8S_POD_INFRA_CONTAINER_ID types.UnmarshallableString }
Args is the valid CNI_ARGS used for Kubernetes
type Kubernetes ¶
type Kubernetes struct { K8sAPIRoot string `json:"k8s_api_root"` Kubeconfig string `json:"kubeconfig"` NodeName string `json:"node_name"` }
Kubernetes is a K8s specific struct to hold config
type Policy ¶
type Policy struct { PolicyType string `json:"type"` K8sAPIRoot string `json:"k8s_api_root"` K8sAuthToken string `json:"k8s_auth_token"` K8sClientCertificate string `json:"k8s_client_certificate"` K8sClientKey string `json:"k8s_client_key"` K8sCertificateAuthority string `json:"k8s_certificate_authority"` }
Policy is a struct to hold policy config (which currently happens to also contain some K8s config)
Click to show internal directories.
Click to hide internal directories.