Set up Config Sync Monitoring

Platform Admin Duration: 5 min | Persona: Platform Admin

In this section, you will finalize the setup for the Config Sync’s monitoring.

Define variables:

source ${WORK_DIR}

Define Config Sync Monitoring

cat <<EOF > ${WORK_DIR}$GKE_CONFIGS_DIR_NAME/config-sync-monitoring-sa.yaml
apiVersion: v1
kind: ServiceAccount
  name: default
  namespace: config-management-monitoring
  annotations: $GKE_SA@$

Deploy Kubernetes manifests

git add . && git commit -m "Config Sync monitoring" && git push origin main

Check deployments

List the Kubernetes resources managed by Config Sync in GKE cluster for the GKE cluster configs repository:

gcloud alpha anthos config sync repo describe \
    --project $TENANT_PROJECT_ID \
    --managed-resources all \
    --sync-name root-sync \
    --sync-namespace config-management-system

Wait and re-run this command above until you see "status": "SYNCED" for this RepoSync. All the managed_resources listed should have STATUS: Current as well.

List the GitHub runs for the GKE cluster configs repository:

cd ${WORK_DIR}$GKE_CONFIGS_DIR_NAME && gh run list

Create a sample Config Sync dashboard

Create a Config Sync dashboard based on a predefined template:

curl -o ${WORK_DIR}ConfigSync-Dashboard.json
gcloud monitoring dashboards create \
    --config-from-file=${WORK_DIR}ConfigSync-Dashboard.json \
    --project ${TENANT_PROJECT_ID}

Navigate to the list of your Cloud Monitoring dashboards. Click on the link displayed by the command below:

echo -e "${TENANT_PROJECT_ID}"

Open the Config Sync dashboard just created.

You won’t have yet any data as we haven’t yet synchronized any resources yet in the GKE cluster. You could come back to this dashboard as we are moving forward with this workshop.