Comments (11)
Probably doable
from micronaut-kubernetes.
To be precise, what the current implementation uses is the EndpointsSubset.addresses
. Quoting Kubernetes documentation:
IP addresses which offer the related ports that are marked as ready. These endpoints should be considered safe for load balancers and clients to utilize
The reason to not use the Service.clusterIP
is consistency: all Micronaut service discovery implementations use Micronaut's load balancing capabilities.
So in this case, the issue is really an outdated service list, and therefore, implementing #186 by watching endpoints changes will fix this issue.
from micronaut-kubernetes.
@alvarosanchez We did not have caching enabled when we encountered the problem with unavailable pods in the service list. So from what I understand the discovery-client refreshed the service list on each request. One pod was unavailable nonetheless. Maybe the k8s api server state was not propagated fast enough, I dont know.
At the same time we had Micronaut 1.2.x-based apps that used the same service (with a failing pod) via the cluster-ip, and those apps experienced much fewer issues. 15 instances of 1.2-based apps had about 500 connection errors in total, at the same time a single 2.0.2 based canary app had connection 2000 errors. The traffic was evenly distributed over those 16 instances.
from micronaut-kubernetes.
If you really want to use the cluster IP, you can use the records created by kube-dns
, eg:
@Client("my-service.my-namespace.svc.cluster.local")
from micronaut-kubernetes.
@alvarosanchez maybe worth documenting that somewhere if that is viable fix. @luckyswede does that work for you?
from micronaut-kubernetes.
also does that need to be in ${..}
?
from micronaut-kubernetes.
Yes, we're going for a similar solution, we've implemented a discovery-client that creates a k8s service-url from the service-id. It's more "plug-n-play", we dont have to change the client annotations or add config entries.
from micronaut-kubernetes.
@graemerocher a related question, what is the contract for DiscoveryClient.getServiceIds
? Is it supposed to return all service-ids that it has "seen" in requests to getInstances
? Or a list of all service-ids it supports (which is not possible if the service-instance is calculated from the service-id)?
from micronaut-kubernetes.
also does that need to be in
${..}
?
No, it doesn't. Given a service my-service
in a namespace my-namespace
, my-service.my-namespace.svc.cluster.local
will be a DNS A
record that will resolve to the service cluster IP.
But I did miss the rest of the URL, so it should be something like:
@Client("http://my-service.my-namespace.svc.cluster.local:8080")
from micronaut-kubernetes.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from micronaut-kubernetes.
addressed in #215
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.