Skip to content

Commit 435b111

Browse files
Add README section about the GKE scripts
Document the added GKE scripts for TimeSync in README.md. Explain the expected usage and the high level role of each script.
1 parent dac3c57 commit 435b111

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

time-sync-example/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,41 @@ VM with a startup script that is composed of 2 other scripts:
4242
* [`time-sync-configure-ops-agent-monitor.sh`](gce/time-sync-configure-ops-agent-monitor.sh) -
4343
script for installing OpsAgent and configuring it to monitor Chrony's tracking
4444
accuracy
45+
46+
## GKE Configuration
47+
48+
The scripts to configure a GKE cluster with PTP-KVM based clock synchronization are kept in the [`gke`](gke) folder. Expected usage is:
49+
50+
```bash
51+
# configure the project for metric collection and parsing/display (note, this is different from the GCE one)
52+
./create_gke_metric.sh timesync-test-project
53+
54+
# create a GKE cluster in this project with clock-sync configured and GKE based monitoring
55+
./create_gke_cluster.sh timesync-test-project us-west1 test-cluster-1
56+
57+
# create a second GKE cluster in this project with clock-sync configured and GKE based monitoring
58+
./create_gke_cluster.sh timesync-test-project us-west1 test-cluster-2
59+
60+
```
61+
62+
The [`create_gke_metric.sh`](gke/create_gke_metric.sh) script configures the
63+
project to allow log collection from GKE workload, configures a log based metric
64+
to extract the relevant clock accuracy data into a monitoring compatible form
65+
and finally creates a dashboard combining platform and VM metrics into a
66+
tracability metric for each node.
67+
68+
The [`create_gke_cluster.sh`](gke/create_gke_cluster.sh) script creates a GKE
69+
cluster and configures it to leverage TimeSync. The cluster is created with the
70+
nodes "tainted" to ensure the daemonset is applied to each node before workload
71+
can start running on it. Once the cluster is created, the script apply the
72+
following configurations to it:
73+
74+
* [`Service account`](gke/serviceaccount.yaml), [`role`](gke/cluster-role.yaml) and [`bindings`](gke/cluster-role-binding.yaml) to allow the DaemonSet to untaint the node once configured
75+
76+
* [`ConfigMap`](gke/cm-entrypoint.yaml) with the script used by the DaemonSet node initializer to load PTP-KVM, configure chrony and untaint the node once it is configured and synchronized.
77+
78+
* [`DaemonSet`](gke/daemonset.yaml) which configures two init containers for each node - "node-initializers" which executes the script from the ConfigMap, and "logshipper" which ships chrony's tracking log to GKE's workload logging system.
79+
80+
Together, these configurations ensure all nodes in the cluster are enabled for
81+
TimeSync and collect the telemetry from them to Google's cloud logging, where it
82+
is converted to metric and can be monitored and analyzed.

0 commit comments

Comments
 (0)