kubernetes-service

Retrieve the full name of a service in Kubernetes

大憨熊 提交于 2020-08-10 23:01:54
问题 By default,according to k8s documentation, Services are assigned a DNS A record for a name of the form my-svc.my-namespace.svc.cluster-domain.example . Is there a command to retrieve the full name of a service? 回答1: You can do a DNS query from any pod and you would get the FQDN. # nslookup api-server Server: 10.96.0.10 Address: 10.96.0.10#53 Name: api-server.default.svc.cluster.local Address: 10.104.225.18 root@api-server-6ff8c8b9c-6pgkb:/# cluster-domain.example is just a example in the

Retrieve the full name of a service in Kubernetes

时光毁灭记忆、已成空白 提交于 2020-08-10 22:57:46
问题 By default,according to k8s documentation, Services are assigned a DNS A record for a name of the form my-svc.my-namespace.svc.cluster-domain.example . Is there a command to retrieve the full name of a service? 回答1: You can do a DNS query from any pod and you would get the FQDN. # nslookup api-server Server: 10.96.0.10 Address: 10.96.0.10#53 Name: api-server.default.svc.cluster.local Address: 10.104.225.18 root@api-server-6ff8c8b9c-6pgkb:/# cluster-domain.example is just a example in the

How do Kubernetes NodePort services with Service.spec.externalTrafficPolicy=Local route traffic?

。_饼干妹妹 提交于 2020-07-22 21:34:32
问题 There seems to be two contradictory explanations of how NodePort services route traffic. Services can route traffic to one of the two, not both: Nodes (through the kube-proxy) According to kubectl explain Service.spec.externalTrafficPolicy and this article that adds more detail, packets incoming to NodePort services with Service.spec.externalTrafficPolicy=Local set get routed to a kube-proxy, which then routes the packets to the corresponding pods its running. This kube-proxy networking

What happens when a service receives a request but has no ready pods?

混江龙づ霸主 提交于 2020-07-20 04:15:10
问题 Having a kubernetes service (of type ClusterIP ) connected to a set of pod s, but none of them are currently ready - what will happen to the request? Will it: fail eagerly timeout wait until a ready pod is available (or forever, whichever is earlier) something else? 回答1: It will time out. Kube-proxy pulls out the IP addresses from healthy pods and sets as endpoints of the service (backends). Also, note that all kube-proxy does is to re-write the iptables when you create, delete or modify a

What happens when a service receives a request but has no ready pods?

放肆的年华 提交于 2020-07-20 04:15:09
问题 Having a kubernetes service (of type ClusterIP ) connected to a set of pod s, but none of them are currently ready - what will happen to the request? Will it: fail eagerly timeout wait until a ready pod is available (or forever, whichever is earlier) something else? 回答1: It will time out. Kube-proxy pulls out the IP addresses from healthy pods and sets as endpoints of the service (backends). Also, note that all kube-proxy does is to re-write the iptables when you create, delete or modify a

Kubernetes: how to access service if nodePort is random?

烈酒焚心 提交于 2020-05-09 14:01:51
问题 I'm new to K8s and am currently using Minikube to play around with the platform. How do I configure a public (i.e. outside the cluster) port for the service? I followed the nginx example, and K8s service tutorials. In my case, I created the service like so: kubectl expose deployment/mysrv --type=NodePort --port=1234 The service's port is 1234 for anyone trying to access it from INSIDE the cluster. The minikube tutorials say I need to access the service directly through it's random nodePort,

2 Kubernetes pod communicating without knowing the exposed address

烈酒焚心 提交于 2020-02-07 04:06:59
问题 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,

Multiple services for same app:port in kubernetes

眉间皱痕 提交于 2020-01-05 08:36:43
问题 I am experimenting with a service discovery scheme on Kubernetes. I have 20+ GRPC services that can be grouped and deployed as applications on Kubernetes. Each application serves several of these services with a common GRPC server. There is a service to publish this GRPC port, and I have labels on those services that identify which GRPC servers are running there. For instance, I have APP1 application serving GRPC services a,b,c. There is a service in front of APP1 connected to the port 8000,

Kubernetes service architecture

妖精的绣舞 提交于 2019-12-24 08:17:09
问题 Within the same kubernetes cluster, Can I have multiple StatefulSets attached to one headless service or should each StatefulSet have it's own headless service? What are the pros and cons of doing this? Can I mix standard and headless services in the same cluster? Specifically, I would like to use LoadBalancer service to load balance headless services. Can I define a service of type LoadBalancer and have headless services (ClusterIP = None) attached to it? If yes, how can I achieve this? Here

multiple app nodes how to expose jmx in kubernetes?

馋奶兔 提交于 2019-12-20 08:13:08
问题 In kubernetes I can expose services with service . This is fine. Lets say I have 1 web instance and 10 java server instances. I have a windows gateway I'm used to access those 10 java servers instances via the jconsole installed on it. Obviously I do not expose all apps jmx port via kubernetes service. What are my options here? how should I allow this external to kubernetes cluster windows gateway access to those 10 servers jmx ports? Any practices here? 回答1: Another option is to forward JMX