commons

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RootCACertName                = "ca.crt"
	RootCAPrivateKeyName          = "ca.key"
	TLSCertName                   = "tls.crt"
	TLSPrivateKeyName             = "tls.key"
	WebhookServerServingCertsPath = "/tmp/k8s-webhook-server/serving-certs"
	DefaultCAValidityPeriod       = 24 * 365 * 10 * time.Hour
	DefaultCACommonName           = "flomesh.io"
	DefaultCACountry              = "CN"
	DefaultCALocality             = "Dalian"
	DefaultCAOrganization         = "flomesh.io"
	ManagerDeploymentName         = "fsm-manager"
	MeshConfigName                = "fsm-mesh-config"
	MeshConfigJsonName            = "mesh_config.json"
	DefaultPipyRepoPath           = "/repo"
	DefaultPipyRepoApiPath        = "/api/v1/repo"
	DefaultPipyFileApiPath        = "/api/v1/repo-files"

	DeploymentNameSuffix = "-fsmdp"
	ServiceNameSuffix    = "-fsmsvc"
	ConfigMapNameSuffix  = "-fsmcm"
	DaemonSetNameSuffix  = "-fsmds"
	VolumeNameSuffix     = "-fsmvlm"

	DefaultWebhookServiceName                 = "fsm-webhook-service"
	DefaultMutatingWebhookConfigurationName   = "flomesh-mutating-webhook-configuration"
	DefaultValidatingWebhookConfigurationName = "flomesh-validating-webhook-configuration"
	ProxyInjectorWebhookPath                  = "/proxy-injector-flomesh-io-v1alpha1"
	ProxyProfileMutatingWebhookPath           = "/mutate-flomesh-io-v1alpha1-proxyprofile"
	ProxyProfileValidatingWebhookPath         = "/validate-flomesh-io-v1alpha1-proxyprofile"
	ConfigMapMutatingWebhookPath              = "/mutate-core-v1-configmap"
	ConfigMapValidatingWebhookPath            = "/validate-core-v1-configmap"
	ClusterMutatingWebhookPath                = "/mutate-flomesh-io-v1alpha1-cluster"
	ClusterValidatingWebhookPath              = "/validate-flomesh-io-v1alpha1-cluster"
	NamespacedIngressMutatingWebhookPath      = "/mutate-flomesh-io-v1alpha1-namespacedingress"
	NamespacedIngressValidatingWebhookPath    = "/validate-flomesh-io-v1alpha1-namespacedingress"
	GatewayMutatingWebhookPath                = "/mutate-gateway-networking-k8s-io-v1beta1-gateway"
	GatewayValidatingWebhookPath              = "/validate-gateway-networking-k8s-io-v1beta1-gateway"
	GatewayClassMutatingWebhookPath           = "/mutate-gateway-networking-k8s-io-v1beta1-gatewayclass"
	GatewayClassValidatingWebhookPath         = "/validate-gateway-networking-k8s-io-v1beta1-gatewayclass"
	HTTPRouteMutatingWebhookPath              = "/mutate-gateway-networking-k8s-io-v1beta1-httproute"
	HTTPRouteValidatingWebhookPath            = "/validate-gateway-networking-k8s-io-v1beta1-httproute"
	ServiceImportMutatingWebhookPath          = "/mutate-flomesh-io-v1alpha1-serviceimport"
	ServiceImportValidatingWebhookPath        = "/validate-flomesh-io-v1alpha1-serviceimport"
	ServiceExportMutatingWebhookPath          = "/mutate-flomesh-io-v1alpha1-serviceexport"
	ServiceExportValidatingWebhookPath        = "/validate-flomesh-io-v1alpha1-serviceexport"
	GlobalTrafficPolicyMutatingWebhookPath    = "/mutate-flomesh-io-v1alpha1-globaltrafficpolicy"
	GlobalTrafficPolicyValidatingWebhookPath  = "/validate-flomesh-io-v1alpha1-globaltrafficpolicy"
	IngressMutatingWebhookPath                = "/mutate-networking-v1-ingress"
	IngressValidatingWebhookPath              = "/validate-networking-v1-ingress"
	FLBServiceMutatingWebhookPath             = "/mutate-flb-core-v1-service"
	FLBServiceValidatingWebhookPath           = "/validate-flb-core-v1-service"
	FLBSecretMutatingWebhookPath              = "/mutate-flb-core-v1-secret"
	FLBSecretValidatingWebhookPath            = "/validate-flb-core-v1-secret"

	AnnotationPrefix                  = "flomesh.io"
	ProxyInjectIndicator              = AnnotationPrefix + "/inject"
	FlomeshControlPlaneLabel          = AnnotationPrefix + "/control-plane"
	ProxyInjectAnnotation             = ProxyInjectIndicator
	ProxyInjectNamespaceLabel         = ProxyInjectIndicator
	ProxyInjectStatusAnnotation       = AnnotationPrefix + "/inject-status"
	MatchedProxyProfile               = AnnotationPrefix + "/proxy-profile"
	ConfigHashAnnotation              = AnnotationPrefix + "/config-hash"
	SpecHashAnnotation                = AnnotationPrefix + "/spec-hash"
	ProxySpecHashAnnotation           = AnnotationPrefix + "/proxy-hash"
	ProxyProfileLastUpdated           = AnnotationPrefix + "/last-updated"
	ProxyProfileLastUpdatedTimeFormat = "20060102-150405.0000"
	InjectorAnnotationPrefix          = "sidecar.flomesh.io"
	ProxyServiceNameAnnotation        = InjectorAnnotationPrefix + "/service-name"
	ProxyDefaultProxyProfileLabel     = InjectorAnnotationPrefix + "/is-default-proxyprofile"
	ProxyProfileLabel                 = MatchedProxyProfile
	ProxyInjectEnabled                = "true"
	ProxyInjectDisabled               = "false"
	ProxyInjectdStatus                = "injected"
	ProxySharedResourceVolumeName     = "shared-proxy-res"
	ProxySharedResoueceMountPath      = "/sidecar"
	ProxyProfileConfigMapMountPath    = "/config"
	//ProxyConfigWorkDir                = "/etc/pipy/proxy"
	PipyProxyConfigFileEnvName = "PIPY_CONFIG_FILE"
	//PipyProxyPortEnvName              = "_PIPY_LISTEN_PORT_"
	ProxyProfileConfigWorkDirEnvName = "_SIDECAR_CONFIG_PATH_"
	//DefaultProxyStartupScriptName     = "config.js"
	//ProxyCRDLabel                     = AnnotationPrefix + "/proxy"
	//ProxyCRDAnnotation                = ProxyCRDLabel
	//ProxyModeLabel                    = AnnotationPrefix + "/proxy-mode"
	CRDTypeLabel           = AnnotationPrefix + "/crd"
	CRDVersionLabel        = AnnotationPrefix + "/crd-version"
	ProxyParentPathEnvName = "PROXY_PARENT_PATH"
	//ProxyPathsEnvName                 = "PROXY_PATHS"
	ProxyRepoBaseUrlEnvName    = "PROXY_REPO_BASE_URL"
	ProxyRepoRootUrlEnvName    = "PROXY_REPO_ROOT_URL"
	MatchedProxyProfileEnvName = "MATCHED_PROXY_PROFILE"
	//DefaultServicePathTpl            = "/" + ClusterTpl + "/services"
	//DefaultIngressPathTpl            = "/" + ClusterTpl + "/ingress"
	//DefaultNamespacedIngressPathTpl  = "/" + ClusterTpl + "/nsig/{{ .Namespace }}"
	//DefaultProxyProfileParentPathTpl = DefaultServicePathTpl
	//DefaultProxyProfilePathTpl       = "/" + ClusterTpl + "/pf/{{ .ProxyProfile }}"
	//DefaultSidecarPathTpl            = "/" + ClusterTpl + "/sidecars/{{ .ProxyProfile }}/{{ .Sidecar }}"
	DefaultServiceBasePath = "/base/services"
	DefaultIngressBasePath = "/base/ingress"

	// DefaultHttpSchema, default http schema
	DefaultHttpSchema = "http"

	MultiClustersPrefix            = "multicluster.flomesh.io"
	MultiClustersServiceExportHash = MultiClustersPrefix + "/export-hash"
	MultiClustersConnectorMode     = MultiClustersPrefix + "/connector-mode"

	ClusterTpl = "{{ .Region }}/{{ .Zone }}/{{ .Group }}/{{ .Cluster }}"

	FlbPrefix                   = "flb.flomesh.io"
	FlbEnabledAnnotation        = FlbPrefix + "/enabled"
	FlbAddressPoolAnnotation    = FlbPrefix + "/address-pool"
	FlbDesiredIPAnnotation      = FlbPrefix + "/desired-ip"
	FlbMaxConnectionsAnnotation = FlbPrefix + "/max-connections"
	FlbReadTimeoutAnnotation    = FlbPrefix + "/read-timeout"
	FlbWriteTimeoutAnnotation   = FlbPrefix + "/write-timeout"
	FlbIdleTimeoutAnnotation    = FlbPrefix + "/idle-timeout"
	FlbAlgoAnnotation           = FlbPrefix + "/algo"
	FlbTagsAnnotation           = FlbPrefix + "/tags"
	FlbSecretLabel              = FlbPrefix + "/config"

	FLBSecretKeyBaseUrl            = "baseUrl"
	FLBSecretKeyUsername           = "username"
	FLBSecretKeyPassword           = "password"
	FLBSecretKeyK8sCluster         = "k8sCluster"
	FLBSecretKeyDefaultAddressPool = "defaultAddressPool"
	FLBSecretKeyDefaultAlgo        = "defaultAlgo"
)
View Source
const AppVersionTemplate = `` /* 206-byte string literal not displayed */

Variables

View Source
var (
	ClusterIDTemplate = template.Must(template.New("ClusterIDTemplate").Parse(ClusterTpl))
)

Functions

This section is empty.

Types

type FlomeshConfigType

type FlomeshConfigType string
const (
	MeshConfig FlomeshConfigType = MeshConfigName
)

type Response

type Response struct {
	Success bool   `json:"success,omitempty"`
	Result  string `json:"result,omitempty"`
}

Jump to

Keyboard shortcuts

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