Documentation
¶
Index ¶
- Constants
- Variables
- func AddRPC(path string) error
- func AllInit(kubeConfigPath string, verbose bool, with []string) error
- func Banner()
- func BusyboxDeployment(name string) *v1.Deployment
- func Client() (*kubernetes.Clientset, error)
- func ClientFromFlags(apiUrl, kubeConfigPath string) (*kubernetes.Clientset, error)
- func ClientFromPath(kubeConfigPath string) (*kubernetes.Clientset, error)
- func I32p(i int32) *int32
- func I64p(i int64) *int64
- func Install(app Deployable) error
- func List()
- func Register(app Deployable)
- func RegisterAndError(app Deployable) error
- func RegisterAndExit(app Deployable)
- func RegisterRemoteApplications() error
- func Registry() map[string]Deployable
- func RunCommandLine() error
- func RunCommandLineAndExit()
- func RunCommandLineWithOptions() error
- func RunRPC() error
- func Stringp(i string) *string
- func TestClusterKubeConfigPath() string
- func TestClusterStart() error
- func TestClusterStop() error
- func Uninstall(app Deployable) error
- type Deployable
- type RPCApplication
- type RPCError
- type RPCPointer
Constants ¶
const ( KubeconfigEnvironmentalVariable = "KUBECONFIG" KubeconfigDefaultDirectory = ".kube" KubeconfigDefaultFile = "config" )
const ( // TestClusterName is used to identify the test cluster with Kind. TestClusterName string = "namltestcluster" )
Variables ¶
var Version string
Version is this specific version on naml
Functions ¶
func AllInit ¶
AllInit is the "constructor" for every command line flag. This is how we use naml -w to include sub-namls
func BusyboxDeployment ¶
func BusyboxDeployment(name string) *v1.Deployment
BusyboxDeployment is useful for quick testing and debugging. This is broken by design.
func Client ¶
func Client() (*kubernetes.Clientset, error)
Client is used to authenticate with Kubernetes and build the Kube client for the rest of the program.
func ClientFromFlags ¶
func ClientFromFlags(apiUrl, kubeConfigPath string) (*kubernetes.Clientset, error)
ClientFromFlags will plumb well-known command line flags through to the kubeconfig
func ClientFromPath ¶
func ClientFromPath(kubeConfigPath string) (*kubernetes.Clientset, error)
ClientFromPath is used to authenticate with Kubernetes and build the Kube client for the rest of the program given a specific kube config path.
Useful for testing.
func Install ¶
func Install(app Deployable) error
Install is used to install an application in Kubernetes
func RegisterAndError ¶
func RegisterAndError(app Deployable) error
func RegisterAndExit ¶
func RegisterAndExit(app Deployable)
RegisterAndExit will register the app or exit with an error message in stdout
func RegisterRemoteApplications ¶
func RegisterRemoteApplications() error
RegisterRemoteApplications will call list() on all remote RPC servers and register the applications as pointers on the remote.
func RunCommandLine ¶
func RunCommandLine() error
RunCommandLine is the global NAML command line program.
Use this if you would like to use the built in NAML command line interface.
func RunCommandLineAndExit ¶
func RunCommandLineAndExit()
func RunCommandLineWithOptions ¶
func RunCommandLineWithOptions() error
RunCommandLineWithOptions is here so we can default values in RunCommandLine() that we would want to pass in here later (tests, etc)
func RunRPC ¶
func RunRPC() error
RunRPC will run in RPC mode.
TODO: Nóva to come add security auth and validation to our RPC
func TestClusterKubeConfigPath ¶
func TestClusterKubeConfigPath() string
TestClusterKubeConfigPath will export the kubeconfig path to this directory to use for the client in the tests.
func TestClusterStart ¶
func TestClusterStart() error
TestClusterStart can be used to start the test cluster in the TestMain() function.
func TestClusterStop ¶
func TestClusterStop() error
TestClusterStop can be used to stop the test cluster in the TestMain() function.
func Uninstall ¶
func Uninstall(app Deployable) error
Uninstall is used to uninstall an application in Kubernetes
Types ¶
type Deployable ¶
type Deployable interface {
// Install will attempt to install in Kubernetes
Install(client *kubernetes.Clientset) error
// Uninstall will attempt to uninstall in Kubernetes
Uninstall(client *kubernetes.Clientset) error
// Meta returns the Kubernetes native ObjectMeta which is used to manage applications with naml.
Meta() *v1.ObjectMeta
// Description returns the application description
Description() string
}
Deployable is an interface that can be implemented for deployable applications.
type RPCApplication ¶
type RPCApplication struct {
// Name is the name of the remote application
AppName string
// Remote is the associated remote RPC server
Remote *RPCPointer
// AppDescription is the application description
AppDescription string
// AppVersion is the application version
AppVersion string
}
RPCApplication is the pointer in the parent process to the child process internal application.
func (*RPCApplication) Description ¶
func (c *RPCApplication) Description() string
func (*RPCApplication) Install ¶
func (c *RPCApplication) Install(clientset *kubernetes.Clientset) error
Install is the remote application install wrapper.
func (*RPCApplication) Meta ¶
func (c *RPCApplication) Meta() *v1.ObjectMeta
func (*RPCApplication) Uninstall ¶
func (c *RPCApplication) Uninstall(clientset *kubernetes.Clientset) error
type RPCError ¶
type RPCError struct {
Message string
}
RPCError is when something goes wrong over the RPC
type RPCPointer ¶
RPCPointer is a pointer that allows us to connect to a remote RPC server