krd

package
v0.0.0-...-d82845d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetKubeClient = func(configPath string) (kubernetes.Clientset, error) {
	var clientset *kubernetes.Clientset

	if configPath == "" {
		return *clientset, errors.New("config not passed and is not found in ~/.kube. ")
	}

	config, err := clientcmd.BuildConfigFromFlags("", configPath)
	if err != nil {
		return *clientset, pkgerrors.Wrap(err, "setConfig: Build config from flags raised an error")
	}

	clientset, err = kubernetes.NewForConfig(config)
	if err != nil {
		return *clientset, err
	}

	return *clientset, nil
}

GetKubeClient loads the Kubernetes configuation values stored into the local configuration file

View Source
var LoadedPlugins = map[string]*plugin.Plugin{}

LoadedPlugins stores references to the stored plugins

Functions

This section is empty.

Types

type GenericKubeResourceData

type GenericKubeResourceData struct {
	YamlFilePath  string
	Namespace     string
	InternalVNFID string

	// Add additional Kubernetes plugins below kinds
	DeploymentData *appsV1.Deployment
	ServiceData    *coreV1.Service
}

GenericKubeResourceData is a struct which stores all supported Kubernetes plugin types

type KubeResourceClient

type KubeResourceClient interface {
	CreateResource(GenericKubeResourceData, *kubernetes.Clientset) (string, error)
	ListResources(string, string) (*[]string, error)
	DeleteResource(string, string, *kubernetes.Clientset) error
	GetResource(string, string, *kubernetes.Clientset) (string, error)
}

KubeResourceClient has the signature methods to create Kubernetes reources

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL