Set up URL uptime check
Duration: 10 min | Persona: Platform Admin
In this section, you will set up an uptime check on the Online Boutique website URL.
Initialize variables:
WORK_DIR=~/
source ${WORK_DIR}acm-workshop-variables.shmkdir -p ${WORK_DIR}$TENANT_PROJECT_DIR_NAME/$ONLINEBOUTIQUE_NAMESPACEDefine Uptime check config
Define the MonitoringUptimeCheckConfig:
cat <<EOF > ${WORK_DIR}$TENANT_PROJECT_DIR_NAME/$ONLINEBOUTIQUE_NAMESPACE/uptime-check-config.yaml
apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringUptimeCheckConfig
metadata:
name: uptimecheckconfig-${ONLINEBOUTIQUE_NAMESPACE}
spec:
projectRef:
name: ${TENANT_PROJECT_ID}
displayName: ${ONLINEBOUTIQUE_NAMESPACE}
period: 900s
timeout: 5s
monitoredResource:
type: "uptime_url"
filterLabels:
host: ${ONLINE_BOUTIQUE_INGRESS_GATEWAY_HOST_NAME}
project_id: ${TENANT_PROJECT_ID}
httpCheck:
port: 443
requestMethod: GET
useSsl: true
validateSsl: true
EOFDeploy Kubernetes manifests
cd ${WORK_DIR}$TENANT_PROJECT_DIR_NAME/
git add . && git commit -m "URL uptime check for Online Boutique" && git push origin mainCheck deployments
graph TD; MonitoringUptimeCheckConfig-.->Project
List the Kubernetes resources managed by Config Sync in Config Controller for the Tenant project configs repository:
Run this command and click on this link:
echo -e "https://console.cloud.google.com/kubernetes/config_management/packages?project=${HOST_PROJECT_ID}"Wait until you see the Sync status column as Synced and the Reconcile status column as Current.
Run this command:
gcloud alpha anthos config sync repo describe \
--project $HOST_PROJECT_ID \
--managed-resources all \
--sync-name repo-sync \
--sync-namespace $TENANT_PROJECT_IDWait and re-run this command above until you see "status": "SYNCED". All the managed_resources listed should have STATUS: Current too.
List the GitHub runs for the Tenant project configs repository:
cd ${WORK_DIR}$TENANT_PROJECT_DIR_NAME && gh run list