외부 NTP 서버 구성

이 페이지에서는 에어 갭 적용 Google Distributed Cloud (GDC) 어플라이언스의 외부 NTP 서버를 구성하는 방법을 설명합니다.

이 단계는 어플라이언스를 외부 시간 소스와 동기화하려는 경우에만 필요합니다.

시작하기 전에

어플라이언스를 외부 NTP 서버와 동기화하려면 기기를 구성하고 소프트웨어를 설치하세요.

NTP 릴레이 구성

  1. GDC 에어갭 어플라이언스가 NTP 서버에 액세스하는 데 사용해야 하는 IP 주소를 확인합니다. 트래픽을 허용하도록 방화벽 규칙을 조정해야 할 수도 있습니다.

  2. 루트 kubeconfig를 사용하여 관리 플레인 클러스터에서 ntprelay CR을 수정하고 upstreamServers 섹션을 추가합니다.

    kubectl edit ntprelay bi-ntp-relay -n gpc-system
    ntprelay.system.private.gdc.goog/bi-ntp-relay edited
    kubectl get ntprelay bi-ntp-relay -n gpc-system -oyaml
    

    결과 YAML에는 다음 예와 같이 IP가 포함된 업데이트된 .spec 섹션이 있습니다.

    apiVersion: system.private.gdc.goog/v1alpha1
    kind: NTPRelay
    metadata:
      creationTimestamp: "2025-05-16T08:44:21Z"
      generation: 2
      name: bi-ntp-relay
      namespace: gpc-system
      resourceVersion: "10871409"
      uid: 6cde8e65-791c-4bc6-9a8b-d5c9bf103f8b
    spec:
      upstreamServers:
      - 192.0.2.030
    
  3. 각 노드의 시간을 확인합니다.

    동기화할 시간을 주기 위해 3분간 기다린 후 루트 kubeconfig를 사용하여 제어 영역 클러스터에서 다음 명령어를 실행합니다.

    kubectl get pods -l app.kubernetes.io/name=ntp -n ntp-system -o name | xargs -P 0 -I {} kubectl exec {} -n ntp-system -- date; echo
    

    출력에 각 노드의 시간이 표시되며 이는 NTP 서버의 시간과 일치합니다. 결과는 다음과 유사합니다.

    Defaulted container "ntp-image" out of: ntp-image, ntp-node-exporter
    Defaulted container "ntp-image" out of: ntp-image, ntp-node-exporter
    Defaulted container "ntp-image" out of: ntp-image, ntp-node-exporter
    Thu Nov  6 19:39:34 UTC 2025
    Thu Nov  6 19:39:34 UTC 2025
    Thu Nov  6 19:39:34 UTC 2025
    

연결 문제 디버그

시간이 일치하지 않으면 루트 kubeconfig를 사용하여 제어 영역 클러스터에서 다음 명령어를 실행하여 NTP 서버에 대한 연결을 디버그합니다.

kubectl get pods -l app.kubernetes.io/name=ntp -n ntp-system -o name | xargs -I {} kubectl exec {} -n ntp-system -- sh -c "chronyc sources -v; echo; chronyc ntpdata"; echo

정상적인 연결의 출력은 다음과 같습니다. 외부 서버의 IP가 ^*로 시작합니다. 소스 데이터 (예: Remote address : 192.0.2.026)에서 TX는 전송된 패킷 수이고 RX는 수신된 패킷 수입니다. RX이 0이면 연결 문제를 나타냅니다. 방화벽을 확인하여 NTP 요청이 통과하는지 확인합니다.

  .-- Source mode  '^' = server, '=' = peer, '#' = local clock.
/ .- Source state '*' = current best, '+' = combined, '-' = not combined,
| /             'x' = may be in error, '~' = too variable, '?' = unusable.
||                                                 .- xxxx [ yyyy ] +/- zzzz
||      Reachability register (octal) -.           |  xxxx = adjusted offset,
||      Log2(Polling interval) --.      |          |  yyyy = measured offset,
||                                \     |          |  zzzz = estimated error.
||                                 |    |           \
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
^* 192.0.2.026                   1   6    17    43   +286ns[  +36us] +/- 1160us
=? 192.0.2.029                 0   6     0     -     +0ns[   +0ns] +/-    0ns
=? 192.0.2.051                 0   6     0     -     +0ns[   +0ns] +/-    0ns
=? 192.0.2.059            0   6     0     -     +0ns[   +0ns] +/-    0ns

Remote address  : 192.0.2.026 (ACC03AF1)
Remote port     : 123
Local address   : 192.0.2.029 (0AA800D5)
Leap status     : Normal
Version         : 4
Mode            : Symmetric passive
Stratum         : 2
Poll interval   : 10 (1024 seconds)
Precision       : -25 (0.000000030 seconds)
Root delay      : 0.000381 seconds
Root dispersion : 0.000397 seconds
Reference ID    : ACC03BDF ()
Reference time  : Thu Nov 06 19:36:31 2025
Offset          : -0.000002443 seconds
Peer delay      : 0.000202604 seconds
Peer dispersion : 0.000000053 seconds
Response time   : 0.000097758 seconds
Jitter asymmetry: -0.37
NTP tests       : 111 111 1111
Interleaved     : No
Authenticated   : No
TX timestamping : Daemon
RX timestamping : Kernel
Total TX        : 67
Total RX        : 67
Total valid RX  : 67
Total good RX   : 67