Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ kubectl apply -f {{ k8s_client_mount_path }}/telemetry/deployments/telemetry_nam
{% if kafka_support %}
helm -n telemetry install strimzi-cluster-operator {{ k8s_client_mount_path }}/telemetry/{{ strimzi_kafka_pkg }}.tar.gz
{% endif %}
{% if 'victoria' in hostvars['localhost']['idrac_telemetry_collection_type'].split(',') %}
helm -n telemetry install victoria-metrics-operator {{ k8s_client_mount_path }}/telemetry/{{ victoria_operator_pkg }}.tar.gz
{% endif %}
kubectl apply -k {{ k8s_client_mount_path }}/telemetry/deployments/.
{% if hostvars['localhost']['ldms_support'] %}
kubectl create secret generic nersc-ldms-ovis-auth --from-file=ldmsauth.conf={{ k8s_client_mount_path }}/telemetry/ldms/ldmsauth.conf --dry-run=client -o yaml | kubectl apply -f - -n telemetry
Expand Down
13 changes: 13 additions & 0 deletions discovery/roles/telemetry/tasks/generate_telemetry_deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,19 @@
dest: "{{ hostvars['localhost']['k8s_client_share_path'] }}/telemetry/{{ strimzi_kafka_pkg }}.tar.gz"
mode: "{{ hostvars['localhost']['file_permissions_644'] }}"

- name: Victoria Metrics operator configuration
when: "'victoria' in hostvars['localhost']['idrac_telemetry_collection_type'].split(',')"
block:
- name: Extract and set facts for tarball URLs for victoria metrics operator
ansible.builtin.set_fact:
victoria_operator_pkg: "{{ k8s_packages_json['service_k8s']['cluster'] | selectattr('type', 'equalto', 'tarball') | selectattr('package', 'search', 'victoria-metrics-operator') | map(attribute='package') | join }}" # noqa: yaml[line-length]

- name: Download victoria metrics operator tarball
ansible.builtin.get_url:
url: "{{ victoria_operator_tarball_url }}"
dest: "{{ hostvars['localhost']['k8s_client_share_path'] }}/telemetry/{{ victoria_operator_pkg }}.tar.gz"
mode: "{{ hostvars['localhost']['file_permissions_644'] }}"

- name: Populate common telemetry deployment configs
ansible.builtin.template:
src: "{{ item.src }}"
Expand Down
6 changes: 4 additions & 2 deletions discovery/roles/telemetry/tasks/telemetry_prereq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,10 @@
no_log: true
when: not cluster_id_present | default(false)

- name: Configure TLS certificate for VictoriaMetrics
when: "'victoria' in hostvars['localhost']['idrac_telemetry_collection_type']"
- name: Configure TLS certificate for VictoriaMetrics (legacy manual deployment only)
when:
- "'victoria' in hostvars['localhost']['idrac_telemetry_collection_type']"
- false # Disabled: operator handles TLS internally. Re-enable only if reverting to manual deployment.
block:
- name: Create VictoriaMetrics certificate directory
ansible.builtin.file:
Expand Down
21 changes: 10 additions & 11 deletions discovery/roles/telemetry/templates/telemetry/kustomization.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@ resources:
- telemetry_secret_creation.yaml
{% set types = hostvars['localhost']['idrac_telemetry_collection_type'].split(',') %}
{% if 'victoria' in types %}
# VictoriaMetrics Common Resources
- victoria-tls-secret.yaml
# VictoriaMetrics Common Resources (RBAC)
- victoria-vmagent-rbac.yaml
- vmagent-scrape-config.yaml
- victoria-agent-deployment.yaml
# VictoriaMetrics Deployment (mode: {{ hostvars['localhost']['victoria_configurations']['deployment_mode'] }})
# VictoriaMetrics Operator-based Deployment (mode: {{ hostvars['localhost']['victoria_configurations']['deployment_mode'] }})
{% if hostvars['localhost']['victoria_configurations']['deployment_mode'] == 'cluster' %}
# Cluster Mode: High-availability deployment
- victoria-cluster-vmstorage.yaml
- victoria-cluster-vminsert.yaml
- victoria-cluster-vmselect.yaml
# Cluster Mode: VMCluster CR (operator manages StatefulSets)
- victoria-operator-vmcluster.yaml
{% else %}
# Single-Node Mode: Simple deployment
- victoria-statefulset.yaml
# Single-Node Mode: VMSingle CR (operator manages StatefulSet)
- victoria-operator-vmsingle.yaml
{% endif %}
# VMAgent CR (operator-managed scraper)
- victoria-operator-vmagent.yaml
# VMPodScrape CR (native operator-based pod discovery)
- victoria-operator-vmpodscrape.yaml
# Uncomment to deploy VictoriaMetrics TLS test job
# - test/victoria-tls-test-job.yaml
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# VMAgent - VictoriaMetrics agent for scraping metrics via operator
# Managed by victoria-metrics-operator

apiVersion: operator.victoriametrics.com/v1beta1
kind: VMAgent
metadata:
name: vmagent
namespace: {{ telemetry_namespace }}
spec:
# Service account for kubernetes service discovery
serviceAccountName: {{ vmagent.service_account_name }}

# Replica count
replicaCount: 1

# Image configuration
image:
repository: {{ vmagent.image.split(':')[0] }}
tag: {{ vmagent.image.split(':')[1] }}
pullPolicy: IfNotPresent

