Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register operator #457

Merged
merged 9 commits into from
Oct 22, 2024
Merged

Register operator #457

merged 9 commits into from
Oct 22, 2024

Conversation

jonstacks
Copy link
Collaborator

What

Registers the the Kubernetes Operator with the ngrok API. If bindings are enabled, it generates the TLS secret with a private key, creates a CSR as part of registration, and saves the returned certificate in the secret.

How

  • Consolidate the binding configuration and TLS secret reconcilers into the KubernetesOperator reconciler.

Breaking Changes

Yes, some of the existing CRDs are being replaced with this change. We haven't released these yet, so unless someone is running on the latest main, they won't be impacted.

@jonstacks jonstacks self-assigned this Oct 21, 2024
@jonstacks jonstacks requested a review from a team as a code owner October 21, 2024 17:46
@github-actions github-actions bot added area/controller Issues dealing with the controller area/helm-chart Issues dealing with the helm chart labels Oct 21, 2024
@@ -154,7 +154,7 @@ func (r *EndpointBindingPoller) createBinding(ctx context.Context, hashedName st
return nil
}

func (r *EndpointBindingPoller) updateBinding(ctx context.Context, binding *bindingsv1alpha1.EndpointBinding, apiEndpoint *EndpointBinding, urlBits *URLBits) error {
func (r *EndpointBindingPoller) updateBinding(ctx context.Context, binding *bindingsv1alpha1.EndpointBinding, _ *EndpointBinding, urlBits *URLBits) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up we might conflict on this change

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can drop it out that commit easily if needed.

return r.controller.Reconcile(ctx, req, new(ngrokv1alpha1.KubernetesOperator))
}

func (r *KubernetesOperatorReconciler) create(ctx context.Context, ko *ngrokv1alpha1.KubernetesOperator) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the API registration is happening in the reconcile loop rather then on startup. I think this changes the expected behaviour of the ngrok-op where previously we would not want the container to ready up and we do not want bindingconfig to be reconciled unless the ngrok-op can claim/register with the API first.

@jonstacks
Copy link
Collaborator Author

I need to fix this before its ready. I thought it was but I discovered that we can't create the KubernetesOperator CR in the helm chart like I thought we could. I'll be moving this back to a similar pattern like we had above where it is created as part of the api-manger's main.

@jonstacks jonstacks merged commit 6cbfbb9 into ngrok:main Oct 22, 2024
7 checks passed
@jonstacks jonstacks deleted the register-operator branch October 22, 2024 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/controller Issues dealing with the controller area/helm-chart Issues dealing with the helm chart
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants