Documentation ¶
Index ¶
- Constants
- func CopyFromPod(ctx context.Context, provider *Provider, pod v1.Pod, srcPath string, ...) error
- func FilteredWatch(ctx context.Context, watcherCreator WatchCreator, targetNamespaces []string, ...) (<-chan *WatchEvent, <-chan error)
- func GetHubUrl() string
- func GetProxyOnPort(port uint16) string
- func IsPodRunning(pod *core.Pod) bool
- func NewPortForward(kubernetesProvider *Provider, namespace string, podRegex *regexp.Regexp, ...) (*portforward.PortForwarder, error)
- func SetConfig(provider *Provider, key string, value string) (updated bool, err error)
- func SetSecret(provider *Provider, key string, value string) (updated bool, err error)
- func StartProxy(kubernetesProvider *Provider, proxyHost string, srcPort uint16, ...) (*http.Server, error)
- func ValidateKubernetesVersion(serverVersionSemVer *semver.SemVersion) error
- type ClusterBehindProxyError
- type EventFilterer
- type EventWatchHelper
- type InvalidObjectType
- type K8sTapManagerError
- type K8sTapManagerErrorReason
- type PodWatchHelper
- type Provider
- func (provider *Provider) DoesServiceExist(ctx context.Context, namespace string, name string) (bool, error)
- func (provider *Provider) GetKubernetesVersion() (*semver.SemVersion, error)
- func (provider *Provider) GetNamespaceEvents(ctx context.Context, namespace string) (string, error)
- func (provider *Provider) GetNamespaces() []string
- func (provider *Provider) GetPodLogs(ctx context.Context, namespace string, podName string, containerName string) (string, error)
- func (provider *Provider) ListAllPodsMatchingRegex(ctx context.Context, regex *regexp.Regexp, namespaces []string) ([]core.Pod, error)
- func (provider *Provider) ListAllRunningPodsMatchingRegex(ctx context.Context, regex *regexp.Regexp, namespaces []string) ([]core.Pod, error)
- func (provider *Provider) ListPodsByAppLabel(ctx context.Context, namespaces string, labels map[string]string) ([]core.Pod, error)
- func (provider *Provider) ValidateNotProxy() error
- type WatchCreator
- type WatchEvent
Constants ¶
View Source
const ( SUFFIX_SECRET = "secret" SUFFIX_CONFIG_MAP = "config-map" SECRET_LICENSE = "LICENSE" CONFIG_POD_REGEX = "POD_REGEX" CONFIG_NAMESPACES = "NAMESPACES" CONFIG_SCRIPTING_ENV = "SCRIPTING_ENV" CONFIG_INGRESS_ENABLED = "INGRESS_ENABLED" CONFIG_INGRESS_HOST = "INGRESS_HOST" CONFIG_PROXY_FRONT_PORT = "PROXY_FRONT_PORT" CONFIG_AUTH_ENABLED = "AUTH_ENABLED" CONFIG_AUTH_TYPE = "AUTH_TYPE" CONFIG_AUTH_SAML_IDP_METADATA_URL = "AUTH_SAML_IDP_METADATA_URL" )
View Source
const ( SELF_RESOURCES_PREFIX = "kubeshark-" FrontPodName = SELF_RESOURCES_PREFIX + "front" FrontServiceName = FrontPodName HubPodName = SELF_RESOURCES_PREFIX + "hub" HubServiceName = HubPodName K8sAllNamespaces = "" MinKubernetesServerVersion = "1.16.0" )
Variables ¶
This section is empty.
Functions ¶
func CopyFromPod ¶
func FilteredWatch ¶
func FilteredWatch(ctx context.Context, watcherCreator WatchCreator, targetNamespaces []string, filterer EventFilterer) (<-chan *WatchEvent, <-chan error)
func GetProxyOnPort ¶
func IsPodRunning ¶
func NewPortForward ¶
func StartProxy ¶
func ValidateKubernetesVersion ¶
func ValidateKubernetesVersion(serverVersionSemVer *semver.SemVersion) error
Types ¶
type ClusterBehindProxyError ¶
type ClusterBehindProxyError struct{}
func (*ClusterBehindProxyError) Error ¶
func (e *ClusterBehindProxyError) Error() string
ClusterBehindProxyError implements the Error interface.
type EventFilterer ¶
type EventFilterer interface {
Filter(*WatchEvent) (bool, error)
}
type EventWatchHelper ¶
type EventWatchHelper struct { NameRegexFilter *regexp.Regexp Kind string // contains filtered or unexported fields }
func NewEventWatchHelper ¶
func NewEventWatchHelper(kubernetesProvider *Provider, NameRegexFilter *regexp.Regexp, kind string) *EventWatchHelper
func (*EventWatchHelper) Filter ¶
func (wh *EventWatchHelper) Filter(wEvent *WatchEvent) (bool, error)
Implements the EventFilterer Interface
func (*EventWatchHelper) NewWatcher ¶
func (wh *EventWatchHelper) NewWatcher(ctx context.Context, namespace string) (watch.Interface, error)
Implements the WatchCreator Interface
type InvalidObjectType ¶
func (*InvalidObjectType) Error ¶
func (iot *InvalidObjectType) Error() string
Implements the error interface
type K8sTapManagerError ¶
type K8sTapManagerError struct { OriginalError error TapManagerReason K8sTapManagerErrorReason }
func (*K8sTapManagerError) Error ¶
func (e *K8sTapManagerError) Error() string
K8sTapManagerError implements the Error interface.
type K8sTapManagerErrorReason ¶
type K8sTapManagerErrorReason string
const ( TapManagerWorkerUpdateError K8sTapManagerErrorReason = "WORKER_UPDATE_ERROR" TapManagerPodWatchError K8sTapManagerErrorReason = "POD_WATCH_ERROR" TapManagerPodListError K8sTapManagerErrorReason = "POD_LIST_ERROR" )
type PodWatchHelper ¶
type PodWatchHelper struct { NameRegexFilter *regexp.Regexp // contains filtered or unexported fields }
func NewPodWatchHelper ¶
func NewPodWatchHelper(kubernetesProvider *Provider, NameRegexFilter *regexp.Regexp) *PodWatchHelper
func (*PodWatchHelper) Filter ¶
func (wh *PodWatchHelper) Filter(wEvent *WatchEvent) (bool, error)
Implements the EventFilterer Interface
func (*PodWatchHelper) NewWatcher ¶
func (wh *PodWatchHelper) NewWatcher(ctx context.Context, namespace string) (watch.Interface, error)
Implements the WatchCreator Interface
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
func (*Provider) DoesServiceExist ¶
func (*Provider) GetKubernetesVersion ¶
func (provider *Provider) GetKubernetesVersion() (*semver.SemVersion, error)
func (*Provider) GetNamespaceEvents ¶
func (*Provider) GetNamespaces ¶
func (*Provider) GetPodLogs ¶
func (*Provider) ListAllPodsMatchingRegex ¶
func (*Provider) ListAllRunningPodsMatchingRegex ¶
func (*Provider) ListPodsByAppLabel ¶
func (*Provider) ValidateNotProxy ¶
ValidateNotProxy We added this after a customer tried to run kubeshark from lens, which used len's kube config, which have cluster server configuration, which points to len's local proxy. The workaround was to use the user's local default kube config. For now - we are blocking the option to run kubeshark through a proxy to k8s server
type WatchCreator ¶
type WatchEvent ¶
func (*WatchEvent) ToError ¶
func (we *WatchEvent) ToError() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.