Comments (9)
sure sure, that was my idea, I meant mandatory in case you want to discovery service from other then app configured namespace.
from micronaut-kubernetes.
How would using #
as separator propagate to the client configuration? Lets say you would like to set the read timeout for the client
micronaut.http.services.my-ns#my-service.read-timeout=PT5S
Thinking that #
is considered a comment in .yaml
and .properties
files.
from micronaut-kubernetes.
@jaksah we spoke about this with @alvarosanchez and at this moment we agreed that the namespace will be part of configuration like:
kubernetes:
client:
discovery:
services:
my-service:
namespace: my-ns
from micronaut-kubernetes.
It shouldn't be too difficult to change https://github.com/micronaut-projects/micronaut-kubernetes/blob/master/kubernetes-discovery-client/src/main/java/io/micronaut/kubernetes/discovery/KubernetesDiscoveryClient.java#L84 to search in all namespaces. PRs welcomed
from micronaut-kubernetes.
@alvarosanchez imho this could potentially end up in lot of 403s if micronaut service account is not authorised to get Services. But by default it could do the job, but I would extend it with namespace filtering, similarly like it's for service filtering. Anyway, in my opinion we should also distinguish service namespaces in the annotation liek @Client('<namespace>.<service-name>')
.
from micronaut-kubernetes.
The 403s can also happen even for the default namespace. I expect someone wanting to call services across namespaces to understand it needs permissions. Hence, I wrote https://micronaut-projects.github.io/micronaut-kubernetes/latest/guide/#_kubernetes_api_authentication. It should be a matter of explaining it there.
Regarding namespace filtering, I see it problematic. The Kubernetes API lets you search either within a concrete namespace, or all. If you were to have includes/excludes, you would need to make several API calls to retrieve the list of namespaces first, then for each retrieve the list of services. And the service discovery is refreshed every 30 seconds.
A better option would be specifying the namespace in the annotation as you suggested (I'd rather avoid using a dot as separator, so maybe @Client("<namespace>#<service-name>")
). That way you only search on that namespace.
from micronaut-kubernetes.
Yeah, if we would make it like mandatory to define the namespace in the annotation to distinguish the target namespace, then the filtering is useless. 👍
from micronaut-kubernetes.
It doesn't need to be mandatory though. One could have @Client("my-service")
(which would target the default namespace) and @Client("my-ns#my-service")
from micronaut-kubernetes.
Closing addressed in #191
from micronaut-kubernetes.
Related Issues (20)
- Secrets with non-printable characters are corrupted on the app side
- Application fails to start on local when Kubernetes config is present in .kube directory HOT 10
- micronaut-kubernetes-informer prevents BeanCreatedEventListener<ApiClient> from firing HOT 1
- Move examples to guides HOT 5
- BOM contains invalid entry
- Kubernetes ConfigMap with single key value should not be parsed as a file reference
- DefaultNamespaceResolver runs in non k8s environments
- Dependency Dashboard
- ConfigMapLabelSupplier tries to initialize when eagerInitSingletons property is set to true HOT 4
- Consider supporting Java Operator SDK
- [Security vulnerability] Update dependency Kubernetes Java Client to v16 HOT 1
- Not possible to use namespaceSupplier without namespace on @Informer with DefaultInformerNamespaceResolver
- Broken Build in branch targeting Micronaut Framework 3.x HOT 1
- Migrate to new configuration ascidoc macro
- Consider simplifying CI
- path to be lazy initialized by injecting a provider to avoid this issue
- K8s Doc generation fails
- Informer library implementation influencing and limiting the naming of Custom Resource java classes HOT 3
- Controller for all namespaces can't get object from indexer using provided OperatorResourceLister
- Support watching K8s secrets to change properties without restart HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micronaut-kubernetes.