Documentation ¶
Index ¶
- Constants
- func BuildDefaultPortMap(remotePort int32) []string
- func WithConfigPath(path string) func(c *Client)
- func WithNamespace(namespace string) func(c *Client)
- type ApplyOptions
- type Client
- func (c *Client) Apply(schema schema.GroupVersionResource, resource *unstructured.Unstructured, ...) error
- func (c *Client) ConfigMap(namespace, name string, opts metav1.GetOptions) (*corev1.ConfigMap, error)
- func (c *Client) ConfigMaps(namespace string, opts metav1.ListOptions) ([]corev1.ConfigMap, error)
- func (c *Client) CreateDeployment(namespace string, deployment *appsv1.Deployment, opts metav1.CreateOptions) error
- func (c *Client) CreateIngress(namespace string, ingress *networkingv1.Ingress, opts metav1.CreateOptions) error
- func (c *Client) CreatePod(namespace string, pod *corev1.Pod, opts metav1.CreateOptions) error
- func (c *Client) CreateSecret(namespace string, secret *corev1.Secret, opts metav1.CreateOptions) error
- func (c *Client) CreateService(namespace string, service *corev1.Service, opts metav1.CreateOptions) error
- func (c *Client) Exec(command string, pod corev1.Pod) (string, string, error)
- func (c *Client) Ingresses(namespace string, opts metav1.ListOptions) ([]networkingv1.Ingress, error)
- func (c *Client) Namespaces(opts metav1.ListOptions) ([]corev1.Namespace, error)
- func (c *Client) Pods(namespace string, opts metav1.ListOptions) ([]corev1.Pod, error)
- func (c *Client) PortForward(ctx context.Context, pod corev1.Pod) error
- func (c *Client) Secrets(namespace string, opts metav1.ListOptions) ([]corev1.Secret, error)
- func (c *Client) Service(namespace, name string, opts metav1.GetOptions) (*corev1.Service, error)
- func (c *Client) Services(namespace string, opts metav1.ListOptions) ([]corev1.Service, error)
- type DefaultPortForwarder
- type DefaultRemoteExecutor
- type Opt
- type PortForwarder
- type RemoteExecutor
Constants ¶
View Source
const ( DefaultNamespace = "default" DefaultLocalPort = "7150" )
Variables ¶
This section is empty.
Functions ¶
func BuildDefaultPortMap ¶
only require remoteport as input
func WithConfigPath ¶
WithConfigPath configures the KubeClient with a predetermined path for the 'kubeconfig' file This avoids the usual searches done within findKubeConfig
func WithNamespace ¶
WithNamespace configures the KubeClient with a custom default namespace
Types ¶
type ApplyOptions ¶
type ApplyOptions struct { Name string GetOptions *metav1.GetOptions CreateOptions *metav1.CreateOptions UpdateOptions *metav1.UpdateOptions }
type Client ¶ added in v1.0.1
type Client struct { // ConfigPath is the configuration file path for which the current client(-set) was created ConfigPath string // Executor is the connection between local and remote IO streams Executor RemoteExecutor // PortForwarder is the implementation for the port-forward functionality PortForwarder PortForwarder // Config is the rest.Config for which the client was built Config *rest.Config // Client is the embedded Kubernetes ClientSet Client *kubernetes.Clientset // flags are the Kubernetes-specific flags which will be injected into the CLI Flags *genericclioptions.ConfigFlags // contains filtered or unexported fields }
func (*Client) Apply ¶ added in v1.0.1
func (c *Client) Apply(schema schema.GroupVersionResource, resource *unstructured.Unstructured, opts *ApplyOptions) error
func (*Client) ConfigMaps ¶ added in v1.0.1
func (*Client) CreateDeployment ¶ added in v1.0.1
func (c *Client) CreateDeployment(namespace string, deployment *appsv1.Deployment, opts metav1.CreateOptions) error
func (*Client) CreateIngress ¶ added in v1.0.1
func (c *Client) CreateIngress(namespace string, ingress *networkingv1.Ingress, opts metav1.CreateOptions) error
func (*Client) CreateSecret ¶ added in v1.0.1
func (*Client) CreateService ¶ added in v1.0.1
func (*Client) Exec ¶ added in v1.0.1
Exec executes a command within the container of a specific Pod in the current namespace configured for the client. If another namespace is required the ExecInNamespace helper provides an escape hatch
func (*Client) Ingresses ¶ added in v1.0.1
func (c *Client) Ingresses(namespace string, opts metav1.ListOptions) ([]networkingv1.Ingress, error)
func (*Client) Namespaces ¶ added in v1.0.1
func (*Client) PortForward ¶ added in v1.0.1
PortForward port-forwards a remote port of a Kubernetes container to the local machine
type DefaultPortForwarder ¶
type DefaultPortForwarder struct{}
func (*DefaultPortForwarder) ForwardPorts ¶
type DefaultRemoteExecutor ¶
type DefaultRemoteExecutor struct{}
DefaultRemoteExecutor is the standard implementation of remote command execution
type PortForwarder ¶
Click to show internal directories.
Click to hide internal directories.