Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Condition types for BoundEndpoint ConditionTypeReady = "Ready" ConditionTypeServicesCreated = "ServicesCreated" ConditionTypeConnectivityVerified = "ConnectivityVerified" )
View Source
const ( // Reasons for Ready condition ReasonBoundEndpointReady = "BoundEndpointReady" ReasonServicesNotCreated = "ServicesNotCreated" ReasonConnectivityNotVerified = "ConnectivityNotVerified" // Reasons for ServicesCreated condition ReasonServicesCreated = "ServicesCreated" ReasonServiceCreationFailed = "ServiceCreationFailed" // Reasons for ConnectivityVerified condition ReasonConnectivityVerified = "ConnectivityVerified" ReasonConnectivityFailed = "ConnectivityFailed" )
View Source
const ( LabelManagedBy = "app.kubernetes.io/managed-by" LabelBoundEndpointName = "bindings.k8s.ngrok.com/endpoint-binding-name" LabelBoundEndpointNamespace = "bindings.k8s.ngrok.com/endpoint-binding-namespace" LabelEndpointURL = "bindings.k8s.ngrok.com/endpoint-url" // Used for indexing Services by their BoundEndpoint owner. Not an actual // field on the Service object. BoundEndpointOwnerKey = ".metadata.controller" // Used for indexing BoundEndpoints by their target namespace. Not an actual // field on the BoundEndpoint object. BoundEndpointTargetNamespacePath = ".spec.targetNamespace" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoundEndpointPoller ¶
type BoundEndpointPoller struct {
client.Client
Log logr.Logger
Recorder events.EventRecorder
// Namespace is the namespace to manage for BoundEndpoints
Namespace string
// KubernetesOperatorConfigName is the expected name of the KubernetesOperator that we should poll
KubernetesOperatorConfigName string
// NgrokClientset is the ngrok API clientset
NgrokClientset ngrokapi.Clientset
// PollingInterval is how often to poll the ngrok API for reconciling the BindingEndpoints
PollingInterval time.Duration
// PortRange is the allocatable port range for the Service definitions to Pod Forwarders
PortRange PortRangeConfig
// TargetServiceAnnotations is a map of key/value pairs to attach to the BoundEndpoint's Target Service
TargetServiceAnnotations map[string]string
// TargetServiceLabels is a map of key/value pairs to attach to the BoundEndpoint's Target Service
TargetServiceLabels map[string]string
// DrainState is used to check if the operator is draining.
// If draining, polling is skipped to prevent creating new resources.
DrainState DrainState
// contains filtered or unexported fields
}
BoundEndpointPoller is a process to poll the ngrok API for binding_endpoints and reconcile the desired state with the cluster state of BoundEndpoints
type BoundEndpointReconciler ¶
type BoundEndpointReconciler struct {
client.Client
Scheme *runtime.Scheme
Log logr.Logger
Recorder events.EventRecorder
// ClusterDomain is the last part of the FQDN for Service DNS in-cluster
ClusterDomain string
// UpstreamServiceLabelSelectors are the set of labels for the Pod Forwarders
UpstreamServiceLabelSelector map[string]string
RefreshDuration time.Duration
// contains filtered or unexported fields
}
BoundEndpointReconciler reconciles a BoundEndpoint object
func (*BoundEndpointReconciler) Reconcile ¶
func (r *BoundEndpointReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile turns BoundEndpoints into 2 Services - ExternalName Target Service in the Target Namespace/Service name pointed at the Upstream Service - Upstream Service in the ngrok-op namespace pointed at the Pod Forwarders
func (*BoundEndpointReconciler) SetupWithManager ¶
func (r *BoundEndpointReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type DrainState ¶
DrainState is an alias for drain.State for convenience
type ForwarderReconciler ¶
type ForwarderReconciler struct {
client.Client
Log logr.Logger
Scheme *runtime.Scheme
Recorder events.EventRecorder
BindingsDriver *bindingsdriver.BindingsDriver
KubernetesOperatorName string
RootCAs *x509.CertPool
// DrainState is used to check if the operator is draining.
// If draining, non-delete reconciles are skipped to prevent new finalizers.
DrainState controller.DrainState
// contains filtered or unexported fields
}
func (*ForwarderReconciler) SetupWithManager ¶
func (r *ForwarderReconciler) SetupWithManager(mgr ctrl.Manager) (err error)
type PortRangeConfig ¶
type PortRangeConfig struct {
// Start is the minimum port number
Min uint16
// Max is the maximum port number
Max uint16
}
PortRangeConfig is a configuration for a port range Note: PortRange is inclusive: `[Min, Max]`
Click to show internal directories.
Click to hide internal directories.