Score:1

k8s kubernetes fails initail test

gb flag

I am new to kubernetes and am trying to learn.

I set up 2 VMs and they connect to eachother via a host-only network.

I followed these 2 guides:

How to Install Kubernetes Cluster on Debian 11 with Kubeadm

Deploy Kubernetes Cluster on Debian 11 with Containerd

Everything seems to go well until I get to "9) Test Kubernetes Cluster Installation"

(Master)$ kubectl create deployment nginx-app --image=nginx --replicas 2
deployment.apps/nginx-app created
(Master)$ kubectl expose deployment nginx-app --name=nginx-web-svc --type NodePort --port 80 --target-port 80
service/nginx-web-svc exposed
(Master)$ kubectl describe svc nginx-web-svc
Name:                     nginx-web-svc
Namespace:                default
Labels:                   app=nginx-app
Annotations:              <none>
Selector:                 app=nginx-app
Type:                     NodePort
IP Family Policy:         SingleStack
IP Families:              IPv4
IP:                       10.96.22.154
IPs:                      10.96.22.154
Port:                     <unset>  80/TCP
TargetPort:               80/TCP
NodePort:                 <unset>  30315/TCP
Endpoints:                <none>
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>

Note: the Endpoints: < none > does not match the expected output in the walkthrough. it has Endpoints: 172.16.126.1:80, 172.16.194.65:80

and when I try and access the exposed port...

(Master)$ curl http://k-worker-01:30315
curl: (7) Failed to connect to k-worker-01 port 30315: Connection refused

Note: in my vm setup I have 2 network adapters

  1. attached to NAT
  2. attached to Host-only Adapter

I can ping in both directions

$ ping -c4 k-worker-01

and

$ ping -c4 k-master

I'm not sure what to try next. Any help is greatly appreciated.

in flag
Missing `Endpoints` is caused by there being no Pods in `Ready` that match `app=nginx-app`; you'll want to start by [editing your question](https://serverfault.com/posts/1116089/edit) to include `kubectl get -o yaml svc/nginx-web-svc` and `kubectl get -o yaml po -l app=nginx-app` since that cute `kubectl expose` and `kubectl run` stuff is really designed only to make people ask questions, and not for good outcomes
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.