Documentation
¶
Overview ¶
k8sutil is utilites to operate the k8s clusters
Index ¶
- func BuildClusterConfig(masterURL, kubeconfigPath string) (*rest.Config, error)
- func CascadeDeleteOptions(gracePeriodSeconds int64) *metav1.DeleteOptions
- func CreateOrUpdateEndpoints(eclient clientv1.EndpointsInterface, eps *corev1.Endpoints) error
- func CreateOrUpdateService(sclient clientv1.ServiceInterface, svc *corev1.Service) error
- func CreatePatch(o, n, datastruct interface{}) ([]byte, error)
- func CreateRecorder(kubecli kubernetes.Interface, name, namespace string) record.EventRecorder
- func IsResourceNotFoundError(err error) bool
- func PatchDeployment(kubecli kubernetes.Interface, namespace, name string, ...) error
- func PodRunningAndReady(pod corev1.Pod) (bool, error)
- type Tunnel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildClusterConfig ¶
BuildClusterConfig returns a config from masterUrl or kubeconfigPath, kubeconfigPath default is ~/.kube/config
func CascadeDeleteOptions ¶
func CascadeDeleteOptions(gracePeriodSeconds int64) *metav1.DeleteOptions
func CreateOrUpdateEndpoints ¶
func CreateOrUpdateEndpoints(eclient clientv1.EndpointsInterface, eps *corev1.Endpoints) error
CreateOrUpdateEndpoints creates or updates the endpoints
func CreateOrUpdateService ¶
func CreateOrUpdateService(sclient clientv1.ServiceInterface, svc *corev1.Service) error
CreateOrUpdateService creates or updates the given service
func CreatePatch ¶
func CreateRecorder ¶
func CreateRecorder(kubecli kubernetes.Interface, name, namespace string) record.EventRecorder
CreateRecorder returns a new event recorder
func IsResourceNotFoundError ¶
IsResourceNotFoundError checks if it is a NotFoundError
func PatchDeployment ¶
func PatchDeployment(kubecli kubernetes.Interface, namespace, name string, updateFunc func(*appsv1.Deployment)) error
Types ¶
type Tunnel ¶
type Tunnel struct { Local int Remote int Namespace string PodName string Out io.Writer // contains filtered or unexported fields }
Tunnel describes a ssh-like tunnel to a kubernetes pod
func NewTunnel ¶
func NewTunnel(client rest.Interface, config *rest.Config, namespace, podName string, remote int) *Tunnel
NewTunnel creates a new tunnel
func (*Tunnel) ForwardPort ¶
ForwardPort opens a tunnel to a kubernetes pod
Click to show internal directories.
Click to hide internal directories.