kubernetes

package module
v0.0.0-...-ab1e0d7 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 40 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PauseTrue int = iota + 20000
	PauseFalse
)

Variables

This section is empty.

Functions

func Init

func Init(portalProxy api.PortalProxy) (api.StratosPlugin, error)

Init creates a new instance of the Kubernetes plugin

Types

type HelmConfiguration

type HelmConfiguration struct {
	Folder string
}

HelmConfiguration stores any resources that need to be cleaned up after use

func (*HelmConfiguration) Cleanup

func (f *HelmConfiguration) Cleanup()

Cleanup any resources associated with the Helm configuration

type KubeAPIVersions

type KubeAPIVersions struct {
	Kind                       string        `json:"kind"`
	Versions                   []string      `json:"versions"`
	ServerAddressByClientCIDRs []interface{} `json:"serverAddressByClientCIDRs"`
}

type KubeProxyError

type KubeProxyError struct {
	Error         KubeProxyErrorStatus `json:"error"`
	ErrorResponse string               `json:"errorResponse"`
}

KubeProxyError is an endpoint's failure, in the per-endpoint error shape the passthrough proxy uses (jetstream passthrough.go), so the frontend reads it the same way:

{"error": {"statusCode": 500, "status": "..."}, "errorResponse": "..."}

type KubeProxyErrorStatus

type KubeProxyErrorStatus struct {
	StatusCode int    `json:"statusCode"`
	Status     string `json:"status"`
}

KubeProxyErrorStatus is the status part of a KubeProxyError

type KubeProxyFunc

type KubeProxyFunc func(*api.ConnectedEndpoint, chan KubeProxyResponse)

KubeProxyFunc represents a function to proxy to the Kube API

type KubeProxyResponse

type KubeProxyResponse struct {
	Endpoint string
	Result   interface{}
	Error    *KubeProxyError
}

KubeProxyResponse represents a response from a proxy request to the Kube API

type KubeProxyResponses

type KubeProxyResponses map[string]interface{}

KubeProxyResponses represents response from multiple proxy requests to the Kube API

type KubeStatus

type KubeStatus struct {
	Kind       string      `json:"kind"`
	ApiVersion string      `json:"apiVersion"`
	Metadata   interface{} `json:"metadata"`
	Status     string      `json:"status"`
	Message    string      `json:"message"`
	Reason     string      `json:"reason"`
	Details    interface{} `json:"details"`
	Code       int         `json:"code"`
}

type KubernetesSpecification

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

KubernetesSpecification is the endpoint that adds Kubernetes support to the backend

func (*KubernetesSpecification) AddAdminGroupRoutes

func (c *KubernetesSpecification) AddAdminGroupRoutes(echoGroup *echo.Group)

func (*KubernetesSpecification) AddAuthProvider

func (c *KubernetesSpecification) AddAuthProvider(provider auth.KubeAuthProvider)

AddAuthProvider adds a Kubernetes auth provider

func (*KubernetesSpecification) AddSessionGroupRoutes

func (c *KubernetesSpecification) AddSessionGroupRoutes(echoGroup *echo.Group)

func (*KubernetesSpecification) Connect

func (c *KubernetesSpecification) Connect(ec *echo.Context, cnsiRecord api.CNSIRecord, userID string) (*api.TokenRecord, bool, error)

func (*KubernetesSpecification) DeleteRelease

func (c *KubernetesSpecification) DeleteRelease(ec *echo.Context) error

DeleteRelease will delete a release

func (*KubernetesSpecification) FindAuthProvider

func (c *KubernetesSpecification) FindAuthProvider(name string) auth.KubeAuthProvider

FindAuthProvider finds auth provider - case insensitive

func (*KubernetesSpecification) GetAuthProvider

func (c *KubernetesSpecification) GetAuthProvider(name string) auth.KubeAuthProvider

GetAuthProvider gets a Kubernetes auth provider by key

func (*KubernetesSpecification) GetClientId

func (c *KubernetesSpecification) GetClientId() string

func (*KubernetesSpecification) GetConfigForEndpoint

func (c *KubernetesSpecification) GetConfigForEndpoint(masterURL string, token api.TokenRecord) (*restclient.Config, error)

GetConfigForEndpoint gets a config for the Kubernetes go-client for the specified endpoint

func (*KubernetesSpecification) GetConfigForEndpointUser

