Create Configuration
cat <<EOF | kubectl apply -f - apiVersion: v1 kind: ConfigMap metadata: name: costgraph-agent-config namespace: costgraph data: conf.yaml: | api_key: "your costgraph api key" prometheus: enabled: true url: "prometheus.example.com" write_path: "/api/v1/write" timeout: 10s interval: 60s tlsInsecure: false labels: env: "daemonset" expected_utilisation: cpu: 60 memory: 75 EOF
Deploy DaemonSet
cat <<EOF | kubectl apply -f - apiVersion: apps/v1 kind: DaemonSet metadata: name: costgraph-agent namespace: costgraph spec: selector: matchLabels: app: costgraph-agent template: metadata: labels: app: costgraph-agent spec: hostPID: true hostNetwork: true containers: - name: agent image: ghcr.io/baselinehq/costgraph-agent:v0.0.7 command: ["costgraph-agent", "-conf", "/etc/costgraph-agent/conf.yaml"] imagePullPolicy: Always env: - name: DEBUG value: "true" volumeMounts: - name: state mountPath: /var/lib/costgraph-agent - name: proc mountPath: /host/proc readOnly: true - name: config mountPath: /etc/costgraph-agent/conf.yaml subPath: conf.yaml readOnly: true volumes: - name: state emptyDir: {} - name: proc hostPath: path: /proc - name: config configMap: name: costgraph-agent-config EOF
Verify Installation
kubectl get pods -n costgraph kubectl logs -n costgraph -l app=costgraph-agent