Back to godoc.org

Package cmd

v0.9.1
Latest Go to latest

The highest tagged major version is .

Published: May 6, 2019 | License: Apache-2.0 | Module: github.com/Netflix-Skunkworks/virtual-kubelet

Index

Constants

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

Default taint values

Variables

var AcceptedCiphers = []uint16{
	tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,
	tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,
	tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,
	tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,

	tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
	tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
	tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
	tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
}

AcceptedCiphers is the list of accepted TLS ciphers, with known weak ciphers elided Note this list should be a moving target.

var RootCmd = &cobra.Command{
	Use:   "virtual-kubelet",
	Short: "virtual-kubelet provides a virtual kubelet interface for your kubernetes cluster.",
	Long:  "" /* 251 byte string literal not displayed */,

	Run: func(cmd *cobra.Command, args []string) {
		initConfig()

		defer rootContextCancel()

		pNode := NodeFromProvider(rootContext, nodeName, taint, p)
		node, err := vkubelet.NewNode(
			vkubelet.NaiveNodeProvider{},
			pNode,
			k8sClient.Coordination().Leases(corev1.NamespaceNodeLease),
			k8sClient.CoreV1().Nodes(),
			vkubelet.WithNodeDisableLease(!enableNodeLease),
		)
		if err != nil {
			log.G(rootContext).Fatal(err)
		}

		vk := vkubelet.New(vkubelet.Config{
			Client:          k8sClient,
			Namespace:       kubeNamespace,
			NodeName:        pNode.Name,
			Provider:        p,
			ResourceManager: rm,
			PodSyncWorkers:  podSyncWorkers,
			PodInformer:     podInformer,
		})

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

		cancelHTTP, err := setupHTTPServer(rootContext, apiConfig)
		if err != nil {
			log.G(rootContext).Fatal(err)
		}
		defer cancelHTTP()

		go func() {
			if err := vk.Run(rootContext); err != nil && errors.Cause(err) != context.Canceled {
				log.G(rootContext).Fatal(err)
			}
		}()

		go func() {
			if err := node.Run(rootContext); err != nil {
				log.G(rootContext).Fatal(err)
			}
		}()
		<-rootContext.Done()
	},
}

RootCmd represents the base command when called without any subcommands

func AvailableTraceExporters

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

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

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

NewJaegerExporter creates a new opencensus tracing exporter.

func NewOCAgentExporter

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

NewOCAgentExporter creates a new opencensus tracing exporter using the opencensus agent forwarder.

func NodeFromProvider

func NodeFromProvider(ctx context.Context, name string, taint *v1.Taint, p providers.Provider) *v1.Node

NodeFromProvider builds a kubernetes node object from a provider This is a temporary solution until node stuff actually split off from the provider interface itself.

func RegisterTracingExporter

func RegisterTracingExporter(name string, f TracingExporterInitFunc)

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

type TracingExporterInitFunc

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

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

TracingExporterOptions is used to pass options to the configured tracer

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier