utils

package
v0.0.0-...-f33f640 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultDNS is the suffix of default fqdn in kubernetes
	DefaultDNS = "svc.cluster.local"
)

Variables

This section is empty.

Functions

func BuildPatchStruct

func BuildPatchStruct(config string) (*types.Struct, error)

BuildPatchStruct creates types.Struct from istio EnvoyFilter slice string

func FQDN

func FQDN(name, namespace string) string

FQDN returns the fully qualified domain name of service

func IsHTTP

func IsHTTP(port corev1.ServicePort) bool

IsHTTP check if the port is using http protocol

func IsLazyEnabled

func IsLazyEnabled(annotations map[string]string) bool

IsLazyEnabled check if lazyxds is enabled

func NewIstioClient

func NewIstioClient(kubeconfigPath string) (*istioclient.Clientset, error)

NewIstioClient creates new istio client which use to handle istio CRD

func NewKubeClient

func NewKubeClient(kubeconfigPath string) (*kubernetes.Clientset, error)

NewKubeClient creates new kube client

func ObjectID

func ObjectID(name, namespace string) string

ObjectID use name.namespace as object id

func ParseID

func ParseID(id string) (string, string)

ParseID parse the object id to name and namespace

func PortID

func PortID(svcID, port string) string

PortID use svcID:port as port id

func ServiceID2EgressString

func ServiceID2EgressString(id string) string

ServiceID2EgressString turn the service id to egress string of sidecar crd

func UpstreamCluster2ServiceID

func UpstreamCluster2ServiceID(cluster string) string

UpstreamCluster2ServiceID extract the service id from xds cluster id

func WaitDeployment

func WaitDeployment(ctx context.Context, client *kubernetes.Clientset, ns, name string) (err error)

WaitDeployment wait the deployment ready

Types

This section is empty.

Directories

Path Synopsis
app

Jump to

Keyboard shortcuts

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