config

package
v0.1.1-beta.13 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultWatchedConfigMaps = sets.String{}
)

Functions

func DefaultConfigurationFilter

func DefaultConfigurationFilter(obj interface{}) bool

func GetFsmNamespace

func GetFsmNamespace() string

func RegisterConfigurationHanlder

func RegisterConfigurationHanlder(handler ConfigEventHandler, configmapInformer ctrlruntimecache.Informer, resyncPeriod time.Duration)

func SetFsmNamespace

func SetFsmNamespace(ns string)

Types

type Certificate

type Certificate struct {
	Manager string `json:"manager,omitempty"`
}

type Cluster

type Cluster struct {
	Region    string           `json:"region,omitempty"`
	Zone      string           `json:"zone,omitempty"`
	Group     string           `json:"group,omitempty"`
	Name      string           `json:"name,omitempty"`
	Connector ClusterConnector `json:"connector"`
}

type ClusterConnector

type ClusterConnector struct {
	SecretMountPath    string    `json:"secret-mount-path" validate:"required"`
	ConfigmapName      string    `json:"configmap-name" validate:"required"`
	ConfigFile         string    `json:"config-file" validate:"required"`
	LogLevel           int32     `json:"log-level" validate:"gte=1,lte=10"`
	ServiceAccountName string    `json:"service-account-name" validate:"required"`
	Resources          Resources `json:"resources,omitempty"`
}

type ConfigEventHandler

type ConfigEventHandler interface {
	OnConfigMapAdd(cm *corev1.ConfigMap)
	OnConfigMapUpdate(oldCm, cm *corev1.ConfigMap)
	OnConfigMapDelete(cm *corev1.ConfigMap)
}

type ConnectorConfig

type ConnectorConfig struct {
	ClusterName                    string `envconfig:"CLUSTER_NAME" required:"true" split_words:"true"`
	ClusterRegion                  string `envconfig:"CLUSTER_REGION" default:"default" split_words:"true"`
	ClusterZone                    string `envconfig:"CLUSTER_ZONE" default:"default" split_words:"true"`
	ClusterGroup                   string `envconfig:"CLUSTER_GROUP" default:"default" split_words:"true"`
	ClusterGateway                 string `envconfig:"CLUSTER_GATEWAY" required:"true" split_words:"true"`
	ClusterConnectorNamespace      string `envconfig:"CLUSTER_CONNECTOR_NAMESPACE" required:"true" split_words:"true"`
	ClusterConnectorMode           string `envconfig:"CLUSTER_CONNECTOR_MODE" required:"true" split_words:"true"`
	ClusterControlPlaneRepoRootUrl string `envconfig:"CLUSTER_CONTROL_PLANE_REPO_ROOT_URL" default:"http://repo-service.flomesh.svc:6060" split_words:"true"`
	ClusterControlPlaneRepoPath    string `envconfig:"CLUSTER_CONTROL_PLANE_REPO_PATH" default:"/repo" split_words:"true"`
	ClusterControlPlaneRepoApiPath string `envconfig:"CLUSTER_CONTROL_PLANE_REPO_API_PATH" default:"/api/v1/repo" split_words:"true"`
}

func (*ConnectorConfig) UID

func (c *ConnectorConfig) UID() string

type FlomeshConfigurationHandler

type FlomeshConfigurationHandler struct {
	// contains filtered or unexported fields
}

func NewFlomeshConfigurationHandler

func NewFlomeshConfigurationHandler(client client.Client, k8sApi *kube.K8sAPI, store *Store) *FlomeshConfigurationHandler

func (FlomeshConfigurationHandler) OnConfigMapAdd

func (f FlomeshConfigurationHandler) OnConfigMapAdd(cm *corev1.ConfigMap)

func (FlomeshConfigurationHandler) OnConfigMapDelete

func (f FlomeshConfigurationHandler) OnConfigMapDelete(cm *corev1.ConfigMap)

func (FlomeshConfigurationHandler) OnConfigMapUpdate

func (f FlomeshConfigurationHandler) OnConfigMapUpdate(oldCm, cm *corev1.ConfigMap)

type GatewayApi

