Documentation
¶
Index ¶
- Constants
- Variables
- type AccessControlClientset
- func (a *AccessControlClientset) DiscoveryClient() discovery.DiscoveryInterface
- func (a *AccessControlClientset) Pods(namespace string) (corev1.PodInterface, error)
- func (a *AccessControlClientset) PodsExec(namespace, name string, podExecOptions *v1.PodExecOptions) (remotecommand.Executor, error)
- func (a *AccessControlClientset) PodsMetricses(ctx context.Context, namespace, name string, listOptions metav1.ListOptions) (*metrics.PodMetricsList, error)
- func (a *AccessControlClientset) SelfSubjectAccessReviews() (authorizationv1.SelfSubjectAccessReviewInterface, error)
- func (a *AccessControlClientset) Services(namespace string) (corev1.ServiceInterface, error)
- func (a *AccessControlClientset) TokenReview() (authenticationv1.TokenReviewInterface, error)
- type AccessControlRESTMapper
- func (a AccessControlRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
- func (a AccessControlRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
- func (a AccessControlRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)
- func (a AccessControlRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)
- func (a AccessControlRESTMapper) Reset()
- func (a AccessControlRESTMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
- func (a AccessControlRESTMapper) ResourceSingularizer(resource string) (singular string, err error)
- func (a AccessControlRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
- type CloseWatchKubeConfig
- type HeaderKey
- type Kubernetes
- func (k *Kubernetes) EventsList(ctx context.Context, namespace string) ([]map[string]any, error)
- func (k *Kubernetes) NamespaceOrDefault(namespace string) string
- func (k *Kubernetes) NamespacesList(ctx context.Context, options ResourceListOptions) (runtime.Unstructured, error)
- func (k *Kubernetes) NewHelm() *helm.Helm
- func (k *Kubernetes) PodsDelete(ctx context.Context, namespace, name string) (string, error)
- func (k *Kubernetes) PodsExec(ctx context.Context, namespace, name, container string, command []string) (string, error)
- func (k *Kubernetes) PodsGet(ctx context.Context, namespace, name string) (*unstructured.Unstructured, error)
- func (k *Kubernetes) PodsListInAllNamespaces(ctx context.Context, options ResourceListOptions) (runtime.Unstructured, error)
- func (k *Kubernetes) PodsListInNamespace(ctx context.Context, namespace string, options ResourceListOptions) (runtime.Unstructured, error)
- func (k *Kubernetes) PodsLog(ctx context.Context, namespace, name, container string) (string, error)
- func (k *Kubernetes) PodsRun(ctx context.Context, namespace, name, image string, port int32) ([]*unstructured.Unstructured, error)
- func (k *Kubernetes) PodsTop(ctx context.Context, options PodsTopOptions) (*metrics.PodMetricsList, error)
- func (k *Kubernetes) ProjectsList(ctx context.Context, options ResourceListOptions) (runtime.Unstructured, error)
- func (k *Kubernetes) ResourcesCreateOrUpdate(ctx context.Context, resource string) ([]*unstructured.Unstructured, error)
- func (k *Kubernetes) ResourcesDelete(ctx context.Context, gvk *schema.GroupVersionKind, namespace, name string) error
- func (k *Kubernetes) ResourcesGet(ctx context.Context, gvk *schema.GroupVersionKind, namespace, name string) (*unstructured.Unstructured, error)
- func (k *Kubernetes) ResourcesList(ctx context.Context, gvk *schema.GroupVersionKind, namespace string, ...) (runtime.Unstructured, error)
- type Manager
- func (m *Manager) Close()
- func (m *Manager) ConfigurationView(minify bool) (runtime.Object, error)
- func (m *Manager) Derived(ctx context.Context) (*Kubernetes, error)
- func (m *Manager) GetAPIServerHost() string
- func (m *Manager) IsInCluster() bool
- func (m *Manager) IsOpenShift(_ context.Context) bool
- func (m *Manager) NamespaceOrDefault(namespace string) string
- func (m *Manager) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
- func (m *Manager) ToRESTConfig() (*rest.Config, error)
- func (m *Manager) ToRESTMapper() (meta.RESTMapper, error)
- func (m *Manager) ToRawKubeConfigLoader() clientcmd.ClientConfig
- func (m *Manager) VerifyToken(ctx context.Context, token, audience string) (*authenticationv1api.UserInfo, []string, error)
- func (m *Manager) WatchKubeConfig(onKubeConfigChange func() error)
- type PodsTopOptions
- type ResourceListOptions
Constants ¶
View Source
const ( CustomAuthorizationHeader = HeaderKey("kubernetes-authorization") OAuthAuthorizationHeader = HeaderKey("Authorization") CustomUserAgent = "kubernetes-mcp-server/bearer-token-auth" )
View Source
const ( AppKubernetesComponent = "app.kubernetes.io/component" AppKubernetesManagedBy = "app.kubernetes.io/managed-by" AppKubernetesName = "app.kubernetes.io/name" AppKubernetesPartOf = "app.kubernetes.io/part-of" )
Variables ¶
View Source
var InClusterConfig = func() (*rest.Config, error) { inClusterConfig, err := rest.InClusterConfig() if inClusterConfig != nil { inClusterConfig.Host = "https://kubernetes.default.svc" } return inClusterConfig, err }
InClusterConfig is a variable that holds the function to get the in-cluster config Exposed for testing
View Source
var ParameterCodec = runtime.NewParameterCodec(Scheme)
View Source
var Scheme = scheme.Scheme
Functions ¶
This section is empty.
Types ¶
type AccessControlClientset ¶
type AccessControlClientset struct {
// contains filtered or unexported fields
}
AccessControlClientset is a limited clientset delegating interface to the standard kubernetes.Clientset Only a limited set of functions are implemented with a single point of access to the kubernetes API where apiVersion and kinds are checked for allowed access
func NewAccessControlClientset ¶
func NewAccessControlClientset(cfg *rest.Config, staticConfig *config.StaticConfig) (*AccessControlClientset, error)
func (*AccessControlClientset) DiscoveryClient ¶
func (a *AccessControlClientset) DiscoveryClient() discovery.DiscoveryInterface
func (*AccessControlClientset) Pods ¶
func (a *AccessControlClientset) Pods(namespace string) (corev1.PodInterface, error)
func (*AccessControlClientset) PodsExec ¶
func (a *AccessControlClientset) PodsExec(namespace, name string, podExecOptions *v1.PodExecOptions) (remotecommand.Executor, error)
func (*AccessControlClientset) PodsMetricses ¶
func (a *AccessControlClientset) PodsMetricses(ctx context.Context, namespace, name string, listOptions metav1.ListOptions) (*metrics.PodMetricsList, error)
func (*AccessControlClientset) SelfSubjectAccessReviews ¶
func (a *AccessControlClientset) SelfSubjectAccessReviews() (authorizationv1.SelfSubjectAccessReviewInterface, error)
func (*AccessControlClientset) Services ¶
func (a *AccessControlClientset) Services(namespace string) (corev1.ServiceInterface, error)
func (*AccessControlClientset) TokenReview ¶
func (a *AccessControlClientset) TokenReview() (authenticationv1.TokenReviewInterface, error)
TokenReview returns TokenReviewInterface
type AccessControlRESTMapper ¶
type AccessControlRESTMapper struct {
// contains filtered or unexported fields
}
func NewAccessControlRESTMapper ¶
func NewAccessControlRESTMapper(delegate *restmapper.DeferredDiscoveryRESTMapper, staticConfig *config.StaticConfig) *AccessControlRESTMapper
func (AccessControlRESTMapper) KindFor ¶
func (a AccessControlRESTMapper) KindFor(resource schema.GroupVersionResource) (schema.GroupVersionKind, error)
func (AccessControlRESTMapper) KindsFor ¶
func (a AccessControlRESTMapper) KindsFor(resource schema.GroupVersionResource) ([]schema.GroupVersionKind, error)
func (AccessControlRESTMapper) RESTMapping ¶
func (a AccessControlRESTMapper) RESTMapping(gk schema.GroupKind, versions ...string) (*meta.RESTMapping, error)
func (AccessControlRESTMapper) RESTMappings ¶
func (a AccessControlRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) ([]*meta.RESTMapping, error)
func (AccessControlRESTMapper) Reset ¶
func (a AccessControlRESTMapper) Reset()
func (AccessControlRESTMapper) ResourceFor ¶
func (a AccessControlRESTMapper) ResourceFor(input schema.GroupVersionResource) (schema.GroupVersionResource, error)
func (AccessControlRESTMapper) ResourceSingularizer ¶
func (a AccessControlRESTMapper) ResourceSingularizer(resource string) (singular string, err error)
func (AccessControlRESTMapper) ResourcesFor ¶
func (a AccessControlRESTMapper) ResourcesFor(input schema.GroupVersionResource) ([]schema.GroupVersionResource, error)
type CloseWatchKubeConfig ¶
type CloseWatchKubeConfig func() error
type Kubernetes ¶
type Kubernetes struct {
// contains filtered or unexported fields
}
func (*Kubernetes) EventsList ¶
func (*Kubernetes) NamespaceOrDefault ¶
func (k *Kubernetes) NamespaceOrDefault(namespace string) string
func (*Kubernetes) NamespacesList ¶
func (k *Kubernetes) NamespacesList(ctx context.Context, options ResourceListOptions) (runtime.Unstructured, error)
func (*Kubernetes) NewHelm ¶
func (k *Kubernetes) NewHelm() *helm.Helm
func (*Kubernetes) PodsDelete ¶
func (*Kubernetes) PodsGet ¶
func (k *Kubernetes) PodsGet(ctx context.Context, namespace, name string) (*unstructured.Unstructured, error)
func (*Kubernetes) PodsListInAllNamespaces ¶
func (k *Kubernetes) PodsListInAllNamespaces(ctx context.Context, options ResourceListOptions) (runtime.Unstructured, error)
func (*Kubernetes) PodsListInNamespace ¶
func (k *Kubernetes) PodsListInNamespace(ctx context.Context, namespace string, options ResourceListOptions) (runtime.Unstructured, error)
func (*Kubernetes) PodsRun ¶
func (k *Kubernetes) PodsRun(ctx context.Context, namespace, name, image string, port int32) ([]*unstructured.Unstructured, error)
func (*Kubernetes) PodsTop ¶
func (k *Kubernetes) PodsTop(ctx context.Context, options PodsTopOptions) (*metrics.PodMetricsList, error)
func (*Kubernetes) ProjectsList ¶
func (k *Kubernetes) ProjectsList(ctx context.Context, options ResourceListOptions) (runtime.Unstructured, error)
func (*Kubernetes) ResourcesCreateOrUpdate ¶
func (k *Kubernetes) ResourcesCreateOrUpdate(ctx context.Context, resource string) ([]*unstructured.Unstructured, error)
func (*Kubernetes) ResourcesDelete ¶
func (k *Kubernetes) ResourcesDelete(ctx context.Context, gvk *schema.GroupVersionKind, namespace, name string) error
func (*Kubernetes) ResourcesGet ¶
func (k *Kubernetes) ResourcesGet(ctx context.Context, gvk *schema.GroupVersionKind, namespace, name string) (*unstructured.Unstructured, error)
func (*Kubernetes) ResourcesList ¶
func (k *Kubernetes) ResourcesList(ctx context.Context, gvk *schema.GroupVersionKind, namespace string, options ResourceListOptions) (runtime.Unstructured, error)
type Manager ¶
type Manager struct { CloseWatchKubeConfig CloseWatchKubeConfig // contains filtered or unexported fields }
func NewManager ¶
func NewManager(config *config.StaticConfig) (*Manager, error)
func (*Manager) ConfigurationView ¶
func (*Manager) GetAPIServerHost ¶
func (*Manager) IsInCluster ¶
func (*Manager) NamespaceOrDefault ¶
func (*Manager) ToDiscoveryClient ¶
func (m *Manager) ToDiscoveryClient() (discovery.CachedDiscoveryInterface, error)
func (*Manager) ToRESTConfig ¶
ToRESTConfig returns the rest.Config object (genericclioptions.RESTClientGetter)
func (*Manager) ToRESTMapper ¶
func (m *Manager) ToRESTMapper() (meta.RESTMapper, error)
func (*Manager) ToRawKubeConfigLoader ¶
func (m *Manager) ToRawKubeConfigLoader() clientcmd.ClientConfig
ToRawKubeConfigLoader returns the clientcmd.ClientConfig object (genericclioptions.RESTClientGetter)
func (*Manager) VerifyToken ¶
func (*Manager) WatchKubeConfig ¶
type PodsTopOptions ¶
type PodsTopOptions struct { metav1.ListOptions AllNamespaces bool Namespace string Name string }
type ResourceListOptions ¶
type ResourceListOptions struct { metav1.ListOptions AsTable bool }
Click to show internal directories.
Click to hide internal directories.