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
- attached to NAT
- 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.