config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 31 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 GetFsmPodName added in v0.1.6

func GetFsmPodName() string

func GetFsmPodNamespace added in v0.1.6

func GetFsmPodNamespace() string

func IssueCertForIngress added in v0.2.0

func IssueCertForIngress(basepath string, repoClient *repo.PipyRepoClient, certMgr certificate.Manager, mc *MeshConfig) error

func RegisterConfigurationHanlder

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

func UpdateIngressHTTPConfig added in v0.2.0

func UpdateIngressHTTPConfig(basepath string, repoClient *repo.PipyRepoClient, mc *MeshConfig) error

func UpdateIngressTLSConfig added in v0.2.0

func UpdateIngressTLSConfig(basepath string, repoClient *repo.PipyRepoClient, mc *MeshConfig) error

func UpdateSSLPassthrough added in v0.2.0

func UpdateSSLPassthrough(basepath string, repoClient *repo.PipyRepoClient, enabled bool, upstreamPort int32) error

Types

type Certificate

type Certificate struct {
	Manager           string `json:"manager" validate:"required"`
	CaBundleName      string `json:"caBundleName" validate:"required"`
	CaBundleNamespace string `json:"caBundleNamespace"`
}

type Cluster

type Cluster struct {
	UID             string `json:"uid"`
	Region          string `json:"region"`
	Zone            string `json:"zone"`
	Group           string `json:"group"`
	Name            string `json:"name" validate:"required"`
	ControlPlaneUID string `json:"controlPlaneUID"`
}

type ConfigEventHandler

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

type ConnectorConfig

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

func NewConnectorConfig added in v0.2.0

func NewConnectorConfig(
	region, zone, group, name, gatewayHost string,
	gatewayPort int32,
	inCluster bool,
	controlPlaneUID string,
) (*ConnectorConfig, error)

func (*ConnectorConfig) ControlPlaneUID added in v0.2.0

func (c *ConnectorConfig) ControlPlaneUID() string

func (*ConnectorConfig) GatewayHost added in v0.2.0

func (c *ConnectorConfig) GatewayHost() string

func (*ConnectorConfig) GatewayIP added in v0.2.0

func (c *ConnectorConfig) GatewayIP() net.IP

func (*ConnectorConfig) GatewayPort added in v0.2.0

func (c *ConnectorConfig) GatewayPort() int32

func (*ConnectorConfig) Group added in v0.2.0

func (c *ConnectorConfig) Group() string

func (*ConnectorConfig) IsInCluster added in v0.2.0

func (c *ConnectorConfig) IsInCluster() bool

func (*ConnectorConfig) Key added in v0.2.0

func (c *ConnectorConfig) Key() string

func (*ConnectorConfig) Name added in v0.2.0

func (c *ConnectorConfig) Name() string

func (*ConnectorConfig) Region added in v0.2.0

func (c *ConnectorConfig) Region() string

func (*ConnectorConfig) Zone added in v0.2.0

func (c *ConnectorConfig) Zone() string

type FlomeshConfigurationHandler

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

func NewFlomeshConfigurationHandler

func NewFlomeshConfigurationHandler(client client.Client, k8sApi *kube.K8sAPI, store *Store, certMgr certificate.Manager) *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 FsmMetadata added in v0.1.6

type FsmMetadata struct {
	PodName      string `envconfig:"POD_NAME" required:"true" split_words:"true"`
	PodNamespace string `envconfig:"POD_NAMESPACE" required:"true" split_words:"true"`
	FsmNamespace string `envconfig:"NAMESPACE" required:"true" split_words:"true"`
}

type GatewayApi

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

type HTTP added in v0.2.0

type HTTP struct {
	Enabled  bool  `json:"enabled"`
	Bind     int32 `json:"bind" validate:"gte=1,lte=65535"`
	Listen   int32 `json:"listen" validate:"gte=1,lte=65535"`
	NodePort int32 `json:"nodePort" validate:"gte=0,lte=65535"`
}

