cli

package
v1.2.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VIA_EXTERNAL_IP = "ExternalIP"
	VIA_CLUSTER_IP  = "ClusterIP"
)

Variables

View Source
var (
	Cfg = Config{Via: connector.ViaGateway}
)

Functions

func GetConnectorPod

func GetConnectorPod(kubeClient kubernetes.Interface) (*corev1.Pod, error)

GetConnectorPod returns the fsm-Consul-connector pod spec. The pod name is inferred from the 'CONNECTOR_POD_NAME' env variable which is set during deployment.

func ParseFlags

func ParseFlags() error

func SyncCtoK

func SyncCtoK(ctx context.Context, kubeClient kubernetes.Interface, configClient configClientset.Interface, discClient provider.ServiceDiscoveryClient)

func SyncKtoC

func SyncKtoC(ctx context.Context, kubeClient kubernetes.Interface, configClient configClientset.Interface, discClient provider.ServiceDiscoveryClient)

func SyncKtoG

func SyncKtoG(ctx context.Context, kubeClient kubernetes.Interface, configClient configClientset.Interface, gatewayClient gwapi.Interface)

func ToSet

func ToSet(s []string) mapset.Set

ToSet creates a set from s.

func ValidateCLIParams

func ValidateCLIParams() error

ValidateCLIParams contains all checks necessary that various permutations of the CLI flags are consistent

func Verbosity

func Verbosity() string

Types

type AppendSliceValue

type AppendSliceValue []string

AppendSliceValue implements the flag.Value interface and allows multiple calls to the same variable to append a list.

func (*AppendSliceValue) Set

func (s *AppendSliceValue) Set(value string) error

func (*AppendSliceValue) String

func (s *AppendSliceValue) String() string

type C2KCfg

type C2KCfg struct {
	FlagClusterId   string
	FlagPassingOnly bool
	FlagFilterTag   string
	FlagPrefixTag   string
	FlagSuffixTag   string

	Nacos Nacos2kCfg

	FlagWithGateway struct {
		Enable bool
	}
}

type Config

type Config struct {
	Verbosity          string
	MeshName           string // An ID that uniquely identifies an FSM instance
	KubeConfigFile     string
	FsmNamespace       string
	FsmMeshConfigName  string
	FsmVersion         string
	TrustDomain        string
	DeriveNamespace    string
	AsInternalServices bool
	SdrProvider        string
	HttpAddr           string
	SyncCloudToK8s     bool
	SyncK8sToCloud     bool
	SyncK8sToGateway   bool

	Nacos NacosCfg

	C2K C2KCfg
	K2C K2CCfg
	K2G K2GCfg

	Via *connector.Gateway
}

Config is used to configure the creation of a client

type K2CCfg

type K2CCfg struct {
	FlagDefaultSync bool
	FlagSyncPeriod  time.Duration

	FlagSyncClusterIPServices     bool
	FlagSyncLoadBalancerEndpoints bool
	FlagNodePortSyncType          string

	// Flags to support Kubernetes Ingress resources
	FlagSyncIngress                bool // Register services using the hostname from an ingress resource
	FlagSyncIngressLoadBalancerIPs bool // Use the load balancer IP of an ingress resource instead of the hostname

	FlagAddServicePrefix               string
	FlagAddK8SNamespaceAsServiceSuffix bool
	FlagAppendTags                     []string
	FlagAppendMetadataKeys             []string
	FlagAppendMetadataValues           []string
	FlagAllowK8SNamespaces             []string // K8s namespaces to explicitly inject
	FlagDenyK8SNamespaces              []string // K8s namespaces to deny injection (has precedence)

	Consul K2ConsulCfg
	Nacos  K2NacosCfg

	FlagWithGateway struct {
		Enable bool
	}
}

type K2ConsulCfg

type K2ConsulCfg struct {
	FlagConsulNodeName string
	FlagConsulK8STag   string

	// Flags to support namespaces
	FlagConsulEnableNamespaces        bool   // Use namespacing on all components
	FlagConsulDestinationNamespace    string // Consul namespace to register everything if not mirroring
	FlagConsulEnableK8SNSMirroring    bool   // Enables mirroring of k8s namespaces into Consul
	FlagConsulK8SNSMirroringPrefix    string // Prefix added to Consul namespaces created when mirroring
	FlagConsulCrossNamespaceACLPolicy string // The name of the ACL policy to add to every created namespace if ACLs are enabled
}

type K2GCfg

type K2GCfg struct {
	FlagDefaultSync        bool
	FlagSyncPeriod         time.Duration
	FlagAllowK8SNamespaces []string // K8s namespaces to explicitly inject
	FlagDenyK8SNamespaces  []string // K8s namespaces to deny injection (has precedence)
}

type K2NacosCfg

type K2NacosCfg struct {
	FlagClusterId string
	FlagGroupId   string
}

type Nacos2kCfg

type Nacos2kCfg struct {
	FlagClusterSet []string
	FlagGroupSet   []string
}

type NacosCfg

type NacosCfg struct {
	FlagUsername    string
	FlagPassword    string
	FlagNamespaceId string
}

Jump to

Keyboard shortcuts

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