Node name mismatch when trying to access publicly exposed RabbitMQ through Kubernetes - kubernetes

I'm trying to access a publicly exposed RabbitMQ running in a EKS Kubernetes cluster
The Load Balancer Service was created and works properly (I'm able to connect to the exposed port using telnet)
The problem is that when I try to connect to RabbitMQ using a CLI tool I get:
Node name (or hostname) mismatch: node "rabbit#shared-service-rabbitmq-0.shared-service-rabbitmq-headless.shared.svc.cluster.local" believes its node name is not "rabbit#some-domain.com" but something else
I didn't find a way to change the hostname or the node name using the Helm chart
I'm pretty sure that the solution is something really simple but I'm spending many hours researching and I still don't see how to fix this
Could someone please point me to the right direction?
Thanks in advance

Related

Why does K8s app fail to connect MongoDB atlas? - persist k8s nodes IP's

Just trying to make an app on k8s to connect to MongoDB atlass,
So far tried the following:
Changed the DNSpolicy to Default and many others - no luck
Created nginx-ingress link- so have the main IP address of the cluster
Added that IP to IP access list - but still no luck
The cluster tier is M2 - so no private peering or private endpoints.
The Deployment/Pod that is trying to connect will not have an a DNS assigned to it, it is simply a service running inside of the k8s and processing rabbitmq messages.
So not sure on what I should whitelist if the service is never exposed.
I assume it would have to be something with Nodes or K8s egress or something, but not sure where to even look
Tried pretty much everything I could and still cannot find clear documentation on how to achieve the desired result apart from whitelisting All IP addresses
UPDATE: Managed to find this article https://www.digitalocean.com/community/questions/urgent-how-to-connect-to-mongodb-atlas-cluster-from-a-kubernetes-pod
So now im trying to find a way to persist Node IP addresses, as I understand during the scale up or down or upgrade of nodes it will create new IP addresses.
So is there a way to persist them?

Launch a specific Pod via API and connect from outside

I am currently designing a system where users should be able to start a simulation through a Web Portal and then connect to it with a gRPC client (amongst other things). After the user is finished the simulation then terminates. I want to run the whole system in a kind of microservice architecture in a kubernetes cluster if possible. This is however my first time working with kubernetes and I am unsure if it is possible to achieve this.
As far as I could gather from reading the documentation and googling around it seems like I should be able to launch a pod by calling POST /api/v1/namespaces/{namespace}/pods and making it availble under the Host IP by setting hostPort. However what I dont know is how I would determine a free port on the Node to deploy to or let kubernetes decide that (if hostPort is even the correct choice for this). After that it should be pretty straightforward. Send the user the IP:Port to connect to and he just plugs that into his gRPC client.
Any suggestions on how to best achieve this?
Using hostPort is rather not recommended, so you'd be better off by specifying a service and access your Pod via a service. In your case you can define NodePort service and let Kubernetes decide on the port. Then, fetch the service port using Kubernetes API.

2 Kubernetes pod communicating without knowing the exposed address

I plan to deploy 2 kubernetes pods with a NodePort service to expose them into the network. Now i want pod 1 be able to access the pod 2 by his service.
The Problem is i write the Deployment files and i don't know the ip address pod 2 will get from the cluster, but i need to set the address into the file from pod 1 wiva a env. variable.
Is there a other way in a kubernetes cluster to make them accessible by sth. like the name of the service or sth. like this?
failed to google for this case, and hope anyone of you can give me a hint.
greetings,
Martin.
All kubernetes resources should be referenced by the kubeDNS, you should be able to use the name of the resource to communicate between pods.
You should be able to make it work with something like this: SERVICENAME.SERVICENAMESPACE:PORT and it can be used in an ENV variable without issue.
Hope this answer the question.

Connect pod to local process with minikube

I am new to kubernetes and trying to throw together a quick learning project, however I am confused on how to connect a pod to a local service.
I am storing some config in a ZooKeeper instance that I am running on my host machine, and am trying to connect a pod to it to grab config.
However I cannot get it to work, I've tried the magic "10.0.2.2" that I've read about, but that did not work. I also tried creating a service and endpoint, but again to no avail. Any help would be appreciated, thanks!
Also, for background I'm using minikube on macOS with the hyperkit vm-driver.

Kubernetes: Connect to the outside world from pod

I have a local Kubernetes cluster on a single machine, and a container that needs to receive a url (like https://www.wikipedia.org/) and extract the text content from it. Essentially I need my pod to connect to the outside world. Since I am using v1.2.5, I need some DNS add-on like SkyDNS, but I cannot find any working example or tutorial on how to set it up. Tutorials like this usually only tell me how to make pods within the cluster talk to each other by DNS look-up.
Therefore, could anyone give me some advice on how to set up and configure an add-on of Kubernetes so that pods can access the public Internet? Thank you very much!
You can simply create your pods with "dnsPolicy: Default", this will give it a resolv.conf just like on the host and it will be able to resolve wikipedia.org. It will not be able to resolve cluster local services.If you're looking to actually deploy kube-dns so you can also resolve cluster local services this is probably the best starting point: https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/