kubernetes

package
v0.0.0-...-f374617 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigMapExist

func ConfigMapExist() bool

func RestartPod

func RestartPod(podID string) error

RestartPod call k8s api to restart pod

func UpdateCimYang

func UpdateCimYang()

Types

type ControlIpRequest

type ControlIpRequest struct {
	Msuid           string `json:"msuid"`
	ServiceEndpoint string `json:"service-endpoint"`
}

type ControlIpResponse

type ControlIpResponse struct {
	ControlIpList []string `json:"control_ip_list"`
	Error         string   `json:"error,omitempty"`
}

type KubeClient

type KubeClient struct {
	Client *kubernetes.Clientset
}
var (

	//KubeConnect k8s connection object
	KubeConnect *KubeClient
)

func NewKubeConfig

func NewKubeConfig() (*KubeClient, error)

NewKubeConfig get k8s client connection

func (*KubeClient) AddAnnotation

func (c *KubeClient) AddAnnotation(path, valueJSON, namespace, podName string) error

AddAnnotation adds an annotation specified by path and it's value specified in valueJson, in a pod in a given namespace

func (*KubeClient) CreateCimConfigMap

func (c *KubeClient) CreateCimConfigMap() error

func (*KubeClient) DeleteAnnotation

func (c *KubeClient) DeleteAnnotation(path, namespace, podName string) error

DeleteAnnotation deletes an annotation specified in a path, in a pod in a given namespace

func (*KubeClient) DeletePod

func (c *KubeClient) DeletePod(podName, namespace string) error

DeletePod restart a pod

func (*KubeClient) DeletePodWithGrace

func (c *KubeClient) DeletePodWithGrace(podName, namespace string, GracePeriodSeconds *int64) error

DeletePodWithGrace restarts a pod with a grace period

func (*KubeClient) GetCimCMRevision

func (c *KubeClient) GetCimCMRevision()

func (*KubeClient) GetCimConfigMap

func (c *KubeClient) GetCimConfigMap() (*v1.ConfigMap, error)

list out configmap in given namespace

func (*KubeClient) GetDeployment

func (c *KubeClient) GetDeployment(namespace, deploymentName string) (*v1.Deployment, error)

GetDeployment get deployment details

func (*KubeClient) GetLabelValue

func (c *KubeClient) GetLabelValue(label string) string

GetLabelValue gets the value of the label passed, for current pod

func (*KubeClient) GetLoggingPod

func (c *KubeClient) GetLoggingPod(nodename string) (*v1.PodList, error)

Get Local daemonset Logging pod

func (*KubeClient) GetPod

func (c *KubeClient) GetPod(namespace, podName string) (*v1.Pod, error)

GetPod get pod details

func (*KubeClient) GetPodDeletionGracePeriod

func (c *KubeClient) GetPodDeletionGracePeriod(namespace, podName string) (int64, error)

GetPodDeletionGracePeriod returns grace period for pod deletion in seconds

func (*KubeClient) GetPodUUID

func (c *KubeClient) GetPodUUID() string

GetPodUUID fetches the UUID of the pod

func (*KubeClient) GetReplicaCount

func (c *KubeClient) GetReplicaCount(namespace, deployment string) (int32, error)

GetReplicaCount gets the replicas in a deployment or a statefulset.

func (*KubeClient) GetStatefulSets

func (c *KubeClient) GetStatefulSets(namespace, statefulsetName string) (*v1.StatefulSet, error)

GetStatefulSets get StatefulSets details

func (*KubeClient) GetTopoGwFqdn

func (c *KubeClient) GetTopoGwFqdn() (string, error)

GetTopoGwFqdn get topo-gw fqdn from annotations

func (*KubeClient) GetXGVelaNamespace

func (c *KubeClient) GetXGVelaNamespace() (string, error)

GetXGVelaNamespace get cluster role details

func (*KubeClient) ListPods

func (c *KubeClient) ListPods(namespace string) (*v1.PodList, error)

GetPod list pods details

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL