Documentation
¶
Index ¶
- Constants
- func NewK8SPortFwdConn(ctx context.Context, config *rest.Config, namespace string, pod target, ...) (net.Conn, error)
- func WithConnectUsingK8SProxy(runtime *Runtime)
- type ConnectionMode
- type Option
- type RunClient
- type Runtime
- func (r *Runtime) Close() error
- func (r *Runtime) GetCatalog() (*runtime.Catalog, error)
- func (r *Runtime) GetDefaultValue(key params.ValueHint) (string, bool)
- func (r *Runtime) GetGadgetInfo(gadgetCtx runtime.GadgetContext, runtimeParams *params.Params, ...) (*api.GadgetInfo, error)
- func (r *Runtime) GetGadgetInstances(ctx context.Context, runtimeParams *params.Params) (instances []*api.GadgetInstance, err error)
- func (r *Runtime) GlobalParamDescs() params.ParamDescs
- func (r *Runtime) Init(runtimeGlobalParams *params.Params) error
- func (r *Runtime) InitDeployInfo() (*deployinfo.DeployInfo, error)
- func (r *Runtime) ParamDescs() params.ParamDescs
- func (r *Runtime) RemoveGadgetInstance(ctx context.Context, runtimeParams *params.Params, id string) error
- func (r *Runtime) RunBuiltInGadget(gadgetCtx runtime.GadgetContext) (runtime.CombinedGadgetResult, error)
- func (r *Runtime) RunGadget(gadgetCtx runtime.GadgetContext, runtimeParams *params.Params, ...) error
- func (r *Runtime) SetDefaultValue(key params.ValueHint, value string)
- func (r *Runtime) SetRestConfig(config *rest.Config)
- func (r *Runtime) UpdateDeployInfo() error
Constants ¶
View Source
const ( ParamNode = "node" ParamRemoteAddress = "remote-address" ParamConnectionMethod = "connection-method" ParamConnectionTimeout = "connection-timeout" ParamID = "id" ParamDetach = "detach" ParamTags = "tags" ParamName = "name" ParamEventBufferLength = "event-buffer-length" ParamTLSKey = "tls-key-file" ParamTLSCert = "tls-cert-file" ParamTLSServerCA = "tls-server-ca-file" ParamTLSServerName = "tls-server-name" // ParamGadgetServiceTCPPort is only used in combination with KubernetesProxyConnectionMethodTCP ParamGadgetServiceTCPPort = "tcp-port" // ConnectTimeout is the time in seconds we wait for a connection to the remote to // succeed ConnectTimeout = 5 // ResultTimeout is the time in seconds we wait for a result to return from the gadget // after sending a Stop command ResultTimeout = 30 ParamGadgetNamespace string = "gadget-namespace" DefaultGadgetNamespace string = "gadget" )
Variables ¶
This section is empty.
Functions ¶
func NewK8SPortFwdConn ¶ added in v0.22.0
func NewK8SPortFwdConn(ctx context.Context, config *rest.Config, namespace string, pod target, targetPort uint16, timeout time.Duration) (net.Conn, error)
NewK8SPortFwdConn connects to a Pod using PortForwarding via the Kubernetes API Server
func WithConnectUsingK8SProxy ¶ added in v0.21.0
func WithConnectUsingK8SProxy(runtime *Runtime)
Types ¶
type ConnectionMode ¶ added in v0.21.0
type ConnectionMode int
const ( // ConnectionModeDirect will connect directly to the remote using the gRPC protocol; the remote side can either // be a tcp or a unix socket endpoint ConnectionModeDirect ConnectionMode = iota // ConnectionModeKubernetesProxy will connect to a gRPC endpoint through a kubernetes API server by first looking // up an appropriate target node using the kubernetes API, then using the port forward // endpoint of the Kubernetes API to forward the gRPC connection to the service listener (see gadgettracermgr). ConnectionModeKubernetesProxy )
type RunClient ¶ added in v0.21.0
type RunClient interface {
Recv() (*api.GadgetEvent, error)
}
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func New ¶
New instantiates the runtime and loads the locally stored gadget info. If no info is stored locally, it will try to fetch one from one of the gadget nodes and store it locally. It will issue warnings on failures.
func (*Runtime) GetDefaultValue ¶
func (*Runtime) GetGadgetInfo ¶ added in v0.22.0
func (r *Runtime) GetGadgetInfo(gadgetCtx runtime.GadgetContext, runtimeParams *params.Params, paramValues api.ParamValues) (*api.GadgetInfo, error)
func (*Runtime) GetGadgetInstances ¶ added in v0.33.0
func (*Runtime) GlobalParamDescs ¶
func (r *Runtime) GlobalParamDescs() params.ParamDescs
func (*Runtime) InitDeployInfo ¶ added in v0.21.0
func (r *Runtime) InitDeployInfo() (*deployinfo.DeployInfo, error)
InitDeployInfo loads the locally stored deploy info. If no deploy info is stored locally, it will try to fetch it from one of the remotes and store it locally. It will issue warnings on failures.
func (*Runtime) ParamDescs ¶
func (r *Runtime) ParamDescs() params.ParamDescs
func (*Runtime) RemoveGadgetInstance ¶ added in v0.33.0
func (*Runtime) RunBuiltInGadget ¶ added in v0.28.0
func (r *Runtime) RunBuiltInGadget(gadgetCtx runtime.GadgetContext) (runtime.CombinedGadgetResult, error)
func (*Runtime) RunGadget ¶
func (r *Runtime) RunGadget(gadgetCtx runtime.GadgetContext, runtimeParams *params.Params, paramValues api.ParamValues) error
func (*Runtime) SetDefaultValue ¶
func (*Runtime) SetRestConfig ¶ added in v0.23.0
func (*Runtime) UpdateDeployInfo ¶ added in v0.18.0
Click to show internal directories.
Click to hide internal directories.