cmd

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2018 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTaintEffect = corev1.TaintEffectNoSchedule
	DefaultTaintKey    = "virtual-kubelet.io/provider"
)

Default taint values

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "virtual-kubelet",
	Short: "virtual-kubelet provides a virtual kubelet interface for your kubernetes cluster.",
	Long: `virtual-kubelet implements the Kubelet interface with a pluggable 
backend implementation allowing users to create kubernetes nodes without running the kubelet.
This allows users to schedule kubernetes workloads on nodes that aren't running Kubernetes.`,
	Run: func(cmd *cobra.Command, args []string) {
		ctx, cancel := context.WithCancel(context.Background())

		f, err := vkubelet.New(ctx, vkubelet.Config{
			Client:          k8sClient,
			Namespace:       kubeNamespace,
			NodeName:        nodeName,
			Taint:           taint,
			MetricsAddr:     metricsAddr,
			Provider:        p,
			ResourceManager: rm,
			APIConfig:       apiConfig,
			PodSyncWorkers:  podSyncWorkers,
		})
		if err != nil {
			log.L.WithError(err).Fatal("Error initializing virtual kubelet")
		}

		sig := make(chan os.Signal, 1)
		signal.Notify(sig, syscall.SIGINT, syscall.SIGTERM)
		go func() {
			<-sig
			f.Stop()
			cancel()
		}()

		if err := f.Run(ctx); err != nil && errors.Cause(err) != context.Canceled {
			log.L.Fatal(err)
		}
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func AvailableTraceExporters added in v0.6.3

func AvailableTraceExporters() []string

AvailableTraceExporters gets the list of registered exporters

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetTracingExporter added in v0.6.3

func GetTracingExporter(name string, opts TracingExporterOptions) (trace.Exporter, error)

GetTracingExporter gets the specified tracing exporter passing in the options to the exporter init function. For an exporter to be availbale here it must be registered with `RegisterTracingExporter`.

func NewJaegerExporter added in v0.6.3

func NewJaegerExporter(opts TracingExporterOptions) (trace.Exporter, error)

NewJaegerExporter creates a new opencensus tracing exporter.

func RegisterTracingExporter added in v0.6.3

func RegisterTracingExporter(name string, f TracingExporterInitFunc)

RegisterTracingExporter registers a tracing exporter. For a user to select an exporter, it must be registered here.

Types

type TracingExporterInitFunc added in v0.6.3

type TracingExporterInitFunc func(TracingExporterOptions) (trace.Exporter, error)

TracingExporterInitFunc is the function that is called to initialize an exporter. This is used when registering an exporter and called when a user specifed they want to use the exporter.

type TracingExporterOptions added in v0.6.3

type TracingExporterOptions struct {
	Tags        map[string]string
	ServiceName string
}

TracingExporterOptions is used to pass options to the configured tracer

Jump to

Keyboard shortcuts

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