As it stands:
I have an slim ubuntu pod running NTP, it is configured with the default pools. If I run in the pod ntpd -p I get the following:
remote refid st t when poll reach delay offset jitter
==============================================================================
0.ubuntu.pool.n .POOL. 16 p - 64 0 0.000 +0.000 0.000
1.ubuntu.pool.n .POOL. 16 p - 64 0 0.000 +0.000 0.000
2.ubuntu.pool.n .POOL. 16 p - 64 0 0.000 +0.000 0.000
3.ubuntu.pool.n .POOL. 16 p - 64 0 0.000 +0.000 0.000
ntp.ubuntu.com .POOL. 16 p - 64 0 0.000 +0.000 0.000
time.cloudflare 10.106.8.4 3 u - 64 1 3.887 +475.94 0.000
y.ns.gin.ntt.ne 129.250.35.222 2 u - 64 1 3.529 +476.41 0.000
paladin.latt.ne 44.24.199.34 3 u 1 64 1 14.766 +473.73 0.000
However if I run ntpdate -q ipv4 of the exposed pod I get
server 172.18.250.139, stratum 2, offset +0.374872, delay 0.02608 27 Dec 22:30:11 ntpdate[2967519]: no server suitable for synchronization found
So, I am not sure what the issue is
My yaml files are below:
#ntp-deployment.yaml
apiVersion: v1
kind: Pod
metadata:
name: avmc-ntp-app
labels:
app: avmc-ntp
namespace: avmc-ntp
spec:
containers:
- name: avmc-ntp
image: kmgoddard/ubuntu-ntp:latest
command: ["/bin/sleep", "3650d"]
imagePullPolicy: IfNotPresent
ports:
- name: ubuntu-ntp
containerPort: 123
hostPort: 123
protocol: UDP
restartPolicy: Always
#ns.yaml
apiVersion: v1
kind: Namespace
metadata:
name: avmc-ntp
#ntp-service.yaml
apiVersion: v1
kind: Service
metadata:
name: avmc-ntp-app-service
namespace: avmc-ntp
annotations:
metallb.universe.tf/loadBalancerIPs: 172.18.250.139
spec:
selector:
app: avmc-ntp
ports:
- protocol: UDP
port: 123
targetPort: 123
type: LoadBalancer
I tried exposing the port through MetalLB load balancer exposing port 123 to the NTP server.
What is expected is to return a response such as:
server 172.18.246.246, stratum 4, offset +0.857402, delay 0.02602 27 Dec 22:39:03 ntpdate[2975234]: step time server acmentphost offset +0.857402 sec