Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkpointing prototype #1815

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions collector/lib/CollectorService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ extern "C" {
#include "Utility.h"
#include "prometheus/exposer.h"
#include "system-inspector/Service.h"
#include "curl/curl.h"

extern unsigned char g_bpf_drop_syscalls[]; // defined in libscap

Expand Down Expand Up @@ -65,6 +66,9 @@ void CollectorService::RunForever() {
std::unique_ptr<NetworkStatusInspector> network_status_inspector;

CLOG(INFO) << "Network scrape interval set to " << config_.ScrapeInterval() << " seconds";

CLOG(INFO) << "HALLO DMITRII";
CollectorService::QueryKubelet();

if (config_.grpc_channel) {
CLOG(INFO) << "Waiting for Sensor to become ready ...";
Expand Down Expand Up @@ -138,6 +142,20 @@ void CollectorService::RunForever() {
system_inspector_.CleanUp();
}

void CollectorService::QueryKubelet() {
CLOG(INFO) << "Query Kubelet Example";
CURL *curl = curl_easy_init();
if(curl) {
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if (res) {
CLOG(INFO) << printf("response: %d\n", res);
}
}
}

bool CollectorService::InitKernel() {
return system_inspector_.InitKernel(config_);
}
Expand Down
2 changes: 2 additions & 0 deletions collector/lib/CollectorService.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class CollectorService {
const std::atomic<int>& signum_;

system_inspector::Service system_inspector_;

void QueryKubelet();
};

bool SetupKernelDriver(CollectorService& collector, const std::string& GRPCServer, const CollectorConfig& config);
Expand Down
28 changes: 28 additions & 0 deletions pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: "3.9"
services:
collector:
image: quay.io/stackrox-io/collector:3.19.x-61-g18fbe6077a-dirty
container_name: collector-debug
network_mode: host
privileged: true
environment:
- GRPC_SERVER=localhost:9999
- COLLECTOR_CONFIG={"logLevel":"info","turnOffScrape":true,"scrapeInterval":2}
- COLLECTION_METHOD=core-bpf
- COLLECTOR_HOST_ROOT=/host
volumes:
- /var/run/docker.sock:/host/var/run/docker.sock:ro
- /proc:/host/proc:ro
- /etc:/host/etc:ro
- /usr/lib:/host/usr/lib:ro
- /sys/:/host/sys/:ro
- /dev:/host/dev:ro
depends_on:
- grpc-server-debug
grpc-server-debug:
image: quay.io/rhacs-eng/grpc-server:4.3.8
container_name: grpc-server
network_mode: host
user: 1000:1000
volumes:
- /tmp:/tmp:rw
Loading