namespace

package
v0.0.0-...-7754ea6 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const DeletionTimestampKey = "deletionTimestamp"

DeletionTimestampKey is the key in a resource's metadata that stores the timestamp when a resource was marked for deletion. This only applies to resources with finalizers.

Variables

This section is empty.

Functions

func EnsureDeleted

func EnsureDeleted(ctx context.Context, client pbresource.ResourceServiceClient, ap, ns string) error

EnsureDeleted ensures a Consul namespace with name ns in partition ap is deleted or is in the process of being deleted. If neither, it will mark it for deletion.

func EnsureExists

func EnsureExists(ctx context.Context, client pbresource.ResourceServiceClient, ap, ns string) (bool, error)

EnsureExists ensures a Consul namespace with name ns exists and is not marked for deletion. If it doesn't, exist it will create it. If it is marked for deletion, returns an error.

Boolean return value indicates if the namespace was created by this call.

Types

type Controller

type Controller struct {
	client.Client
	// ConsulServerConnMgr is the watcher for the Consul server addresses.
	ConsulServerConnMgr consul.ServerConnectionManager
	// K8sNamespaceConfig manages allow/deny Kubernetes namespaces.
	common.K8sNamespaceConfig
	// ConsulTenancyConfig contains the destination partition.
	common.ConsulTenancyConfig
	Log logr.Logger
}

Namespace syncing between K8s and Consul is vastly simplified when V2 tenancy is enabled. Put simply, a K8s namespace maps 1:1 to a Consul namespace of the same name and that is the only supported behavior.

The plethora of configuration options available when using V1 tenancy have been removed to simplify the user experience and mapping rules.

Hence, the following V1 tenancy namespace helm configuration values are ignored: - global.enableConsulNamespaces - connectInject.consulNamespaces.consulDestinationNamespace - connectInject.consulNamespaces.mirroringK8S - connectInject.consulNamespaces.mirroringK8SPrefix.

func (*Controller) Reconcile

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

Reconcile reads a Kubernetes Namespace and reconciles the mapped namespace in Consul.

func (*Controller) SetupWithManager

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

SetupWithManager registers this controller with the manager.

Jump to

Keyboard shortcuts

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