[GSP484] Tracing with Stackdriver on Kubernetes Engine
Делаю:
04.05.2019
https://www.qwiklabs.com/focuses/5159?parent=catalog
Install Terraform
$ git clone https://github.com/GoogleCloudPlatform/gke-tracing-demo
$ cd gke-tracing-demo
$ gcloud config set compute/region us-central1
$ gcloud config set compute/zone us-central1-a
Running Terraform
$ cd terraform
$ terraform init
$ ../scripts/generate-tfvars.sh
$ gcloud config list
Deployment
$ terraform plan
$ terraform apply
Create Stackdriver workspace
GCP –> Monitoring
Deploy demo application
$ kubectl apply -f tracing-demo-deployment.yaml
// не отработала
$ echo http://$(kubectl get svc tracing-demo -n default -ojsonpath='{.status.loadBalancer.ingress[0].ip}')
http://35.226.121.116
http://35.226.121.116/?string=CustomMessage
Stackdriver –> Trace > Trace list.
Pulling Pub/Sub Messages
$ gcloud pubsub subscriptions pull --auto-ack --limit 10 tracing-demo-cli
┌───────────────┬─────────────────┬────────────┐
│ DATA │ MESSAGE_ID │ ATTRIBUTES │
├───────────────┼─────────────────┼────────────┤
│ CustomMessage │ 570469273059920 │ │
│ CustomMessage │ 570470527732853 │ │
│ Hello World │ 570470803702509 │ │
└───────────────┴─────────────────┴────────────┘
Monitoring and Logging
Stackdriver –> Resources > Metrics Explorer –> GKE Container