Skip to content

Commit 953a293

Browse files
committed
feat: Phase 1 completion — VSOCK guest agent, probes, Prometheus metrics, Helm monitors, Kind E2E
2 parents 3118037 + ba540ef commit 953a293

46 files changed

Lines changed: 2592 additions & 436 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
branches: [main]
88

99
env:
10-
GO_VERSION: "1.24"
10+
GO_VERSION: "1.25"
1111

1212
jobs:
1313
lint:
@@ -105,3 +105,24 @@ jobs:
105105
- name: Cleanup
106106
if: always()
107107
run: talosctl cluster destroy --name imp-e2e
108+
109+
e2e-kind:
110+
name: E2E (Kind)
111+
runs-on: ubuntu-latest
112+
needs: [lint, build]
113+
steps:
114+
- uses: actions/checkout@v4
115+
116+
- uses: actions/setup-go@v5
117+
with:
118+
go-version: ${{ env.GO_VERSION }}
119+
120+
- uses: helm/kind-action@v1
121+
with:
122+
cluster_name: imp-e2e
123+
124+
- name: Install Helm
125+
uses: azure/setup-helm@v4
126+
127+
- name: Run E2E tests
128+
run: go test -tags e2e ./test/e2e/... -v -timeout 15m

api/v1alpha1/impvm_types.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ type ImpVMSpec struct {
7272
// Probes override probe settings inherited from ImpVMTemplate or ImpVMClass.
7373
// +optional
7474
Probes *ProbeSpec `json:"probes,omitempty"`
75+
76+
// GuestAgent controls guest agent injection. Overrides defaults when set.
77+
// +optional
78+
GuestAgent *GuestAgentConfig `json:"guestAgent,omitempty"`
7579
}
7680

7781
// UserDataSource references a ConfigMap containing cloud-init user-data.
@@ -97,6 +101,14 @@ type ImpVMStatus struct {
97101
// +optional
98102
RuntimePID int64 `json:"runtimePID,omitempty"`
99103

104+
// ScheduledAt is the time the VM was first assigned to a node.
105+
// +optional
106+
ScheduledAt *metav1.Time `json:"scheduledAt,omitempty"`
107+
108+
// RunningAt is the time the VM first reached Running phase.
109+
// +optional
110+
RunningAt *metav1.Time `json:"runningAt,omitempty"`
111+
100112
// Conditions follow the standard k8s condition convention.
101113
// +optional
102114
// +listType=map

api/v1alpha1/impvmclass_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ type ImpVMClassSpec struct {
2727
// Can be overridden by ImpVMTemplate or ImpVM.
2828
// +optional
2929
Probes *ProbeSpec `json:"probes,omitempty"`
30+
31+
// GuestAgent controls guest agent injection. Overrides defaults when set.
32+
// +optional
33+
GuestAgent *GuestAgentConfig `json:"guestAgent,omitempty"`
3034
}
3135

3236
// +kubebuilder:object:root=true

api/v1alpha1/impvmtemplate_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ type ImpVMTemplateSpec struct {
1818
// Probes overrides probes inherited from the ImpVMClass.
1919
// +optional
2020
Probes *ProbeSpec `json:"probes,omitempty"`
21+
22+
// GuestAgent controls guest agent injection. Overrides defaults when set.
23+
// +optional
24+
GuestAgent *GuestAgentConfig `json:"guestAgent,omitempty"`
2125
}
2226

2327
// +kubebuilder:object:root=true

api/v1alpha1/shared_types.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ const (
8989
ArchMulti Arch = "multi"
9090
)
9191

92+
// GuestAgentConfig controls guest agent injection into the VM rootfs.
93+
// When enabled (default), the node agent injects /.imp/guest-agent at boot,
94+
// enabling probes, env injection, and VM-side metrics.
95+
// Set enabled: false for bare VMs that prioritise fast boot over observability.
96+
type GuestAgentConfig struct {
97+
// Enabled controls guest agent injection. Defaults to true when omitted.
98+
// +optional
99+
Enabled *bool `json:"enabled,omitempty"`
100+
}
101+
92102
// HTTPCheckSpec configures the operator-side HTTP health check (opt-in).
93103
// Enabled per-VM via spec.probes.httpCheck or cluster-wide via ClusterImpConfig.spec.defaultHttpCheck.
94104
type HTTPCheckSpec struct {

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 43 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

buf.gen.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: v2
2+
managed:
3+
enabled: true
4+
override:
5+
- file_option: go_package_prefix
6+
value: github.com/syscode-labs/imp
7+
plugins:
8+
- local: protoc-gen-go
9+
out: internal/proto
10+
opt: paths=source_relative
11+
- local: protoc-gen-go-grpc
12+
out: internal/proto
13+
opt: paths=source_relative

buf.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version: v2
2+
modules:
3+
- path: internal/proto

charts/imp/templates/agent/daemonset.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ spec:
4343
fieldPath: spec.nodeName
4444
- name: FC_KERNEL
4545
value: {{ .Values.agent.env.kernelPath | required "agent.env.kernelPath is required" | quote }}
46+
ports:
47+
- name: metrics
48+
containerPort: 9090
49+
protocol: TCP
4650
resources:
4751
{{- toYaml .Values.agent.resources | nindent 10 }}
4852
securityContext:
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- if .Values.metrics.podMonitor.enabled }}
2+
apiVersion: monitoring.coreos.com/v1
3+
kind: PodMonitor
4+
metadata:
5+
name: {{ include "imp.fullname" . }}-agent
6+
namespace: {{ .Release.Namespace }}
7+
labels:
8+
{{- include "imp.labels" . | nindent 4 }}
9+
app.kubernetes.io/component: agent
10+
spec:
11+
selector:
12+
matchLabels:
13+
{{- include "imp.selectorLabels" . | nindent 6 }}
14+
app.kubernetes.io/component: agent
15+
podMetricsEndpoints:
16+
- port: metrics
17+
interval: {{ .Values.metrics.podMonitor.interval | quote }}
18+
namespaceSelector:
19+
matchNames:
20+
- {{ .Release.Namespace }}
21+
{{- end }}

0 commit comments

Comments
 (0)