type Images

type Images struct {
	Repository     string `json:"repository" validate:"required"`
	PipyImage      string `json:"pipyImage" validate:"required"`
	ProxyInitImage string `json:"proxyInitImage" validate:"required"`
	KlipperLbImage string `json:"klipperLbImage" validate:"required"`
}

type Ingress

type Ingress struct {
	Enabled    bool `json:"enabled"`
	Namespaced bool `json:"namespaced"`
	HTTP       HTTP `json:"http"`
	TLS        TLS  `json:"tls"`
}

type MeshConfig

type MeshConfig struct {
	IsManaged   bool        `json:"isManaged"`
	Repo        Repo        `json:"repo"`
	Images      Images      `json:"images"`
	Webhook     Webhook     `json:"webhook"`
	Ingress     Ingress     `json:"ingress"`
	GatewayApi  GatewayApi  `json:"gatewayApi"`
	Certificate Certificate `json:"certificate"`
	Cluster     Cluster     `json:"cluster"`
	ServiceLB   ServiceLB   `json:"serviceLB"`
}

func ParseMeshConfig

func ParseMeshConfig(cm *corev1.ConfigMap) (*MeshConfig, error)

func (*MeshConfig) GetCaBundleName added in v0.2.0

func (o *MeshConfig) GetCaBundleName() string

func (*MeshConfig) GetCaBundleNamespace added in v0.2.0

func (o *MeshConfig) GetCaBundleNamespace() string

func (*MeshConfig) GetDefaultIngressPath added in v0.1.7

func (o *MeshConfig) GetDefaultIngressPath() string

func (*MeshConfig) GetDefaultServicesPath added in v0.1.7

func (o *MeshConfig) GetDefaultServicesPath() string

func (*MeshConfig) IngressCodebasePath

func (o *MeshConfig) IngressCodebasePath() string

func (*MeshConfig) IsControlPlane

func (o *MeshConfig) IsControlPlane() bool

func (*MeshConfig) NamespacedIngressCodebasePath added in v0.1.7

func (o *MeshConfig) NamespacedIngressCodebasePath(namespace string) string

func (*MeshConfig) PipyImage

func (o *MeshConfig) PipyImage() string

func (*MeshConfig) ProxyInitImage

func (o *MeshConfig) ProxyInitImage() string

func (*MeshConfig) RepoBaseURL

func (o *MeshConfig) RepoBaseURL() string

func (*MeshConfig) RepoRootURL added in v0.2.0

func (o *MeshConfig) RepoRootURL() string

func (*MeshConfig) ServiceLbImage added in v0.1.8

func (o *MeshConfig) ServiceLbImage() 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) (*MeshConfig, error)

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"`
	ProxyRepoRootUrl    string   `envconfig:"PROXY_REPO_ROOT_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:"rootURL" validate:"required,url"`
}

type SSLPassthrough added in v0.1.7

type SSLPassthrough struct {
	Enabled      bool  `json:"enabled"`
	UpstreamPort int32 `json:"upstreamPort" validate:"gte=1,lte=65535"`
}

type ServiceLB added in v0.1.8

type ServiceLB struct {
	Enabled bool `json:"enabled"`
}

type Store

type Store struct {
	MeshConfig *MeshConfigClient
}

func NewStore

func NewStore(k8sApi *kube.K8sAPI) *Store

type TLS added in v0.1.7

type TLS struct {
	Enabled        bool           `json:"enabled"`
	Bind           int32          `json:"bind" validate:"gte=1,lte=65535"`
	Listen         int32          `json:"listen" validate:"gte=1,lte=65535"`
	NodePort       int32          `json:"nodePort" validate:"gte=0,lte=65535"`
	MTLS           bool           `json:"mTLS"`
	SSLPassthrough SSLPassthrough `json:"sslPassthrough"`
}

type Webhook

type Webhook struct {
	ServiceName string `json:"serviceName" validate:"required,hostname"`
}

Jump to

Keyboard shortcuts

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