Documentation ¶
Index ¶
- func FixServices(pb *tpb.Node)
- func GetNextPort() uint32
- func Register(t tpb.Node_Type, fn NewNodeFn)
- func ToEnvVar(kv map[string]string) []corev1.EnvVar
- func ToResourceRequirements(kv map[string]string) corev1.ResourceRequirements
- func Vendor(v tpb.Vendor, fn NewNodeFn)
- type Certer
- type ConfigPusher
- type Impl
- func (n *Impl) Create(ctx context.Context) error
- func (n *Impl) CreateConfig(ctx context.Context) error
- func (n *Impl) CreatePod(ctx context.Context) error
- func (n *Impl) CreateService(ctx context.Context) error
- func (n *Impl) Delete(ctx context.Context) error
- func (n *Impl) DeleteConfig(ctx context.Context) error
- func (n *Impl) DeleteResource(ctx context.Context) error
- func (n *Impl) DeleteService(ctx context.Context) error
- func (n *Impl) Exec(ctx context.Context, cmd []string, stdin io.Reader, stdout io.Writer, ...) error
- func (n *Impl) GetNamespace() string
- func (n *Impl) GetProto() *tpb.Node
- func (n *Impl) Name() string
- func (n *Impl) Pod(ctx context.Context) (*corev1.Pod, error)
- func (n *Impl) Service(ctx context.Context) (*corev1.Service, error)
- func (n *Impl) Status(ctx context.Context) (corev1.PodPhase, error)
- type Implementation
- type Interface
- type NewNodeFn
- type Node
- type Resetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FixServices ¶
func GetNextPort ¶
func GetNextPort() uint32
func ToResourceRequirements ¶
func ToResourceRequirements(kv map[string]string) corev1.ResourceRequirements
Types ¶
type ConfigPusher ¶
ConfigPusher provides an interface for performing config pushes to the node.
type Impl ¶
type Impl struct { Namespace string KubeClient kubernetes.Interface RestConfig *rest.Config Proto *tpb.Node BasePath string }
Impl is a topology node in the cluster.
func (*Impl) Create ¶
Create will create the node in the k8s cluster with all services and config maps.
func (*Impl) CreateConfig ¶
CreateConfig creates a boot config for the node based on the underlying proto.
func (*Impl) CreateService ¶
CreateService creates services for the node based on the underlying proto.
func (*Impl) DeleteConfig ¶
DeleteConfig removes the node configmap from the cluster.
func (*Impl) DeleteResource ¶
DeleteResource removes the resource definition for the Node.
func (*Impl) DeleteService ¶
DeleteService removes the service definition for the Node.
func (*Impl) Exec ¶
func (n *Impl) Exec(ctx context.Context, cmd []string, stdin io.Reader, stdout io.Writer, stderr io.Writer) error
Exec will make a connection via spdy transport to the Pod and execute the provided command. It will wire up stdin, stdout, stderr to provided io channels.
func (*Impl) GetNamespace ¶
type Implementation ¶
type Implementation interface { // Create provides a custom implementation of pod creation // for a node type. Requires context, Kubernetes client interface and namespace. Create(context.Context) error // Status provides a custom implementation of accessing vendor node status. // Requires context, Kubernetes client interface and namespace. Status(context.Context) (corev1.PodPhase, error) // Delete provides a custom implementation of pod creation // for a node type. Requires context, Kubernetes client interface and namespace. Delete(context.Context) error Pod(context.Context) (*corev1.Pod, error) Service(context.Context) (*corev1.Service, error) }
type Node ¶
type Node interface { Interface Implementation }
Node is the base interface for all node implementations in KNE.