Documentation ¶
Index ¶
- type App
- type Client
- func (ks *Client) ApplyNetworkPolicy(ctx context.Context, nodeID, appID string, policy *networkingV1.NetworkPolicy) error
- func (ks *Client) DeleteNetworkPolicy(ctx context.Context, nodeID, appID string) error
- func (ks *Client) Deploy(ctx context.Context, nodeID string, app App) error
- func (ks *Client) GetAppIDByIP(ctx context.Context, nodeID, ipAddr string) (string, error)
- func (ks *Client) GetNetworkPolicy(ctx context.Context, nodeID, appID string) (*networkingV1.NetworkPolicy, error)
- func (ks *Client) Ping() error
- func (ks *Client) Restart(ctx context.Context, nodeID, appID string) error
- func (ks *Client) Start(ctx context.Context, nodeID, appID string) error
- func (ks *Client) Status(ctx context.Context, nodeID, appID string) (LifecycleStatus, error)
- func (ks *Client) Stop(ctx context.Context, nodeID, appID string) error
- func (ks *Client) Undeploy(ctx context.Context, nodeID, appID string) error
- type LifecycleStatus
- type PortProto
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Host must be a host string, a host:port pair, or a URL to the base of the apiserver. // If a URL is given then the (optional) Path of that URL represents a prefix that must // be appended to all request URIs used to access the apiserver. This allows a frontend // proxy to easily relocate all of the apiserver endpoints. Host string // APIPath is a sub-path that points to an API root. APIPath string // Authentication info Username string CertFile string KeyFile string CAFile string // ImagePullPolicy specifies container retrieval policy. If not provided, // PullNever policy will be used. This field is intended for overriding default // policy for testing. ImagePullPolicy apiV1.PullPolicy // NewClientSet creates a new Kubernetes clientset interface. If it is nil, // a REST client with TLS will be used. This field is intended for use // mocking an external connection. NewClientSet func() (kubernetes.Interface, error) // contains filtered or unexported fields }
Client abstracts calls to k8s master API
func (*Client) ApplyNetworkPolicy ¶
func (ks *Client) ApplyNetworkPolicy(ctx context.Context, nodeID, appID string, policy *networkingV1.NetworkPolicy) error
ApplyNetworkPolicy applies network policy for app on specified node
func (*Client) DeleteNetworkPolicy ¶
DeleteNetworkPolicy deletes network policy for app on specified node
func (*Client) GetAppIDByIP ¶
GetAppIDByIP gets the ID of an application running on a node by its pod IP address
func (*Client) GetNetworkPolicy ¶
func (ks *Client) GetNetworkPolicy(ctx context.Context, nodeID, appID string) (*networkingV1.NetworkPolicy, error)
GetNetworkPolicy returns network policy for app on specified node
func (*Client) Restart ¶
Restart scales down the number of replicas of kubernetes deployment to 0 and then scale up to 1.
type LifecycleStatus ¶
type LifecycleStatus string
LifecycleStatus is a kubernetes deployment's status.
const ( // Unknown means status of the pod is currently unknown Unknown LifecycleStatus = "unknown" // Deployed means the deployment is created, but no pod is running Deployed LifecycleStatus = "deployed" // Pending means the deployment is created and pod is yet to be created Pending LifecycleStatus = "pending" // Starting means the pod is starting Starting LifecycleStatus = "starting" // Running means the pod is currently running Running LifecycleStatus = "running" // Terminating means the pod is being terminated Terminating LifecycleStatus = "terminating" // Error means error occurred Error LifecycleStatus = "error" )
Click to show internal directories.
Click to hide internal directories.