k8s

package
v0.0.0-...-207676e Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AgentConfigName   = "agent-config"
	AgentSecretName   = "agent-secret"
	LiveCheckMaxTries = 6
)

Variables

View Source
var (
	AgentNamespace = os.Getenv("AGENT_NAMESPACE")
	AgentScope     = os.Getenv("AGENT_SCOPE")
)
View Source
var (
	Ctx = context.Background()
)
View Source
var KubeConfig *string

Functions

func CheckComponentStatus

func CheckComponentStatus(componentEnv string) error

func ClusterConfirm

func ClusterConfirm(clusterData map[string]string) ([]byte, error)

func ClusterOperations

func ClusterOperations(clusterAction atype.Action) (*unstructured.Unstructured, error)

ClusterOperations handles cluster operations

func ClusterRegister

func ClusterRegister(accessKey string) (bool, error)

ClusterRegister function creates litmus-portal config map in the litmus namespace

func CreatePodLog

func CreatePodLog(podLog types.PodLogRequest) (types.PodLog, error)

CreatePodLog creates pod log for normal pods and chaos-engine pods

func GenerateKubeObject

func GenerateKubeObject(cid string, accessKey, version string, kubeObjectRequest types.KubeObjRequest) ([]byte, error)

func GenerateLogPayload

func GenerateLogPayload(cid, accessKey, version string, podLog types.PodLogRequest) ([]byte, error)

func GetDynamicAndDiscoveryClient

func GetDynamicAndDiscoveryClient() (discovery.DiscoveryInterface, dynamic.Interface, error)

GetDynamicAndDiscoveryClient returns dynamic client and discovery client

func GetGenericK8sClient

func GetGenericK8sClient() (*kubernetes.Clientset, error)

func GetKubeConfig

func GetKubeConfig() (*rest.Config, error)

GetKubeConfig sets up the config for access cluster resource

func GetKubernetesObjects

func GetKubernetesObjects(request types.KubeObjRequest) ([]*types.KubeObject, error)

GetKubernetesObjects is used to get the Kubernetes Object details according to the request type

func GetLogs

func GetLogs(podName, namespace, container string) (string, error)

func GetObjectDataByNamespace

func GetObjectDataByNamespace(namespace string, dynamicClient dynamic.Interface, gvrList []schema.GroupVersionResource) ([]types.ObjectData, error)

GetObjectDataByNamespace uses dynamic client to fetch Kubernetes Objects data.

func IsClusterConfirmed

func IsClusterConfirmed() (bool, string, error)

func SendKubeObjects

func SendKubeObjects(clusterData map[string]string, kubeObjectRequest types.KubeObjRequest) error

SendKubeObjects generates graphql mutation to send kubernetes objects data to graphql server

func SendPodLogs

func SendPodLogs(clusterData map[string]string, podLog types.PodLogRequest)

SendPodLogs generates graphql mutation to send events updates to graphql server

Types

type AgentComponents

type AgentComponents struct {
	Deployments      []string `yaml:"DEPLOYMENTS"`
	LiveStatus       bool
	AccessLiveStatus sync.Mutex
}

Jump to

Keyboard shortcuts

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