server

package
v0.3.45 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: Apache-2.0 Imports: 26 Imported by: 1

README

serve

The serve commands allow you to run k8sgpt in a grpc server mode. This would be enabled typically through k8sgpt serve and is how the in-cluster k8sgpt deployment functions when managed by the k8sgpt-operator

The grpc interface that is served is hosted on buf and the repository for this is here

grpcurl

A fantastic tool for local debugging and development is grpcurl It allows you to form curl like requests that are http2 e.g.

grpcurl -plaintext -d '{"namespace": "k8sgpt", "explain" : "true"}' localhost:8080 schema.v1.ServiceAnalyzeService/Analyze
grpcurl -plaintext  localhost:8080 schema.v1.ServiceConfigService/ListIntegrations
{
  "integrations": [
    "trivy"
  ]
}

grpcurl -plaintext -d '{"integrations":{"trivy":{"enabled":"true","namespace":"default","skipInstall":"false"}}}' localhost:8080 schema.v1.ServiceConfigService/AddConfig

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LogInterceptor added in v0.3.41

func LogInterceptor(logger *zap.Logger) grpc.UnaryServerInterceptor

Types

type Config

type Config struct {
	Port           string
	MetricsPort    string
	Backend        string
	Key            string
	Token          string
	Output         string
	ConfigHandler  *config.Handler
	AnalyzeHandler *analyze.Handler
	QueryHandler   *query.Handler
	Logger         *zap.Logger

	EnableHttp bool
	// contains filtered or unexported fields
}

func (*Config) Serve

func (s *Config) Serve() error

func (*Config) ServeMetrics added in v0.3.0

func (s *Config) ServeMetrics() error

func (*Config) Shutdown added in v0.3.25

func (s *Config) Shutdown() error

type Health

type Health struct {
	Status  string `json:"status"`
	Success int    `json:"success"`
	Failure int    `json:"failure"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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