diff --git a/packages/system/talos-log-collector/Makefile b/packages/system/talos-log-collector/Makefile index 5aa8a78d1..8aad5bfee 100644 --- a/packages/system/talos-log-collector/Makefile +++ b/packages/system/talos-log-collector/Makefile @@ -18,10 +18,8 @@ image: $(call cache-args,vector) \ --metadata-file images/vector.json \ $(BUILDX_ARGS) - REPOSITORY="$(REGISTRY)/vector" \ - yq -i '.image.repository = strenv(REPOSITORY)' values.yaml - TAG=$(IMAGE_TAG)@$$(yq e '."containerimage.digest"' images/vector.json -o json -r) \ - yq -i '.image.tag = strenv(TAG)' values.yaml + echo "$(REGISTRY)/vector:$(IMAGE_TAG)@$$(yq e '."containerimage.digest"' images/vector.json -o json -r)" \ + > images/vector.tag rm -f images/vector.json generate: diff --git a/packages/system/talos-log-collector/README.md b/packages/system/talos-log-collector/README.md index 4a93ff7f7..090d1b82d 100644 --- a/packages/system/talos-log-collector/README.md +++ b/packages/system/talos-log-collector/README.md @@ -78,17 +78,13 @@ url: "tcp://127.0.0.1:5170/" ### Common parameters -| Name | Description | Type | Value | -| ------------------ | ---------------------------------------------------------------------------------------- | ---------- | --------------------------------------------------------------------------------------- | -| `logLevel` | Vector log verbosity (trace, debug, info, warn, error). | `string` | `warn` | -| `listenPort` | TCP port bound on the node loopback (127.0.0.1) where Talos machine.logging pushes logs. | `int` | `5170` | -| `image` | Vector container image. | `object` | `{}` | -| `image.repository` | Image repository. | `string` | `ghcr.io/cozystack/cozystack/vector` | -| `image.tag` | Image tag (digest-pinned by the build). | `string` | `0.56.0-alpine@sha256:0eb66216f5f9322264e2ba83f4606428ef77a2cd4dea619a5bea610ac80ccc43` | -| `image.pullPolicy` | Image pull policy. | `string` | `IfNotPresent` | -| `resources` | Compute resources for the collector. | `object` | `{}` | -| `resources.cpu` | CPU request. | `quantity` | `100m` | -| `resources.memory` | Memory request and limit. | `quantity` | `128Mi` | +| Name | Description | Type | Value | +| ------------------ | ---------------------------------------------------------------------------------------- | ---------- | ------- | +| `logLevel` | Vector log verbosity (trace, debug, info, warn, error). | `string` | `warn` | +| `listenPort` | TCP port bound on the node loopback (127.0.0.1) where Talos machine.logging pushes logs. | `int` | `5170` | +| `resources` | Compute resources for the collector. | `object` | `{}` | +| `resources.cpu` | CPU request. | `quantity` | `100m` | +| `resources.memory` | Memory request and limit. | `quantity` | `128Mi` | ### VictoriaLogs destination diff --git a/packages/system/talos-log-collector/images/vector.tag b/packages/system/talos-log-collector/images/vector.tag new file mode 100644 index 000000000..7b6e15913 --- /dev/null +++ b/packages/system/talos-log-collector/images/vector.tag @@ -0,0 +1 @@ +ghcr.io/cozystack/cozystack/vector:0.56.0-alpine@sha256:0eb66216f5f9322264e2ba83f4606428ef77a2cd4dea619a5bea610ac80ccc43 diff --git a/packages/system/talos-log-collector/templates/daemonset.yaml b/packages/system/talos-log-collector/templates/daemonset.yaml index 59c88c0a5..ad76aa01b 100644 --- a/packages/system/talos-log-collector/templates/daemonset.yaml +++ b/packages/system/talos-log-collector/templates/daemonset.yaml @@ -39,8 +39,8 @@ spec: type: RuntimeDefault containers: - name: vector - image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + image: "{{ $.Files.Get "images/vector.tag" | trim }}" + imagePullPolicy: IfNotPresent args: ["--config", "/etc/vector/vector.yaml"] livenessProbe: tcpSocket: diff --git a/packages/system/talos-log-collector/tests/talos-log-collector_test.yaml b/packages/system/talos-log-collector/tests/talos-log-collector_test.yaml index 7817e2cf6..5f4e2781d 100644 --- a/packages/system/talos-log-collector/tests/talos-log-collector_test.yaml +++ b/packages/system/talos-log-collector/tests/talos-log-collector_test.yaml @@ -2,7 +2,8 @@ suite: talos-log-collector receive/forward wiring # Pins the surface this package owns: # - the DaemonSet pulls the first-party vector image from the cozystack -# registry (repository is the load-bearing ref re-pinned by `make image`); +# registry (the load-bearing ref lives in images/vector.tag, re-pinned by +# `make image`); # - Talos logs are received on the node loopback via hostPort+hostIP (the pod # stays on the pod network for the sink; the loopback socket is published # via portmap), NOT via hostNetwork; diff --git a/packages/system/talos-log-collector/values.schema.json b/packages/system/talos-log-collector/values.schema.json index cbb9cd826..24c18b525 100644 --- a/packages/system/talos-log-collector/values.schema.json +++ b/packages/system/talos-log-collector/values.schema.json @@ -21,28 +21,6 @@ "maximum": 65535, "minimum": 1 }, - "image": { - "description": "Vector container image.", - "type": "object", - "default": {}, - "properties": { - "pullPolicy": { - "description": "Image pull policy.", - "type": "string", - "default": "IfNotPresent" - }, - "repository": { - "description": "Image repository.", - "type": "string", - "default": "ghcr.io/cozystack/cozystack/vector" - }, - "tag": { - "description": "Image tag (digest-pinned by the build).", - "type": "string", - "default": "0.56.0-alpine@sha256:0eb66216f5f9322264e2ba83f4606428ef77a2cd4dea619a5bea610ac80ccc43" - } - } - }, "resources": { "description": "Compute resources for the collector.", "type": "object", diff --git a/packages/system/talos-log-collector/values.yaml b/packages/system/talos-log-collector/values.yaml index e313b3988..3b45fb91b 100644 --- a/packages/system/talos-log-collector/values.yaml +++ b/packages/system/talos-log-collector/values.yaml @@ -17,17 +17,6 @@ logLevel: warn ## @maximum 65535 listenPort: 5170 -## @typedef {struct} Image - Vector container image. -## @field {string} [repository] - Image repository. -## @field {string} [tag] - Image tag (digest-pinned by the build). -## @field {string} [pullPolicy] - Image pull policy. - -## @param {Image} [image] - Vector container image. -image: - repository: ghcr.io/cozystack/cozystack/vector - tag: 0.56.0-alpine@sha256:0eb66216f5f9322264e2ba83f4606428ef77a2cd4dea619a5bea610ac80ccc43 - pullPolicy: IfNotPresent - ## @typedef {struct} Resources - Compute resources for the collector. ## @field {quantity} [cpu] - CPU request. ## @field {quantity} [memory] - Memory request and limit.