kubeslice / worker-operator

Kubeslice Worker Operator Opensource Repository: The KubeSlice Worker Operator is a Kubernetes operator that manages the lifecycle of KubeSlice worker clusters.
Apache License 2.0
58 stars 19 forks source link

Reconcile port numbers in ovpn client deployments #309

Closed bharath-avesha closed 2 months ago

bharath-avesha commented 9 months ago

šŸ“œ Description

An ovpn client deployment for a slice gateway is created with the NodePort port numbers specified in the workerslicegateway object. The logic to handle a change in the port numbers seems to be missing. The ovpn clients continue to connect on the previously specified port numbers. The ovpn client deployment needs to be updated to effect a change in the port number.

šŸ‘Ÿ Reproduction steps

There are two options:

  1. Delete the slice object manually on the designated server cluster. This will lead to deletion of the slicegateway objects as well. Make sure the NodePort services are also deleted. Then restart the worker-operator pod. This will lead to re-creation of the slice and slicegateway objects, and new NodePort services. The workerslicegateway objects are updated with new port numbers, but on the client cluster the port number is not updated in the ovpn deployment.

  2. Manually edit the client deployment and update the port number to a random value. The worker-operator does not reconcile the deployment back to valid port numbers.

šŸ‘ Expected behavior

The worker-operator on the client cluster should reconcile the ovpn deployments to use currently relevant port numbers.

šŸ‘Ž Actual Behavior

The ovpn client deployments continue to use invalid port numbers leading to loss in connectivity between clusters.

šŸš Relevant log output

No response

Version

No response

šŸ–„ļø What operating system are you seeing the problem on?

No response

āœ… Proposed Solution

No response

šŸ‘€ Have you spent some time to check if this issue has been raised before?

Code of Conduct

kon3m commented 4 months ago

I would like to work on this issue,My approach on solving the issue is as follows: 1) Check if the port number present in the current deployment and the workserslicegateway object is same or not (slicegateway/reconciler.go). 2) If they are not then update the ovpn client deployment with the relevant port(from workerslicegateway) (slicegateway/reconciler.go). 3) Write a generic helper to update the deployment in slicegateway/slicegateway.go and call it from the above snippet. 4) Write the relevant test cases as well.

Rahul-D78 commented 4 months ago

Sure @kon3m this approach looks good to me, Let me know if any help required. cc: @narmidm @bharath-avesha

narmidm commented 4 months ago

approach looks good to me @kon3m. please continue.

kon3m commented 4 months ago

@narmidm i have raised a PR following the above approach , could you please review it?

narmidm commented 4 months ago

sure.

narmidm commented 4 months ago

@kon3m -> https://github.com/kubeslice/worker-operator/pull/333#issuecomment-1959256008

yuvarajrece commented 2 months ago

Investigate why the worker-operator isn't reconciling ovpn deployments with updated port numbers. Check logs and configurations for errors or misconfigurations.

Ensure the worker-operator is configured to monitor changes in workerslicegateway objects and update ovpn deployments accordingly.

Update worker-operator configuration if needed, adjusting reconciliation loops or event handlers to detect and react to port number changes.

Thoroughly test any configuration changes to ensure ovpn deployments are updated correctly when port numbers change in workerslicegateway objects.

Automating this process with the worker-operator will streamline updates, minimizing manual intervention and ensuring consistent connectivity between clusters.