Documentation
¶
Index ¶
- Variables
- func Clientset(overrides ...OverrideOption) (*kubernetes.Clientset, error)
- func Config(overrides ...OverrideOption) clientcmd.ClientConfig
- func FreePort() (int, error)
- func Install(client *kubernetes.Clientset, opts ...InstallOption) error
- func RestClient(overrides ...OverrideOption) (*rest.Config, kubernetes.Interface, error)
- type InstallOption
- func InstallWithDeploymentName(name string) InstallOption
- func InstallWithLabels(labels map[string]string) InstallOption
- func InstallWithNamerdHost(name string) InstallOption
- func InstallWithNamespace(name string) InstallOption
- func InstallWithRBAC() InstallOption
- func InstallWithVersion(version string) InstallOption
- func WithInastallServiceAccount(name string) InstallOption
- type InstallOptions
- type OverrideOption
- type Tunnel
- type TunnelOption
- type TunnelOptions
Constants ¶
This section is empty.
Variables ¶
var ( ErrPodNotFound = errors.New("pod not found") ErrPodNotReady = errors.New("pod not ready") )
Pod Errors
var DefaultInstallOptions = InstallOptions{ Namespace: "kube-system", Labels: map[string]string{ "name": "needle", "app": "compass", }, RBAC: false, ServiceAccountName: "needle", DeoploymentName: "needle", Replicas: 1, PGPVClaimName: "needle-postgres-pv", PGPassword: "", PGPWSecretName: "needle-postgres-password", PGPWSecretKey: "password", }
Default install options - these can be modified using Option functions
var DefaultTunnelOptions = TunnelOptions{ Namespace: "kube-system", PodLabels: labels.Set{ "name": "needle", "app": "compass", }, RemotePort: 5000, }
Default Tunnel Options
Functions ¶
func Clientset ¶
func Clientset(overrides ...OverrideOption) (*kubernetes.Clientset, error)
Clientset creates a new kubernetes Clientset
func Config ¶
func Config(overrides ...OverrideOption) clientcmd.ClientConfig
Returns a kubernetes client config - with no overrides
func Install ¶
func Install(client *kubernetes.Clientset, opts ...InstallOption) error
Install will intall neeedle into a k8s cluster
func RestClient ¶
func RestClient(overrides ...OverrideOption) (*rest.Config, kubernetes.Interface, error)
RestClient creates a Kubernetes config and client for a given kubeconfig context.
Types ¶
type InstallOption ¶
type InstallOption func(*InstallOptions)
An Option can configure InstallOptions
func InstallWithDeploymentName ¶
func InstallWithDeploymentName(name string) InstallOption
WithDeploymentName sets the deployment name
func InstallWithLabels ¶
func InstallWithLabels(labels map[string]string) InstallOption
WithLabels sets the labels used for the needle install
func InstallWithNamerdHost ¶
func InstallWithNamerdHost(name string) InstallOption
InstallWithNamerdHost sets the namerd configuration
func InstallWithNamespace ¶
func InstallWithNamespace(name string) InstallOption
WithNamespace sets the namespace needle should be installed into
func InstallWithRBAC ¶
func InstallWithRBAC() InstallOption
WithRBAC enables RBAC roles to be created for needle on install
func InstallWithVersion ¶
func InstallWithVersion(version string) InstallOption
InstallWithVersion sets the version to install
func WithInastallServiceAccount ¶
func WithInastallServiceAccount(name string) InstallOption
WithServiceAccount sets the service account name
type InstallOptions ¶
type InstallOptions struct { Namespace string RBAC bool ServiceAccountName string DeoploymentName string Replicas int32 Labels map[string]string NamerdHost string PGPVClaimName string PGPassword string PGPWSecretName string PGPWSecretKey string Version string }
InstallOptions configures the installation of needle into a k8s cluster
type OverrideOption ¶
type OverrideOption func(o *clientcmd.ConfigOverrides)
Allows kubernetes config overrides
func WithCurrentContext ¶
func WithCurrentContext(c string) OverrideOption
WithCurrentContext overrides a kubernetes client context
type Tunnel ¶
type Tunnel struct { // Options to configure the tunnel Options TunnelOptions // contains filtered or unexported fields }
Tunnel opens a tunnel to a kubernetes port locally
func (*Tunnel) LocalAddress ¶
LocalAddress returns the local address, e.g 127.0.0.1:12345
type TunnelOption ¶
type TunnelOption func(o *TunnelOptions)
An Option configures a Tunnel
func TunnelWithNamespace ¶
func TunnelWithNamespace(namespace string) TunnelOption
WithPodName returns an Option for configuring the namespace
func TunnelWithPodLabels ¶
func TunnelWithPodLabels(labels labels.Set) TunnelOption
TunnelWithPodLabels sets the pod labels to tunnel too
func TunnelWithRemotePort ¶
func TunnelWithRemotePort(port int) TunnelOption
WithRemotePort returns an Option for configuring the Tunnel remote port