func (c *KubernetesSpecification) GetConfigForEndpointUser(endpointID, userID string) (*restclient.Config, error)

GetConfigForEndpointUser gets a kube config for the endpoint ID and user ID

func (*KubernetesSpecification) GetEndpointPlugin

func (c *KubernetesSpecification) GetEndpointPlugin() (api.EndpointPlugin, error)

func (*KubernetesSpecification) GetHelmConfiguration

func (c *KubernetesSpecification) GetHelmConfiguration(endpointGUID, userID, namespace string) (*action.Configuration, *HelmConfiguration, error)

GetHelmConfiguration - gets a Helm V3 client for using it as a client library

func (*KubernetesSpecification) GetKubeConfigForEndpoint

func (c *KubernetesSpecification) GetKubeConfigForEndpoint(masterURL string, token api.TokenRecord, namespace string) (string, error)

GetKubeConfigForEndpoint gets a Kube Config file contents for the specified endpoint

func (*KubernetesSpecification) GetKubeConfigForEndpointUser

func (c *KubernetesSpecification) GetKubeConfigForEndpointUser(endpointID, userID string) (string, error)

func (*KubernetesSpecification) GetMiddlewarePlugin

func (c *KubernetesSpecification) GetMiddlewarePlugin() (api.MiddlewarePlugin, error)

func (*KubernetesSpecification) GetRelease

func (c *KubernetesSpecification) GetRelease(ec *echo.Context) error

GetRelease gets the release information for a specific Helm release

func (*KubernetesSpecification) GetReleaseHistory

func (c *KubernetesSpecification) GetReleaseHistory(ec *echo.Context) error

GetReleaseHistory will get the history for a release

func (*KubernetesSpecification) GetReleaseStatus

func (c *KubernetesSpecification) GetReleaseStatus(ec *echo.Context) error

GetReleaseStatus will get release status for the given release This is a web socket request and will return info over the websocket polling until disconnected

func (*KubernetesSpecification) GetRoutePlugin

func (c *KubernetesSpecification) GetRoutePlugin() (api.RoutePlugin, error)

func (*KubernetesSpecification) GetType

func (c *KubernetesSpecification) GetType() string

func (*KubernetesSpecification) Info

func (c *KubernetesSpecification) Info(apiEndpoint string, skipSSLValidation bool, caCert string) (api.CNSIRecord, interface{}, error)

func (*KubernetesSpecification) Init

func (c *KubernetesSpecification) Init() error

Init the Kubernetes Jetstream plugin

func (*KubernetesSpecification) InstallRelease

func (c *KubernetesSpecification) InstallRelease(ec *echo.Context) error

InstallRelease will install a Helm 3 release

func (*KubernetesSpecification) ListReleases

func (c *KubernetesSpecification) ListReleases(ec *echo.Context) error

ListReleases will list the helm releases for all endpoints

func (*KubernetesSpecification) ProxyKubernetesAPI

func (c *KubernetesSpecification) ProxyKubernetesAPI(userID string, f KubeProxyFunc) (KubeProxyResponses, error)

ProxyKubernetesAPI proxies an API request to all of the user's connected Kubernetes endpoints

func (*KubernetesSpecification) Register

func (c *KubernetesSpecification) Register(echoContext *echo.Context) error

func (*KubernetesSpecification) RequiresCert

func (c *KubernetesSpecification) RequiresCert(ec *echo.Context) error

func (*KubernetesSpecification) UpdateMetadata

func (c *KubernetesSpecification) UpdateMetadata(info *api.Info, userGUID string, echoContext *echo.Context)

func (*KubernetesSpecification) UpgradeRelease

func (c *KubernetesSpecification) UpgradeRelease(ec *echo.Context) error

UpgradeRelease will upgrade the specified release

func (*KubernetesSpecification) Validate

func (c *KubernetesSpecification) Validate(userGUID string, cnsiRecord api.CNSIRecord, tokenRecord api.TokenRecord) error

type ResourceMessage

type ResourceMessage struct {
	MessageType int `json:"type"`
}

ResourceMessage ... Incoming content of socket

type ResourceResponse

type ResourceResponse struct {
	Kind string          `json:"kind"`
	Data json.RawMessage `json:"data"`
}

ResourceResponse ... Outgoing content of socket

Directories

Path Synopsis
auth module

Jump to

Keyboard shortcuts

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