Questions tagged [kubernetes-service]

429 questions
509
votes
11 answers

What's the difference between ClusterIP, NodePort and LoadBalancer service types in Kubernetes?

Question 1 - I'm reading the documentation and I'm slightly confused with the wording. It says: ClusterIP: Exposes the service on a cluster-internal IP. Choosing this value makes the service only reachable from within the cluster. This is the…
AmazingBergkamp
  • 5,708
  • 4
  • 15
  • 24
92
votes
7 answers

How to find the url of a service in kubernetes?

I have a local kubernetes cluster on my local docker desktop. This is how my kubernetes service looks like when I do a kubectl describe service Name: helloworldsvc Namespace: test Labels: …
Foo
  • 4,206
  • 10
  • 39
  • 54
51
votes
4 answers

multiple app nodes how to expose jmx in kubernetes?

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…
Jas
  • 14,493
  • 27
  • 97
  • 148
36
votes
5 answers

How to make use of Kubernetes port names?

In a kubernetes deployment I specify a port like so: containers: - name: nginx image: nginx:latest ports: - name: nginx-port containerPort: 80 protocol: TCP Now in a service I can reference that port like so (allows me to…
soosap
  • 1,365
  • 2
  • 14
  • 30
28
votes
2 answers

Retrieve the full name of a service in Kubernetes

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?
Juliano Costa
  • 2,175
  • 2
  • 18
  • 30
28
votes
3 answers

Why do we need a port/containerPort in a Kuberntes deployment/container definition?

When I define e.g. a deployment in Kubernetes there is a section with a list of containers and each of them contains an array of ports, e.g.: apiVersion: apps/v1 kind: Deployment spec: template: spec: containers: - name: my-nginx …
21
votes
1 answer

How to use Session Affinity on requests to Kubernetes service?

I could not find a documentation that specifies how Kubernetes service behaves when the affiliated deployment is scaled with multiple replicas. I'm assuming there's some sort of load balancing. Is it related to the service type? Also, I would want…
21
votes
4 answers

Securing Kubernetes Service with TLS

I have an application that is internal and exposed only to other application on the cluster by a service with cluster IP. Other services are accessing this application via it's DNS (serviceName-namespace.svc.cluster.local). This application handles…
16
votes
4 answers

Kubernetes: No Route to Host

I have a Bare-Metal Kubernetes custom setup (manually setup cluster using Kubernetes the Hard Way). Everything seems to work, but I cannot access services externally. I can get the list of services when…
Jaskaranbir Singh
  • 2,034
  • 3
  • 17
  • 33
14
votes
2 answers

Why dig does not resolve K8s service by dns name while nslookup has no problems with it?

Here are steps to reproduce: minikube start kubectl run nginx --image=nginx kubectl expose deployment nginx --port=80 --type=ClusterIP kubectl run -i --tty --rm alpine --image=alpine --restart=Never -- sh apk add --no-cache bind-tools Now let's…
Kirill
  • 6,762
  • 4
  • 51
  • 81
13
votes
2 answers

Exposing a service in Kubernetes using nginx reverse proxy

I am new to Kubernetes and wanted to understand how I can expose a service running in Kubernetes to the outside world. I have exposed it using a NodePort on the cluster. So, for example: A service exposes port 31234 on the host and I can get to the…
devops84uk
  • 691
  • 2
  • 6
  • 20
11
votes
2 answers

Kubernetes Service not distributing the traffic evenly among pods

I am using Kubernetes v1.20.10 baremetal installation. It has one master node and 3 worker nodes. The application simply served HTTP requests. I am scaling the deployment based on the (HPA) Horizontal Pod Autoscaler and I noticed that the load is…
11
votes
4 answers

Is it possible to have an Ingress point to a Service from another namespace?

What I want to do is have a service in the default namespace and ingresses in my other namespaces, which point to that service. I tried implementing the service and Ingress shown below, but it didn't work. kind: Service apiVersion: v1 metadata: …
Daniel
  • 509
  • 1
  • 4
  • 17
11
votes
3 answers

Kubernetes: How to allow two pods running in same/different namespace communicate irrespective of the protocol using a servicename?

Allow two pods (say pod A and B) running in same/different namespace communicate irrespective of the protocol(say http,https,akka.tcp) along with a valid Network policy applied. Solutions tried: Tried applying network policy to both the pods and…
10
votes
2 answers

How to start K3s server after running k3s-killall.sh script

I was having K3s cluster with below pods running: kube-system pod/calico-node-xxxx kube-system pod/calico-kube-controllers-xxxxxx kube-system pod/metrics-server-xxxxx kube-system …
1
2 3
28 29