|
| 1 | +# TimeSync "two-ways" (GCE+OpsAgent/GKE) example |
| 2 | + |
| 3 | +This folder contains a real-world example of configuring TimeSync. It is intended to demonstrate how a GCE configuration flow with ops-agent based monitoring will be converted into a GKE DaemonSet with log collection monitoring. |
| 4 | + |
| 5 | +To demonstrate this, the folder contains both the GCE configuration and the GKE configuration. |
| 6 | + |
| 7 | +## GCE configuration |
| 8 | + |
| 9 | +These configuration scripts are kept in the folder [`gce`](gce) . The configuration flow here is expected to be: |
| 10 | + |
| 11 | +```bash |
| 12 | +# configure the project for log collection via ops agent and parsing/display. |
| 13 | +./time-sync-logging-dashboard.sh timesync-test-project |
| 14 | + |
| 15 | +# create a test VM in the project with clock-sync configured and ops-agent monitoring enabled |
| 16 | +./time-sync-vm-creation.sh test-vm-1 timesync-test-project ubuntu-2204-lts ubuntu-os-cloud |
| 17 | + |
| 18 | +# The last few lines of the output from the command above should look like: |
| 19 | +# MS Name/IP address Stratum Poll Reach LastRx Last sample |
| 20 | +# =============================================================================== |
| 21 | +# #* PHC0 0 -1 377 1 -1ns[ -1ns] +/- 33ns |
| 22 | + |
| 23 | + |
| 24 | +# Create another test VM in the same project |
| 25 | +./time-sync-vm-creation.sh test-vm-2 timesync-test-project rhel-9 rhel-cloud |
| 26 | + |
| 27 | +``` |
| 28 | + |
| 29 | +The [`time-sync-logging-dashboard.sh`](gce/time-sync-logging-dashboard.sh) script |
| 30 | +configures the project to support OpsAgent based log/telemetry collection for |
| 31 | +Chrony. It grants the VMs service account the needed permissions to report |
| 32 | +metrics to cloud-logging, and defines log based metric to track the clock |
| 33 | +synchronization accuracy per VM. Finally, it is creating a dashboard that |
| 34 | +indicates a tracability metric for each VM. |
| 35 | + |
| 36 | + |
| 37 | +The [`time-sync-vm-creation.sh`](gce/time-sync-vm-creation.sh) script is creating a |
| 38 | +VM with a startup script that is composed of 2 other scripts: |
| 39 | + |
| 40 | +* [`time-sync-configure-clock-sync.sh`](gce/time-sync-configure-clock-sync.sh) - |
| 41 | + script for enabling PTP-KVM and configuring chrony to leverage it |
| 42 | +* [`time-sync-configure-ops-agent-monitor.sh`](gce/time-sync-configure-ops-agent-monitor.sh) - |
| 43 | + script for installing OpsAgent and configuring it to monitor Chrony's tracking |
| 44 | + accuracy |
0 commit comments