# Remote write configuration - depends on deployment mode
remoteWrite:
{% if victoria_cluster.enabled %}
- url: {{ vmagent.remote_write_url_cluster }}
{% else %}
- url: {{ vmagent.remote_write_url }}
tlsConfig:
insecureSkipVerify: true
{% endif %}

# Resource limits
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "1Gi"
cpu: "1000m"

# Service discovery configs - operator uses VMServiceScrape/VMPodScrape CRDs
serviceScrapeNamespaceSelector: {}
serviceScrapeSelector: {}
podScrapeNamespaceSelector: {}
podScrapeSelector: {}

# Extra args
extraArgs:
promscrape.streamParse: "true"
promscrape.maxScrapeSize: "16MB"
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
# Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# VMCluster - VictoriaMetrics cluster deployment via operator
# Managed by victoria-metrics-operator

apiVersion: operator.victoriametrics.com/v1beta1
kind: VMCluster
metadata:
name: victoria-cluster
namespace: {{ telemetry_namespace }}
spec:
# Retention period from telemetry_config.yml
retentionPeriod: "{{ hostvars['localhost']['victoria_configurations']['retention_period'] }}h"

# VMStorage configuration
vmstorage:
replicaCount: {{ victoria_cluster.vmstorage.replicas }}
image:
repository: {{ victoria_cluster.vmstorage.image.split(':')[0] }}
tag: {{ victoria_cluster.vmstorage.image.split(':')[1] }}
pullPolicy: IfNotPresent

# Storage configuration per pod
storageDataPath: /vmstorage-data
storage:
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: {{ hostvars['localhost']['victoria_configurations']['persistence_size'] }}

# Resource limits
resources:
requests:
memory: {{ victoria_cluster.vmstorage.resources.requests.memory }}
cpu: {{ victoria_cluster.vmstorage.resources.requests.cpu }}
limits:
memory: {{ victoria_cluster.vmstorage.resources.limits.memory }}
cpu: {{ victoria_cluster.vmstorage.resources.limits.cpu }}

# Pod anti-affinity
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- vmstorage
topologyKey: "kubernetes.io/hostname"

# Tolerations
tolerations:
- effect: NoExecute
key: node.kubernetes.io/not-ready
operator: Exists
tolerationSeconds: 5
- effect: NoExecute
key: node.kubernetes.io/unreachable
operator: Exists
tolerationSeconds: 5
{% if victoria_cluster.vmstorage.dedup_min_scrape_interval %}

extraArgs:
dedup.minScrapeInterval: {{ victoria_cluster.vmstorage.dedup_min_scrape_interval }}
{% endif %}

# VMSelect configuration
vmselect:
replicaCount: {{ victoria_cluster.vmselect.replicas }}
image:
repository: {{ victoria_cluster.vmselect.image.split(':')[0] }}
tag: {{ victoria_cluster.vmselect.image.split(':')[1] }}
pullPolicy: IfNotPresent

# Resource limits
resources:
requests:
memory: {{ victoria_cluster.vmselect.resources.requests.memory }}
cpu: {{ victoria_cluster.vmselect.resources.requests.cpu }}
limits:
memory: {{ victoria_cluster.vmselect.resources.limits.memory }}
cpu: {{ victoria_cluster.vmselect.resources.limits.cpu }}

# Pod anti-affinity
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- vmselect
topologyKey: "kubernetes.io/hostname"

# Extra args for query optimization
extraArgs:
{% if victoria_cluster.vmselect.max_query_duration %}
search.maxQueryDuration: {{ victoria_cluster.vmselect.max_query_duration }}
{% endif %}
{% if victoria_cluster.vmselect.max_concurrent_requests %}
search.maxConcurrentRequests: "{{ victoria_cluster.vmselect.max_concurrent_requests }}"
{% endif %}
{% if victoria_cluster.vmselect.cache_data_path %}
cacheDataPath: /cache
{% endif %}

# VMInsert configuration
vminsert:
replicaCount: {{ victoria_cluster.vminsert.replicas }}
image:
repository: {{ victoria_cluster.vminsert.image.split(':')[0] }}
tag: {{ victoria_cluster.vminsert.image.split(':')[1] }}
pullPolicy: IfNotPresent

# Resource limits
resources:
requests:
memory: {{ victoria_cluster.vminsert.resources.requests.memory }}
cpu: {{ victoria_cluster.vminsert.resources.requests.cpu }}
limits:
memory: {{ victoria_cluster.vminsert.resources.limits.memory }}
cpu: {{ victoria_cluster.vminsert.resources.limits.cpu }}

# Pod anti-affinity
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- vminsert
topologyKey: "kubernetes.io/hostname"
{% if victoria_cluster.vminsert.external_access %}

# External access via LoadBalancer
serviceType: LoadBalancer
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# VMPodScrape - Native operator-based pod discovery for idrac-telemetry
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMPodScrape
metadata:
name: idrac-telemetry-scrape
namespace: {{ telemetry_namespace }}
spec:
# Target pod selector
selector:
matchLabels:
app: {{ vmagent.target_pod_label }}

# Namespace selector
namespaceSelector:
matchNames:
- {{ vmagent.kubernetes_sd_namespace }}

# Pod metrics endpoints
podMetricsEndpoints:
- port: "{{ vmagent.metrics_port }}"
interval: {{ vmagent.global.scrape_interval }}
honorLabels: true

# Only scrape the metrics container
relabelConfigs:
- sourceLabels: [__meta_kubernetes_pod_container_name]
regex: {{ vmagent.metrics_container_name }}
action: keep

# Add pod IP label
- sourceLabels: [__meta_kubernetes_pod_ip]
targetLabel: pod_ip
Loading