kubes

package
v0.0.0-...-0a0123b Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(
	New,
	NewConfig,
)

Functions

func BuildAndTagImage

func BuildAndTagImage(ctxDir, dockerfilePath, imageName string) (string, error)

func CreatePod

func CreatePod(clientset *kubernetes.Clientset, name, password string) corev1.Pod

func CreateService

func CreateService(clientset *kubernetes.Clientset, name string) corev1.Service

func GenerateIngressRules

func GenerateIngressRules(clientset *kubernetes.Clientset, number int)

GenerateIngressRules creates ingress rules for the specified number of hosts

func GeneratePassword

func GeneratePassword() string

GeneratePassword creates a random 16-character alphanumeric password

func GetServicePodMetrics

func GetServicePodMetrics(clientset *kubernetes.Clientset, metricsClient *metrics.Clientset, namespace, serviceName string) (*metricsv1beta1.PodMetricsList, error)

func NewIngressRule

func NewIngressRule(domain, serviceName string, port int32) *networkingv1.IngressRule

func NewXCtfDeployment

func NewXCtfDeployment(container, name, configMapName string, port int32, oc openai.Config) *appsv1.Deployment

Types

type Config

type Config struct {
	Enabled          bool   `yaml:"enabled"`
	Container        string `yaml:"container"`
	DefaultNamespace string `yaml:"default_namespace"`
	DefaultIngress   string `yaml:"default_ingress"`
	GcsAccount       string `yaml:"gcs_account"`
}

func NewConfig

func NewConfig(provider config.Provider) (Config, error)

func NewDefaultConfig

func NewDefaultConfig() Config

type Service

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

func New

func New(c Config, oc openai.Config) (*Service, error)

func (*Service) DeleteDeployment

func (s *Service) DeleteDeployment(ctx context.Context, c *connect.Request[kubes.DeleteDeploymentRequest]) (*connect.Response[kubes.DeleteDeploymentResponse], error)

func (*Service) ListDeployments

func (s *Service) ListDeployments(ctx context.Context, c *connect.Request[kubes.ListDeploymentsRequest]) (*connect.Response[kubes.ListDeploymentsResponse], error)

func (*Service) NewDeployment

func (s *Service) NewDeployment(ctx context.Context, c *connect.Request[kubes.NewDeploymentRequest]) (*connect.Response[kubes.NewDeploymentResponse], error)

Jump to

Keyboard shortcuts

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