Question

Get metrics from Kubernetes nodes

I would like to get advanced metrics from my Kubernetes worker node.

When I view the worker nodes in the Droplets screen, I get the usual instruction to shell into the Droplet and install the DO Agent, but I cannot shell into the worker.

Step 3 of the Kubernetes Quick Start guide says to choose a data center and an SSH key, but I do not have an SSH key option when I create a cluster so I appear to be unable to shell in to my worker node and install the DO Agent.

Is it possible to install the DO Agent on worker nodes?

Thanks!


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Accepted Answer

I’m use my own wrapper for it

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: do-agent
  namespace: monitoring
spec:
  selector:
    matchLabels:
      name: do-agent
      phase: prod
  template:
    metadata:
      labels:
        name: do-agent
        phase: prod
#      annotations:
#        prometheus.io/port: "10253"
#        prometheus.io/path: "/metrics"
#        prometheus.io/scrape: "true"
    spec:
      volumes:
      - name: proc
        hostPath:
          path: /proc
      containers:
      - name: do-agent
        image: trurlmcbyte/do-agent:0.5.1
#        command: ["/agent/do-agent_linux_amd64", "-log_level", "DEBUG"]
        ports:
        - containerPort: 10253
          hostPort: 10253
          protocol: TCP
          name: metrics
        volumeMounts:
        - name: proc
          readOnly: true
          mountPath: /agent/proc
        imagePullPolicy: IfNotPresent
        securityContext:
          privileged: true
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      hostNetwork: true
      hostPID: true
      schedulerName: default-scheduler
      tolerations:
      - operator: Exists
        effect: NoSchedule
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
  templateGeneration: 1
  revisionHistoryLimit: 10

wrapper itself is simple:

FROM golang:1.9-alpine

ENV CGO=0
ENV GOOS=linux

ARG CURRENT_BRANCH
ARG CURRENT_HASH
ARG LAST_RELEASE

RUN  apk update && \
     apk add bash && \
     apk add curl && \
     apk add git && \
     apk add make && \
     apk add libc6-compat

COPY ./do-agent /go/src/github.com/digitalocean/do-agent

RUN cd /go/src/github.com/digitalocean/do-agent && \
    set -x && \
    make build RELEASE=${LAST_RELEASE} CURRENT_BRANCH=${CURRENT_BRANCH} CURRENT_HASH=${CURRENT_HASH}

# Copy what is needed to
FROM alpine
ENV DO_AGENT_REPO_PATH   /agent/updates
ENV DO_AGENT_PROCFS_ROOT /agent/proc

RUN mkdir -p /agent
RUN mkdir -p /agent/updates
RUN mkdir -p /agent/proc

RUN  apk update && \
     apk add libc6-compat && \
     apk add ca-certificates

COPY --from=0 /go/src/github.com/digitalocean/do-agent/build/do-agent_linux_amd64 /agent
RUN find /agent

CMD /agent/do-agent_linux_amd64

I have the same problem, I just can connect to the kubernetes cluster itself

This comment has been deleted

    Try DigitalOcean for free

    Click below to sign up and get $200 of credit to try our products over 60 days!

    Sign up

    Become a contributor for community

    Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

    DigitalOcean Documentation

    Full documentation for every DigitalOcean product.

    Resources for startups and SMBs

    The Wave has everything you need to know about building a business, from raising funding to marketing your product.

    Get our newsletter

    Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

    New accounts only. By submitting your email you agree to our Privacy Policy

    The developer cloud

    Scale up as you grow — whether you're running one virtual machine or ten thousand.

    Get started for free

    Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

    *This promotional offer applies to new accounts only.