config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 30 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 GetErieCanalNamespace

func GetErieCanalNamespace() string

func GetErieCanalPodName

func GetErieCanalPodName() string

func GetErieCanalPodNamespace

func GetErieCanalPodNamespace() string

func IssueCertForIngress

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

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

func UpdateIngressTLSConfig

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

func UpdateSSLPassthrough

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

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

func (*ConnectorConfig) ControlPlaneUID

func (c *ConnectorConfig) ControlPlaneUID() string

func (*ConnectorConfig) GatewayHost

func (c *ConnectorConfig) GatewayHost() string

func (*ConnectorConfig) GatewayIP

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

func (*ConnectorConfig) GatewayPort

func (c *ConnectorConfig) GatewayPort() int32

func (*ConnectorConfig) Group

func (c *ConnectorConfig) Group() string

func (*ConnectorConfig) IsInCluster

func (c *ConnectorConfig) IsInCluster() bool

func (*ConnectorConfig) Key

func (c *ConnectorConfig) Key() string

func (*ConnectorConfig) Name

func (c *ConnectorConfig) Name() string

func (*ConnectorConfig) Region

func (c *ConnectorConfig) Region() string

func (*ConnectorConfig) Zone

func (c *ConnectorConfig) Zone() string

type ErieCanalMetadata

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

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 GatewayApi

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

type HTTP

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

func (o *MeshConfig) GetCaBundleName() string

func (*MeshConfig) GetCaBundleNamespace

func (o *MeshConfig) GetCaBundleNamespace() string

func (*MeshConfig) GetDefaultIngressPath

func (o *MeshConfig) GetDefaultIngressPath() string

func (*MeshConfig) GetDefaultServicesPath

func (o *MeshConfig) GetDefaultServicesPath() string

func (*MeshConfig) IngressCodebasePath

func (o *MeshConfig) IngressCodebasePath() string

func (*MeshConfig) IsControlPlane

func (o *MeshConfig) IsControlPlane() bool

func (*MeshConfig) NamespacedIngressCodebasePath

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

func (o *MeshConfig) RepoRootURL() string

func (*MeshConfig) ServiceLbImage

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

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

type ServiceLB

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

type Store

type Store struct {
	MeshConfig *MeshConfigClient
}

func NewStore

func NewStore(k8sApi *kube.K8sAPI) *Store

type TLS

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