How to install the Stackdriver monitoring agent in Google Container virtual machine images?

I followed this instruction https://cloud.google.com/monitoring/agent/install-agent#linux-install

$ curl -O "https://repo.stackdriver.com/stack-install.sh" $ sudo bash stack-install.sh --write-gcm Unidentifiable or unsupported platform. 

The contents of / etc / os-release.

 $ cat /etc/os-release BUILD_ID=8820.0.0 NAME="Container-VM Image" GOOGLE_CRASH_ID=Lakitu VERSION_ID=55 BUG_REPORT_URL=https://crbug.com/new PRETTY_NAME="Google Container-VM Image" VERSION=55 GOOGLE_METRICS_PRODUCT_ID=26 HOME_URL="https://cloud.google.com/compute/docs/containers/vm-image/" ID=gci 

https://cloud.google.com/compute/docs/containers/vm-image/faq#what_is_the_software_package_manager_for_container-vm_image

To upgrade a specific package, you must upgrade the entire OS image.

So, it seems that we should wait for the update for the installed instance of the image for the stacker or abandon it.

Also this vm image is not my choice. Newly created GKE nodes use container-VM images by default. So while I try to create nodes using gcloud container node-pools create --image-type

+5
source share
2 answers

As far as I know (and what Google has confirmed to me), the new Chromium OS image does not currently support the Stackdriver agent. As a workaround, I upgraded the node pool back to 'container-vm (which has a Debian image) using the following command:

 $ gcloud container clusters upgrade YOUR_CLUSTER_NAME --image-type=container_vm --node-pool=YOUR_NODE_POOL 

Replace the cluster name and set the node pool name to the one that was upgraded to gci earlier (in my case, the "default pool"). Node versions will be updated to the latest. However, you can add an option to deploy a different version.

Now you can install the Stackdriver agent in the same way you are used to and configure the necessary custom metrics.

+5
source

The way I was able to get around the problem with agent incompatibility with the new Chromium image was to deploy the agent as a container operating in privileged mode (conveniently already built: https://github.com/wikiwi/stackdriver-agent ) within kubernetes DaemonSet, therefore it runs on every host. Here is YAML for which I ended up:

 apiVersion: extensions/v1beta1 kind: DaemonSet metadata: name: stackdriver-agent spec: template: metadata: labels: app: stackdriver-agent spec: containers: - name: stackdriver-agent image: wikiwi/stackdriver-agent securityContext: privileged: true volumeMounts: - mountPath: /mnt/proc name: procmnt env: - name: MONITOR_HOST value: "true" volumes: - name: procmnt hostPath: path: /proc 
+2
source

Source: https://habr.com/ru/post/1257711/


All Articles