controllers

package
v1.21.6 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReasonFailedCreateSubResource = "FailedCreateSubResource"
	ReasonFailedCreate            = "FailedCreate"
	ReasonFailedDelete            = "FailedDelete"
	ReasonFailedUpdate            = "FailedUpdate"
	ReasonCreated                 = "Created"
	ReasonDeleted                 = "Deleted"
	ReasonUpdated                 = "Updated"
	ReasonUnknowError             = "UnknowError"
)

event reason

Variables

View Source
var PluginStatusInstance = &PluginStatus{init: make(chan struct{})}

Functions

func AddNamespaceSelector

func AddNamespaceSelector(np *netv1.NetworkPolicy, kind, value string)

func DefaultNetworkPolicy

func DefaultNetworkPolicy(namespace, name string, cidrs []string) netv1.NetworkPolicy

network policy

func DelNamespaceSelector

func DelNamespaceSelector(np *netv1.NetworkPolicy, kind string)

func ExistOwnerRef

func ExistOwnerRef(meta metav1.ObjectMeta, owner metav1.OwnerReference) bool

owner

func GetCIDRs

func GetCIDRs(c client.Client) ([]string, error)

func HasDifferentResources

func HasDifferentResources(origin, newone corev1.ResourceRequirements) bool

only cpu and memory

func NewResourceQuotaHandler

func NewResourceQuotaHandler() handler.Funcs

func OnNamespceChangeFunc

func OnNamespceChangeFunc(cli client.Client) handler.MapFunc

Types

type ComponentName

type ComponentName string
const (
	ComponentNginx ComponentName = "nginx"
	ComponentIstio ComponentName = "istio"
)

type EnvironmentReconciler

type EnvironmentReconciler struct {
	client.Client
	Log      logr.Logger
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

EnvironmentReconciler reconciles a Environment object

func (*EnvironmentReconciler) Reconcile

func (r *EnvironmentReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*EnvironmentReconciler) SetupWithManager

func (r *EnvironmentReconciler) SetupWithManager(mgr ctrl.Manager) error

type NetworkPolicyAction

type NetworkPolicyAction struct {
	TenantISO      bool
	ProjectISO     bool
	EnvironmentISO bool

	Tenant      string
	Project     string
	Environment string

	Origin *netv1.NetworkPolicy
	Modify *netv1.NetworkPolicy

	Labels map[string]string
	// contains filtered or unexported fields
}

type PluginStatus

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

func (*PluginStatus) ComponentEnabled

func (p *PluginStatus) ComponentEnabled(name ComponentName) bool

type PluginStatusController

type PluginStatusController struct {
	client.Client
	Log logr.Logger
}

func (*PluginStatusController) Init

func (*PluginStatusController) OnChange

func (*PluginStatusController) Reconcile

func (r *PluginStatusController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*PluginStatusController) SetupWithManager

func (r *PluginStatusController) SetupWithManager(mgr ctrl.Manager) error

type ServiceentryReconciler

type ServiceentryReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
}

ServiceentryReconciler 用于为对开启 虚拟域名的 namespace 中service创建与虚拟域名相同的 serviceentry 功能: 1. 观察 namespace 是否具有虚拟空间标志 annotation "kubegems.io/virtualdomain={virtualdomain name}" 2. 若有,则为该namespace下的service创建一个virtual service,并设置其hosts 为 {servicename}.{virtualservicename} 处理流程: 1. 若 service 变化,则判断该 namespace 是否具有 annotation "kubegems.io/virtualdomain={virtualdomain name}" 2. 判断 service 是否具有annotation "kubegems.io/virtualdomain={virtualdomain name}" 3. 确定service同名的 serviceentry 是否存在并 uptodate

func (*ServiceentryReconciler) OnChange

func (*ServiceentryReconciler) OnRemove

func (*ServiceentryReconciler) Reconcile

func (r *ServiceentryReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

virtualservices.networking.istio.io

func (*ServiceentryReconciler) SetupWithManager

func (r *ServiceentryReconciler) SetupWithManager(mgr ctrl.Manager) error

type TenantGatewayReconciler

type TenantGatewayReconciler struct {
	client.Client
	Log      logr.Logger
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

TenantGatewayReconciler reconciles a TenantGateway object

func (*TenantGatewayReconciler) Reconcile

func (r *TenantGatewayReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*TenantGatewayReconciler) SetupWithManager

func (r *TenantGatewayReconciler) SetupWithManager(mgr ctrl.Manager) error

type TenantNetworkPolicyReconciler

type TenantNetworkPolicyReconciler struct {
	client.Client
	Log      logr.Logger
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

TenantNetworkPolicyReconciler reconciles a TenantNetworkPolicy object

func (*TenantNetworkPolicyReconciler) Reconcile

func (*TenantNetworkPolicyReconciler) SetupWithManager

func (r *TenantNetworkPolicyReconciler) SetupWithManager(mgr ctrl.Manager) error

type TenantReconciler

type TenantReconciler struct {
	client.Client
	Log      logr.Logger
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

TenantReconciler reconciles a Tenant object

func (*TenantReconciler) Reconcile

func (r *TenantReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*TenantReconciler) SetupWithManager

func (r *TenantReconciler) SetupWithManager(mgr ctrl.Manager) error

type TenantResourceQuotaReconciler

type TenantResourceQuotaReconciler struct {
	client.Client
}

TenantResourceQuotaReconciler reconciles a TenantResourceQuota object

func (*TenantResourceQuotaReconciler) Reconcile

func (*TenantResourceQuotaReconciler) SetupWithManager

func (r *TenantResourceQuotaReconciler) SetupWithManager(mgr ctrl.Manager) error

type VirtuslspaceReconciler

type VirtuslspaceReconciler struct {
	client.Client
	Log    logr.Logger
	Scheme *runtime.Scheme
}

VirtuslspaceReconciler 用于解析 ns 上的annotation以在不同的空间中创建sidecar

func (*VirtuslspaceReconciler) OnChange

func (*VirtuslspaceReconciler) Reconcile

func (r *VirtuslspaceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

virtualservices.networking.istio.io

func (*VirtuslspaceReconciler) SetupWithManager

func (r *VirtuslspaceReconciler) SetupWithManager(mgr ctrl.Manager) error

Jump to

Keyboard shortcuts

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