Documentation
¶
Index ¶
- Variables
- func Init(enabledPlugins []string, plugins map[string]*PluginInitializer)
- func InitAll(plugins map[string]*PluginInitializer)
- func InitAllIf(enabledPlugins []string, pluginName string, ...)
- func Register(name PluginName, plugin Plugin)
- type AuthnAPIServerPlugin
- type BootstrapPlugin
- type CaPlugin
- type ConfigStorePlugin
- type CoreResourcePlugin
- type DbVersion
- type EgressPolicyPlugin
- type IdentityProviderPlugin
- type MatchedPoliciesConfig
- type MatchedPoliciesOption
- type MutablePluginContext
- type MutableRegistry
- type Plugin
- type PluginConfig
- type PluginContext
- type PluginInitializer
- type PluginName
- type PolicyPlugin
- type ProxyPlugin
- type RegisteredPolicyPlugin
- type Registry
- type RegistryMutator
- type ResourceStorePlugin
- type RuntimePlugin
- type SecretStorePlugin
Constants ¶
This section is empty.
Variables ¶
var AlreadyMigrated = errors.New("database already migrated")
var EnvironmentPreparedOrder = EnvironmentPreparingOrder + 1
EnvironmentPreparedOrder describes an order at which you can put a plugin and expect that the base environment is already configured by Universal/Kubernetes plugins.
var EnvironmentPreparingOrder = 0
EnvironmentPreparingOrder describes an order at which base environment plugins (Universal/Kubernetes) configure the control plane.
Functions ¶
func Init ¶
func Init(enabledPlugins []string, plugins map[string]*PluginInitializer)
func InitAll ¶
func InitAll(plugins map[string]*PluginInitializer)
func InitAllIf ¶ added in v2.12.4
func InitAllIf(enabledPlugins []string, pluginName string, plugins map[string]*PluginInitializer)
func Register ¶
func Register(name PluginName, plugin Plugin)
Types ¶
type AuthnAPIServerPlugin ¶
type AuthnAPIServerPlugin interface {
Plugin
NewAuthenticator(PluginContext) (authn.Authenticator, error)
}
AuthnAPIServerPlugin is responsible for providing authenticator for API Server.
type BootstrapPlugin ¶
type BootstrapPlugin interface {
Plugin
BeforeBootstrap(*MutablePluginContext, PluginConfig) error
AfterBootstrap(*MutablePluginContext, PluginConfig) error
Name() PluginName
// Order defines an order in which plugins are applied on the control plane.
// If you don't have specific need, consider using EnvironmentPreparedOrder
Order() int
}
BootstrapPlugin is responsible for environment-specific initialization at start up, e.g. Kubernetes-specific part of configuration. Unlike other plugins, can mutate plugin context directly.
type CaPlugin ¶
type CaPlugin interface {
Plugin
NewCaManager(PluginContext, PluginConfig) (core_ca.Manager, error)
}
CaPlugin is responsible for providing Certificate Authority Manager
type ConfigStorePlugin ¶
type ConfigStorePlugin interface {
Plugin
NewConfigStore(PluginContext, PluginConfig) (core_store.ResourceStore, error)
}
ConfigStorePlugin is responsible for instantiating a particular ConfigStore.
type CoreResourcePlugin ¶ added in v2.12.4
type CoreResourcePlugin interface {
Plugin
// Apply to `rs` using `proxy` the mutation or new resources.
Generate(rs *core_xds.ResourceSet, xdsCtx xds_context.Context, proxy *core_xds.Proxy) error
}
CoreResourcePlugin a plugin to generate xDS resources based on core resources.
type DbVersion ¶
type DbVersion = uint
ResourceStorePlugin is responsible for instantiating a particular ResourceStore.
type EgressPolicyPlugin ¶
type EgressPolicyPlugin interface {
PolicyPlugin
// EgressMatchedPolicies returns all the policies of the plugins' type matching the external service that
// should be applied on the zone egress.
EgressMatchedPolicies(tags map[string]string, resources xds_context.Resources, opts ...MatchedPoliciesOption) (core_xds.TypedMatchingPolicies, error)
}
type IdentityProviderPlugin ¶ added in v2.12.4
type IdentityProviderPlugin interface {
Plugin
NewIdentityProvider(PluginContext, PluginConfig) (providers.IdentityProvider, error)
}
type MatchedPoliciesConfig ¶
type MatchedPoliciesConfig struct {
IncludeShadow bool
}
func NewMatchedPoliciesConfig ¶
func NewMatchedPoliciesConfig(opts ...MatchedPoliciesOption) *MatchedPoliciesConfig
type MatchedPoliciesOption ¶
type MatchedPoliciesOption func(*MatchedPoliciesConfig)
func IncludeShadow ¶
func IncludeShadow() MatchedPoliciesOption
type MutablePluginContext ¶
type MutablePluginContext = core_runtime.Builder
type MutableRegistry ¶
type MutableRegistry interface {
Registry
RegistryMutator
}
func NewRegistry ¶
func NewRegistry() MutableRegistry
type PluginConfig ¶
type PluginConfig interface{}
type PluginContext ¶
type PluginContext = core_runtime.BuilderContext
type PluginInitializer ¶
type PluginInitializer struct {
InitFn func()
Initialized bool
}
type PluginName ¶
type PluginName string
const ( Kubernetes PluginName = "k8s" Universal PluginName = "universal" Memory PluginName = "memory" Postgres PluginName = "postgres" CaBuiltin PluginName = "builtin" CaProvided PluginName = "provided" )
type PolicyPlugin ¶
type PolicyPlugin interface {
Plugin
// MatchedPolicies return all the policies of the plugins' type matching this dataplane. This is used in the inspect api and accessible in Apply through `proxy.Policies.Dynamic`
MatchedPolicies(dataplane *core_mesh.DataplaneResource, resources xds_context.Resources, opts ...MatchedPoliciesOption) (core_xds.TypedMatchingPolicies, error)
// Apply to `rs` using the `ctx` and `proxy` the mutation for all policies of the type this plugin implements.
// You can access matching policies by using `proxy.Policies.Dynamic`.
Apply(rs *core_xds.ResourceSet, ctx xds_context.Context, proxy *core_xds.Proxy) error
}
PolicyPlugin a plugin to add a Policy to Kuma
type ProxyPlugin ¶
type ProxyPlugin interface {
Plugin
// Apply mutate the proxy as needed.
Apply(ctx context.Context, meshCtx xds_context.MeshContext, proxy *core_xds.Proxy) error
}
ProxyPlugin a plugin to modify the proxy. This happens before any `PolicyPlugin` or any envoy generation. and it is applied both for Dataplanes and ZoneProxies
type RegisteredPolicyPlugin ¶
type RegisteredPolicyPlugin struct {
Plugin PolicyPlugin
Name PluginName
}
type Registry ¶
type Registry interface {
BootstrapPlugins() []BootstrapPlugin
ResourceStore(name PluginName) (ResourceStorePlugin, error)
SecretStore(name PluginName) (SecretStorePlugin, error)
ConfigStore(name PluginName) (ConfigStorePlugin, error)
RuntimePlugins() map[PluginName]RuntimePlugin
CaPlugins() map[PluginName]CaPlugin
AuthnAPIServer() map[PluginName]AuthnAPIServerPlugin
PolicyPlugins([]PluginName) []RegisteredPolicyPlugin
ProxyPlugins() map[PluginName]ProxyPlugin
CoreResourcePlugins() map[PluginName]CoreResourcePlugin
IdentityProviders() map[PluginName]IdentityProviderPlugin
}
type RegistryMutator ¶
type RegistryMutator interface {
Register(PluginName, Plugin) error
}
type ResourceStorePlugin ¶
type ResourceStorePlugin interface {
Plugin
NewResourceStore(PluginContext, PluginConfig) (core_store.ResourceStore, core_store.Transactions, error)
Migrate(PluginContext, PluginConfig) (DbVersion, error)
EventListener(PluginContext, events.Emitter) error
}
ResourceStorePlugin is responsible for instantiating a particular ResourceStore.
type RuntimePlugin ¶
type RuntimePlugin interface {
Plugin
Customize(core_runtime.Runtime) error
}
RuntimePlugin is responsible for registering environment-specific components, e.g. Kubernetes admission web hooks.
type SecretStorePlugin ¶
type SecretStorePlugin interface {
Plugin
NewSecretStore(PluginContext, PluginConfig) (secret_store.SecretStore, error)
}
SecretStorePlugin is responsible for instantiating a particular SecretStore.