expose

package
v0.28.10 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: Apache-2.0 Imports: 25 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCmdExposeService

func NewCmdExposeService(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command

NewCmdExposeService is a command to expose the service from user's input

Types

type ExposeServiceFlags added in v0.28.0

type ExposeServiceFlags struct {
	cmdutil.OverrideOptions
	PrintFlags  *genericclioptions.PrintFlags
	RecordFlags *genericclioptions.RecordFlags

	Protocol string

	// Port will be used if a user specifies --port OR the exposed object as one port
	Port            string
	Type            string
	LoadBalancerIP  string
	Selector        string
	Labels          string
	TargetPort      string
	ExternalIP      string
	Name            string
	SessionAffinity string
	ClusterIP       string
	Recorder        genericclioptions.Recorder
	FilenameOptions resource.FilenameOptions
	genericiooptions.IOStreams
	// contains filtered or unexported fields
}

exposeServiceFlags is a struct that contains the user input flags to the command.

func NewExposeFlags added in v0.28.0

func NewExposeFlags(ioStreams genericiooptions.IOStreams) *ExposeServiceFlags

func (*ExposeServiceFlags) AddFlags added in v0.28.0

func (flags *ExposeServiceFlags) AddFlags(cmd *cobra.Command)

func (*ExposeServiceFlags) ToOptions added in v0.28.0

func (flags *ExposeServiceFlags) ToOptions(cmd *cobra.Command, args []string) (*ExposeServiceOptions, error)

type ExposeServiceOptions

type ExposeServiceOptions struct {
	cmdutil.OverrideOptions

	FilenameOptions resource.FilenameOptions
	RecordFlags     *genericclioptions.RecordFlags
	PrintFlags      *genericclioptions.PrintFlags
	PrintObj        printers.ResourcePrinterFunc

	Name        string
	DefaultName string
	Selector    string
	// Port will be used if a user specifies --port OR the exposed object as one port
	Port string
	// Ports will be used iff a user doesn't specify --port AND the exposed object has multiple ports
	Ports          string
	Labels         string
	ExternalIP     string
	LoadBalancerIP string
	Type           string
	Protocol       string
	// Protocols will be used to keep port-protocol mapping derived from exposed object
	Protocols       string
	TargetPort      string
	PortName        string
	SessionAffinity string
	ClusterIP       string

	DryRunStrategy   cmdutil.DryRunStrategy
	EnforceNamespace bool

	CanBeExposed              polymorphichelpers.CanBeExposedFunc
	MapBasedSelectorForObject func(runtime.Object) (string, error)
	PortsForObject            polymorphichelpers.PortsForObjectFunc
	ProtocolsForObject        polymorphichelpers.MultiProtocolsWithForObjectFunc

	Namespace string
	Mapper    meta.RESTMapper

	Builder          *resource.Builder
	ClientForMapping func(mapping *meta.RESTMapping) (resource.RESTClient, error)

	Recorder genericclioptions.Recorder
	genericiooptions.IOStreams
	// contains filtered or unexported fields
}

ExposeServiceOptions holds the options for kubectl expose command

func (*ExposeServiceOptions) Complete

func (o *ExposeServiceOptions) Complete(f cmdutil.Factory) error

Complete loads data from the command line environment

func (*ExposeServiceOptions) RunExpose

func (o *ExposeServiceOptions) RunExpose(cmd *cobra.Command, args []string) error

RunExpose retrieves the Kubernetes Object from the API server and expose it to a Kubernetes Service

Jump to

Keyboard shortcuts

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