type GatewayApi struct {
	Enabled bool `json:"enabled,omitempty"`
}

type Images

type Images struct {
	PipyImage             string `json:"pipy-image" validate:"required"`
	ProxyInitImage        string `json:"proxy-init-image" validate:"required"`
	ClusterConnectorImage string `json:"cluster-connector-image" validate:"required"`
	WaitForItImage        string `json:"wait-for-it-image" validate:"required"`
}

type Ingress

type Ingress struct {
	Enabled     bool   `json:"enabled,omitempty"`
	DeployName  string `json:"deploy-name,omitempty"`
	ServiceName string `json:"service-name,omitempty"`
}

type MeshConfig

type MeshConfig struct {
	IsControlPlane    bool              `json:"is-control-plane,omitempty"`
	Repo              Repo              `json:"repo"`
	Images            Images            `json:"images"`
	ServiceAggregator ServiceAggregator `json:"service-aggregator"`
	Webhook           Webhook           `json:"webhook"`
	Ingress           Ingress           `json:"ingress"`
	GatewayApi        GatewayApi        `json:"gateway-api"`
	Certificate       Certificate       `json:"certificate"`
	Cluster           Cluster           `json:"cluster"`
}

func ParseMeshConfig

func ParseMeshConfig(cm *corev1.ConfigMap) *MeshConfig

func (*MeshConfig) IngressCodebasePath

func (o *MeshConfig) IngressCodebasePath() string

func (*MeshConfig) RepoApiBaseURL

func (o *MeshConfig) RepoApiBaseURL() string

func (*MeshConfig) RepoBaseURL

func (o *MeshConfig) RepoBaseURL() string

func (*MeshConfig) ToJson

func (o *MeshConfig) ToJson() string

type MeshConfigChangeListener

type MeshConfigChangeListener interface {
	OnConfigCreate(cfg *MeshConfig)
	OnConfigUpdate(oldCfg, cfg *MeshConfig)
	OnConfigDelete(cfg *MeshConfig)
}

type MeshConfigClient

type MeshConfigClient struct {
	// contains filtered or unexported fields
}

func NewMeshConfigClient

func NewMeshConfigClient(k8sApi *kube.K8sAPI) *MeshConfigClient

func (*MeshConfigClient) GetConfig

func (c *MeshConfigClient) GetConfig() *MeshConfig

func (*MeshConfigClient) UpdateConfig

func (c *MeshConfigClient) UpdateConfig(config *MeshConfig)

type ProxyInitEnvironmentConfiguration

type ProxyInitEnvironmentConfiguration struct {
	MatchedProxyProfile string   `envconfig:"MATCHED_PROXY_PROFILE" required:"true" split_words:"true"`
	ProxyRepoBaseUrl    string   `envconfig:"PROXY_REPO_BASE_URL" required:"true" split_words:"true"`
	ProxyRepoApiBaseUrl string   `envconfig:"PROXY_REPO_API_BASE_URL" required:"true" split_words:"true"`
	ProxyParentPath     string   `envconfig:"PROXY_PARENT_PATH" required:"true" split_words:"true"`
	ProxyPaths          []string `envconfig:"PROXY_PATHS" required:"true" split_words:"true"`
}

type Repo

type Repo struct {
	RootURL string `json:"root-url" validate:"required,url"`
	Path    string `json:"path" validate:"required"`
	ApiPath string `json:"api-path" validate:"required"`
}

type Resources

type Resources struct {
	RequestsCPU    string `json:"requests-cpu,omitempty"`
	RequestsMemory string `json:"requests-memory,omitempty"`
	LimitsCPU      string `json:"limits-cpu,omitempty"`
	LimitsMemory   string `json:"limits-memory,omitempty"`
}

type ServiceAggregator

type ServiceAggregator struct {
	Addr string `json:"addr" validate:"required,hostname_port"`
}

type Store

type Store struct {
	MeshConfig *MeshConfigClient
}

func NewStore

func NewStore(k8sApi *kube.K8sAPI) *Store

type Webhook

type Webhook struct {
	ServiceName string `json:"service-name" validate:"required,hostname"`
}

Jump to

Keyboard shortcuts

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