Documentation ¶
Index ¶
- Constants
- func AttachStream(client *kubernetes.Clientset, pod *k8sv1.Pod, container string, tty bool, ...) error
- func AttachStreamWithTransport(transport http.RoundTripper, upgrader spdy.Upgrader, ...) error
- func DescribePod(namespace, name string) (string, error)
- func EnsureDefaultNamespace(client *kubernetes.Clientset, log log.Logger) error
- func EnsureGoogleCloudClusterRoleBinding(client *kubernetes.Clientset, log log.Logger) error
- func ExecBuffered(kubectlClient *kubernetes.Clientset, pod *k8sv1.Pod, container string, ...) ([]byte, []byte, error)
- func ExecStream(client *kubernetes.Clientset, pod *k8sv1.Pod, container string, ...) error
- func ExecStreamWithTransport(transport http.RoundTripper, upgrader spdy.Upgrader, ...) error
- func ForwardPorts(kubectlClient *kubernetes.Clientset, pod *k8sv1.Pod, ports []string, ...) error
- func GetClientConfig() (*rest.Config, error)
- func GetNewestRunningPod(kubectl *kubernetes.Clientset, labelSelector, namespace string, ...) (*k8sv1.Pod, error)
- func GetPodStatus(pod *k8sv1.Pod) string
- func GetPodsFromDeployment(kubectl *kubernetes.Clientset, deployment, namespace string) (*k8sv1.PodList, error)
- func IsMinikube() bool
- func NewClient() (*kubernetes.Clientset, error)
- func NewClientWithContextSwitch(switchContext bool) (*kubernetes.Clientset, error)
- func NewPortForwarder(kubectlClient *kubernetes.Clientset, pod *k8sv1.Pod, ports []string, ...) (*portforward.PortForwarder, error)
Constants ¶
const ClusterRoleBindingName = "devspace-user"
ClusterRoleBindingName is the name of the cluster role binding that ensures that the user has enough rights
Variables ¶
This section is empty.
Functions ¶
func AttachStream ¶
func AttachStream(client *kubernetes.Clientset, pod *k8sv1.Pod, container string, tty bool, stdin io.Reader, stdout io.Writer, stderr io.Writer) error
AttachStream attaches to a container in a certain pod
func AttachStreamWithTransport ¶
func AttachStreamWithTransport(transport http.RoundTripper, upgrader spdy.Upgrader, client *kubernetes.Clientset, pod *k8sv1.Pod, container string, tty bool, stdin io.Reader, stdout io.Writer, stderr io.Writer) error
AttachStreamWithTransport attaches to a certain container
func DescribePod ¶
DescribePod returns a desription string of a pod (internally calls the kubectl describe function)
func EnsureDefaultNamespace ¶
func EnsureDefaultNamespace(client *kubernetes.Clientset, log log.Logger) error
EnsureDefaultNamespace makes sure the default namespace exists or will be created
func EnsureGoogleCloudClusterRoleBinding ¶
func EnsureGoogleCloudClusterRoleBinding(client *kubernetes.Clientset, log log.Logger) error
EnsureGoogleCloudClusterRoleBinding makes sure the needed cluster role is created in the google cloud or a warning is printed
func ExecBuffered ¶
func ExecBuffered(kubectlClient *kubernetes.Clientset, pod *k8sv1.Pod, container string, command []string) ([]byte, []byte, error)
ExecBuffered executes a command for kubernetes and returns the output and error buffers
func ExecStream ¶
func ExecStream(client *kubernetes.Clientset, pod *k8sv1.Pod, container string, command []string, tty bool, stdin io.Reader, stdout io.Writer, stderr io.Writer) error
ExecStream executes a command and streams the output to the given streams
func ExecStreamWithTransport ¶
func ExecStreamWithTransport(transport http.RoundTripper, upgrader spdy.Upgrader, client *kubernetes.Clientset, pod *k8sv1.Pod, container string, command []string, tty bool, stdin io.Reader, stdout io.Writer, stderr io.Writer) error
ExecStreamWithTransport executes a kubectl exec with given transport round tripper and upgrader
func ForwardPorts ¶
func ForwardPorts(kubectlClient *kubernetes.Clientset, pod *k8sv1.Pod, ports []string, addresses []string, stopChan chan struct{}, readyChan chan struct{}) error
ForwardPorts forwards the specified ports on the specified interface addresses from the cluster to the local machine
func GetClientConfig ¶
GetClientConfig loads the configuration for kubernetes clients and parses it to *rest.Config
func GetNewestRunningPod ¶
func GetNewestRunningPod(kubectl *kubernetes.Clientset, labelSelector, namespace string, maxWaiting time.Duration) (*k8sv1.Pod, error)
GetNewestRunningPod retrieves the first pod that is found that has the status "Running" using the label selector string
func GetPodStatus ¶
GetPodStatus returns the pod status as a string Taken from https://github.com/kubernetes/kubernetes/pkg/printers/internalversion/printers.go
func GetPodsFromDeployment ¶
func GetPodsFromDeployment(kubectl *kubernetes.Clientset, deployment, namespace string) (*k8sv1.PodList, error)
GetPodsFromDeployment retrieves all found pods from a deployment name
func IsMinikube ¶
func IsMinikube() bool
IsMinikube returns true if the Kubernetes cluster is a minikube
func NewClient ¶
func NewClient() (*kubernetes.Clientset, error)
NewClient creates a new kubernetes client
func NewClientWithContextSwitch ¶
func NewClientWithContextSwitch(switchContext bool) (*kubernetes.Clientset, error)
NewClientWithContextSwitch creates a new kubernetes client and switches the kubectl context
func NewPortForwarder ¶
func NewPortForwarder(kubectlClient *kubernetes.Clientset, pod *k8sv1.Pod, ports []string, addresses []string, stopChan chan struct{}, readyChan chan struct{}) (*portforward.PortForwarder, error)
NewPortForwarder creates a new port forwarder object for the specified pods, ports and addresses
Types ¶
This section is empty.