kubernetes

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client = dapr.Client
View Source
var (
	DaprNotInstall = errors.New("dapr is not installed in your cluster")
)

Functions

func CheckPodExists

func CheckPodExists(client *k8s.Clientset, namespace string, labelSelector map[string]string, deployName string) (bool, string)

CheckPodExists returns a boolean representing the pod's existence and the namespace that the given pod resides in, or empty if not present in the given namespace.

func Delete

func Delete(pluginId string) error

func DeletePlugins

func DeletePlugins(client k8s.Interface, namespace string, pluginId string) error

func GetTKeelNameSpace

func GetTKeelNameSpace(client k8s.Interface) (string, error)

func Init

func Init(config InitConfiguration) (err error)

Init deploys the TKeel operator using the supplied runtime version.

func ListPods

func ListPods(client *k8s.Clientset, namespace string, labelSelector map[string]string) (*core_v1.PodList, error)

func ListPodsInterface

func ListPodsInterface(client k8s.Interface, labelSelector map[string]string) (*core_v1.PodList, error)

func Register

func Register(pluginId string) error

func RegisterPlugins

func RegisterPlugins(client k8s.Interface, namespace, pluginId string) error

func Uninstall

func Uninstall(namespace string, timeout uint, debugMode bool) error

Uninstall removes TKeel from a Kubernetes cluster.

Types

type InitConfiguration

type InitConfiguration struct {
	Version    string
	Namespace  string
	EnableMTLS bool
	EnableHA   bool
	Args       []string
	Wait       bool
	Timeout    uint
	DebugMode  bool
}

type ListOutput

type ListOutput struct {
	AppID   string `csv:"APP ID"`
	AppPort string `csv:"APP PORT"`
	Age     string `csv:"AGE"`
	Created string `csv:"CREATED"`
	Status  string `json:"status"`
}

ListOutput represents the application ID, application port and creation time.

type Plugin

type Plugin struct {
	PluginId     string `json:"plugin_id"`
	Version      string `json:"version"`
	Secret       string `json:"secret"`
	RegisterTime int64  `json:"register_time"`
	Status       string `json:"status"`
}

func List

func List() ([]Plugin, error)

func ListPlugins

func ListPlugins(client k8s.Interface, namespace string) ([]Plugin, error)

type PluginResponse

type PluginResponse struct {
	Ret  int      `json:"ret"`
	Msg  string   `json:"msg"`
	Data []Plugin `json:"data"`
}

type StatusClient

type StatusClient struct {
	// contains filtered or unexported fields
}

func NewStatusClient

func NewStatusClient() (*StatusClient, error)

Create a new k8s client for status commands.

func (*StatusClient) Status

func (s *StatusClient) Status() ([]StatusOutput, error)

List status for TKeel resources.

type StatusOutput

type StatusOutput struct {
	Name         string `csv:"NAME"`
	Namespace    string `csv:"NAMESPACE"`
	Healthy      string `csv:"HEALTHY"`
	Status       string `csv:"STATUS"`
	PluginStatus string `csv:"PLUGINSTATUS"`
	Replicas     int    `csv:"REPLICAS"`
	Version      string `csv:"VERSION"`
	Age          string `csv:"AGE"`
	Created      string `csv:"CREATED"`
}

StatusOutput represents the status of a named TKeel resource.

func GetPodsInterface

func GetPodsInterface(client k8s.Interface, label string) (*StatusOutput, error)

type TenantCreateResp

type TenantCreateResp struct {
	TenantID    string `json:"tenant_id"`
	Title       string `json:"title"`
	CreatedTime int64  `json:"created_time"`
	TenantAdmin User   `json:"tenant_admin"`
}

func CreateTenant

func CreateTenant(client k8s.Interface, namespace, tenantTitle string) (*TenantCreateResp, error)

func TenantCreate

func TenantCreate(tenantTitle string) (*TenantCreateResp, error)

type TenantCreateResponse

type TenantCreateResponse struct {
	Ret  int              `json:"ret"`
	Msg  string           `json:"msg"`
	Data TenantCreateResp `json:"data"`
}

type TenantListData

type TenantListData struct {
	TenantList []TenantCreateResp `json:"tenant_list"`
}

func ListTenant

func ListTenant(client k8s.Interface, namespace string) (*TenantListData, error)

func TenantList

func TenantList() (*TenantListData, error)

type TenantListResponse

type TenantListResponse struct {
	Ret  int            `json:"ret"`
	Msg  string         `json:"msg"`
	Data TenantListData `json:"data"`
}

type User

type User struct {
	ID         string `json:"id"`
	Name       string `json:"name"`
	Password   string `json:"password"`
	TenantID   string `json:"tenant_id"`
	Email      string `json:"email"`
	CreateTime int64  `json:"create_time"`
}

Jump to

Keyboard shortcuts

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