Set up URL uptime check
Duration: 10 min | Persona: Platform Admin
In this section, you will set up an uptime check on the Bank of Anthos website URL.
Initialize variables:
WORK_DIR=~/
source ${WORK_DIR}acm-workshop-variables.sh
mkdir ${WORK_DIR}$TENANT_PROJECT_DIR_NAME/$BANKOFANTHOS_NAMESPACE
Define Uptime check config
Define the MonitoringUptimeCheckConfig:
cat <<EOF > ${WORK_DIR}$TENANT_PROJECT_DIR_NAME/$BANKOFANTHOS_NAMESPACE/uptime-check-config.yaml
apiVersion: monitoring.cnrm.cloud.google.com/v1beta1
kind: MonitoringUptimeCheckConfig
metadata:
name: uptimecheckconfig-${BANKOFANTHOS_NAMESPACE}
spec:
projectRef:
name: ${TENANT_PROJECT_ID}
displayName: ${BANKOFANTHOS_NAMESPACE}
period: 900s
timeout: 5s
monitoredResource:
type: "uptime_url"
filterLabels:
host: ${BANK_OF_ANTHOS_INGRESS_GATEWAY_HOST_NAME}
project_id: ${TENANT_PROJECT_ID}
httpCheck:
port: 443
requestMethod: GET
useSsl: true
validateSsl: true
EOF
Deploy Kubernetes manifests
cd ${WORK_DIR}$TENANT_PROJECT_DIR_NAME/
git add . && git commit -m "URL uptime check for Bank of Anthos" && git push origin main
Check 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_ID
Wait 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