iantowey opened a new pull request, #25872:
URL: https://github.com/apache/pulsar/pull/25872

   ### Motivation                                                               
                                                                                
                                        
                                                                                
                                                                                
                                       
   Currently, the `KubernetesRuntime` hardcodes the Kubernetes service domain 
suffix to `.svc.cluster.local` when constructing the gRPC address used by the 
Function Worker to connect to function      
   instances. If a Function Worker is deployed outside of the Kubernetes 
cluster, it cannot communicate with the function pods because it cannot resolve 
the internal cluster DNS.                      
                                                                                
                                                                                
                                       
   This change solves the problem by allowing users to customize the domain 
suffix, enabling external Function Workers to route traffic to function 
instances via an external Gateway or Ingress.      
   
   ### Modifications                                                            
                                                                                
                                        
                                                                                
                                                                                
                                       
   - Added a new `kubernetesServiceDomainSuffix` configuration parameter to 
`functions_worker.yml` and `KubernetesRuntimeFactoryConfig`.                    
                                            
   - Passed the new parameter through `KubernetesRuntimeFactory` down into 
`KubernetesRuntime`.                                                            
                                             
   - Updated `KubernetesRuntime.getServiceUrl()` to use the configured suffix 
if provided, safely falling back to `.svc.cluster.local` if left blank to 
preserve backwards compatibility.               
   - Added a unit test `testGetServiceUrl` in `KubernetesRuntimeTest` to verify 
both the default behavior and the customized suffix behavior.    
   
   
   ### Verifying this change                                                    
                                                                                
                                     
   
   - [x] Make sure that the change passes the CI checks.                        
                                                                                
                                     
   
   This change added tests and can be verified as follows:                      
                                                                                
                  
   
     - *Added unit test `testGetServiceUrl` in `KubernetesRuntimeTest` to 
ensure that `getServiceUrl` constructs the correct FQDN using either the 
default suffix or the custom                         
        `kubernetesServiceDomainSuffix`.*                                       
                                                                                
                                             
                                                                                
                                                                                
                                            
   
   ### Does this pull request potentially affect one of the following parts:    
                                                                                
                                        
                                                                                
                                                                                
                                             
        - [ ] Dependencies (add or upgrade a dependency)                        
                                                                                
                                             
        - [ ] The public API                                                    
                                                                                
                                             
        - [ ] The schema                                                        
                                                                                
                                             
        - [x] The default values of configurations                              
                                                                                
                                             
        - [ ] The threading model                                               
                                                                                
                                             
        - [ ] The binary protocol                                               
                                                                                
                                             
        - [ ] The REST endpoints                                                
                                                                                
                                             
        - [ ] The admin CLI options                                             
                                                                                
                                             
        - [ ] The metrics                                                       
                                                                                
                                             
        - [x] Anything that affects deployment  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to