Help us shape the future of Go! Take the 2026 Go Developer Survey

k8s

package
v0.6.24 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BatchResourceResponse

type BatchResourceResponse struct {
	ManifestResponse *k8s.ManifestResponse
	Err              error
}

type K8sApplicationServiceConfig

type K8sApplicationServiceConfig struct {
	BatchSize        int `env:"BATCH_SIZE" envDefault:"5"`
	TimeOutInSeconds int `env:"TIMEOUT_IN_SECONDS" envDefault:"5"`
}

type K8sCommonService

type K8sCommonService interface {
	GetResource(ctx context.Context, request *ResourceRequestBean) (resp *k8s.ManifestResponse, err error)
	UpdateResource(ctx context.Context, request *ResourceRequestBean) (resp *k8s.ManifestResponse, err error)
	DeleteResource(ctx context.Context, request *ResourceRequestBean) (resp *k8s.ManifestResponse, err error)
	ListEvents(ctx context.Context, request *ResourceRequestBean) (*k8s.EventsResponse, error)
	GetRestConfigByClusterId(ctx context.Context, clusterId int) (*rest.Config, error, *cluster.ClusterBean)
	GetManifestsByBatch(ctx context.Context, request []ResourceRequestBean) ([]BatchResourceResponse, error)
	FilterK8sResources(ctx context.Context, resourceTreeInf map[string]interface{}, appDetail bean.AppDetailContainer, appId string, kindsToBeFiltered []string) []ResourceRequestBean
	RotatePods(ctx context.Context, request *RotatePodRequest) (*RotatePodResponse, error)
	GetCoreClientByClusterId(clusterId int) (*kubernetes.Clientset, *v1.CoreV1Client, error)
	GetK8sServerVersion(clusterId int) (*version.Info, error)
	PortNumberExtraction(resp []BatchResourceResponse, resourceTree map[string]interface{}) map[string]interface{}
}

type K8sCommonServiceImpl

type K8sCommonServiceImpl struct {
	K8sUtil *k8s.K8sUtil

	K8sApplicationServiceConfig *K8sApplicationServiceConfig
	// contains filtered or unexported fields
}

func NewK8sCommonServiceImpl

func NewK8sCommonServiceImpl(Logger *zap.SugaredLogger, k8sUtils *k8s.K8sUtil,
	clusterService cluster.ClusterService) *K8sCommonServiceImpl

func (*K8sCommonServiceImpl) DeleteResource

func (impl *K8sCommonServiceImpl) DeleteResource(ctx context.Context, request *ResourceRequestBean) (*k8s.ManifestResponse, error)

func (*K8sCommonServiceImpl) FilterK8sResources

func (impl *K8sCommonServiceImpl) FilterK8sResources(ctx context.Context, resourceTree map[string]interface{}, appDetail bean.AppDetailContainer, appId string, kindsToBeFiltered []string) []ResourceRequestBean

func (*K8sCommonServiceImpl) GetCoreClientByClusterId

func (impl *K8sCommonServiceImpl) GetCoreClientByClusterId(clusterId int) (*kubernetes.Clientset, *v1.CoreV1Client, error)

func (*K8sCommonServiceImpl) GetK8sServerVersion

func (impl *K8sCommonServiceImpl) GetK8sServerVersion(clusterId int) (*version.Info, error)

func (*K8sCommonServiceImpl) GetManifestsByBatch

func (impl *K8sCommonServiceImpl) GetManifestsByBatch(ctx context.Context, requests []ResourceRequestBean) ([]BatchResourceResponse, error)

func (*K8sCommonServiceImpl) GetResource

func (impl *K8sCommonServiceImpl) GetResource(ctx context.Context, request *ResourceRequestBean) (*k8s.ManifestResponse, error)

func (*K8sCommonServiceImpl) GetRestConfigByClusterId

func (impl *K8sCommonServiceImpl) GetRestConfigByClusterId(ctx context.Context, clusterId int) (*rest.Config, error, *cluster.ClusterBean)

func (*K8sCommonServiceImpl) ListEvents

func (impl *K8sCommonServiceImpl) ListEvents(ctx context.Context, request *ResourceRequestBean) (*k8s.EventsResponse, error)

func (K8sCommonServiceImpl) PortNumberExtraction added in v0.6.23

func (impl K8sCommonServiceImpl) PortNumberExtraction(resp []BatchResourceResponse, resourceTree map[string]interface{}) map[string]interface{}

func (*K8sCommonServiceImpl) RotatePods

func (impl *K8sCommonServiceImpl) RotatePods(ctx context.Context, request *RotatePodRequest) (*RotatePodResponse, error)

func (*K8sCommonServiceImpl) UpdateResource

func (impl *K8sCommonServiceImpl) UpdateResource(ctx context.Context, request *ResourceRequestBean) (*k8s.ManifestResponse, error)

type PodContainerList

type PodContainerList struct {
	Containers          []string
	InitContainers      []string
	EphemeralContainers []string
}

type ResourceRequestBean

type ResourceRequestBean struct {
	AppId                string                     `json:"appId"`
	AppType              int                        `json:"appType,omitempty"`        // 0: DevtronApp, 1: HelmApp
	DeploymentType       int                        `json:"deploymentType,omitempty"` // 0: DevtronApp, 1: HelmApp
	AppIdentifier        *client.AppIdentifier      `json:"-"`
	K8sRequest           *k8s.K8sRequestBean        `json:"k8sRequest"`
	DevtronAppIdentifier *bean.DevtronAppIdentifier `json:"-"`         // For Devtron App Resources
	ClusterId            int                        `json:"clusterId"` // clusterId is used when request is for direct cluster (not for helm release)
}

type RotatePodRequest

type RotatePodRequest struct {
	ClusterId int                      `json:"clusterId"`
	Resources []k8s.ResourceIdentifier `json:"resources"`
}

type RotatePodResponse

type RotatePodResponse struct {
	Responses     []*bean.RotatePodResourceResponse `json:"responses"`
	ContainsError bool                              `json:"containsError"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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