Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcceptorController ¶
type AcceptorController struct { client.Client // ConsulClientConfig is the config to create a Consul API client. ConsulClientConfig *consul.Config // ConsulServerConnMgr is the watcher for the Consul server addresses. ConsulServerConnMgr consul.ServerConnectionManager // ExposeServersServiceName is the Kubernetes service name that the Consul servers are using. ExposeServersServiceName string // ReleaseNamespace is the namespace where this controller is deployed. ReleaseNamespace string // Log is the logger for this controller Log logr.Logger // Scheme is the API scheme that this controller should have. Scheme *runtime.Scheme context.Context }
AcceptorController reconciles a PeeringAcceptor object.
func (*AcceptorController) Reconcile ¶
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. PeeringAcceptor resources determine whether to generate a new peering token in Consul and store it in the backend specified in the spec.
- If the resource doesn't exist, the peering should be deleted in Consul.
- If the resource exists, and a peering doesn't exist in Consul, it should be created.
- If the resource exists, and a peering does exist in Consul, it should be reconciled.
- If the status of the resource does not match the current state of the specified secret, generate a new token and store it according to the spec.
NOTE: It is possible that Reconcile is called multiple times concurrently because we're watching two different resource kinds. As a result, we need to make sure that the code in this method is thread-safe. For example, we may need to fetch the resource again before writing because another call to Reconcile could have modified it, and so we need to make sure that we're updating the latest version.
func (*AcceptorController) SetupWithManager ¶
func (r *AcceptorController) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type PeeringDialerController ¶
type PeeringDialerController struct { client.Client // ConsulClientConfig is the config to create a Consul API client. ConsulClientConfig *consul.Config // ConsulServerConnMgr is the watcher for the Consul server addresses. ConsulServerConnMgr consul.ServerConnectionManager // Log is the logger for this controller. Log logr.Logger // Scheme is the API scheme that this controller should have. Scheme *runtime.Scheme context.Context }
PeeringDialerController reconciles a PeeringDialer object.
func (*PeeringDialerController) Reconcile ¶
func (r *PeeringDialerController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.
func (*PeeringDialerController) SetupWithManager ¶
func (r *PeeringDialerController) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.