kubedriver

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultKubeURLPrefix = "k8sdriver/v4"
	MetricPort           = 9090
	ModuleName           = "k8s-driver"
)
View Source
const (
	Module        = "BCS-API-Tunnel-Module"
	RegisterToken = "BCS-API-Tunnel-Token"
	Params        = "BCS-API-Tunnel-Params"
	Cluster       = "BCS-API-Tunnel-ClusterId"
)
View Source
const CodeRequestFailed = 4001
View Source
const CodeRequestSuccess = 0

Variables

This section is empty.

Functions

func GetClusterID

func GetClusterID(o *options.KubeDriverServerOptions) (clusterID string, err error)

func GetServerInfo

func GetServerInfo(opts *options.KubeDriverServerOptions, clusterID string) types.ServerInfo

GetServerInfo returns server info of current driver node

func RouteByMethodName

func RouteByMethodName(w *restful.WebService, methodName string, subPath string) *restful.RouteBuilder

RouteByMethodName accepts a dynamic method name, this function uses reflect module

func StartServer

func StartServer(o *options.KubeDriverServerOptions) error

StartServer start driver server

Types

type APIGWAuthHeaders

type APIGWAuthHeaders struct {
	AccessToken string `json:"access_token"`
}

type AccessTokenRequestBody

type AccessTokenRequestBody struct {
	EnvName    string `json:"env_name"`
	AppCode    string `json:"app_code"`
	AppSecret  string `json:"app_secret"`
	IDProvider string `json:"id_provider"`
	GrantType  string `json:"grant_type"`
}

type DriverServer

type DriverServer struct {
	RootWebContainer *restful.Container
	Options          *options.KubeDriverServerOptions
}

func NewDriverServer

func NewDriverServer(o *options.KubeDriverServerOptions) DriverServer

NewDriverServer Create a new DriverServer instance

type KubeAPIPrefer

type KubeAPIPrefer struct {
	Groups []struct {
		Name     string `json:"name"`
		Versions []struct {
			GroupVersion string `json:"groupVersion"`
			Version      string `json:"version"`
		} `json:"versions"`
		PreferredVersion struct {
			GroupVersion string `json:"groupVersion"`
			Version      string `json:"version"`
		} `json:"preferredVersion"`
	} `json:"groups"`
}

func (KubeAPIPrefer) Map

func (p KubeAPIPrefer) Map() map[string]string

type KubeSmartProxier

type KubeSmartProxier struct {
	KubeMasterURL string
	TLSConfig     options.TLSConfig
	KubeURLPrefix string
	// contains filtered or unexported fields
}

func NewKubeSmartProxier

func NewKubeSmartProxier(kubeMasterURL string, TLSConfig options.TLSConfig) KubeSmartProxier

func (*KubeSmartProxier) ForwardToKubeAPI

func (c *KubeSmartProxier) ForwardToKubeAPI(request *restful.Request, response *restful.Response)

ForwardToKubeAPI forwards incoming request to kubernetes API Server

func (*KubeSmartProxier) GeneralAPIHandle

func (c *KubeSmartProxier) GeneralAPIHandle(request *restful.Request, response *restful.Response)

GeneralAPIHandle create

func (*KubeSmartProxier) IfKubeNeedTls

func (c *KubeSmartProxier) IfKubeNeedTls() bool

func (*KubeSmartProxier) RegisterToWS

func (c *KubeSmartProxier) RegisterToWS(ws *restful.WebService)

RegisterToWS registers a smart Kube API Proxy client to a go-restful WebService

func (*KubeSmartProxier) RequestAPIPrefer

func (c *KubeSmartProxier) RequestAPIPrefer() error

RequestServerVersion request API server to get version

func (*KubeSmartProxier) RequestServerVersion

func (c *KubeSmartProxier) RequestServerVersion() (KubeVersion, error)

RequestServerVersion request API server to get version

type KubeVersion

type KubeVersion struct {
	Major      string
	Minor      string
	GitVersion string
}

func (KubeVersion) IsValid

func (v KubeVersion) IsValid() bool

func (KubeVersion) String

func (v KubeVersion) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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