Skip to content

Commit

Permalink
use environment variables for claiming (#212)
Browse files Browse the repository at this point in the history
* child: use env vars for claiming

* parent: use env vars for claiming

* bump chart version

* bump chart version
  • Loading branch information
ilyam8 authored Jul 30, 2021
1 parent db22887 commit ee017b6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 24 deletions.
2 changes: 1 addition & 1 deletion charts/netdata/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: netdata
version: 3.6.12
version: 3.6.13
description: Real-time performance monitoring, done right!
type: application
keywords:
Expand Down
2 changes: 1 addition & 1 deletion charts/netdata/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Netdata Helm chart for Kubernetes deployments

[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/netdata)](https://artifacthub.io/packages/search?repo=netdata) ![Version: 3.6.12](https://img.shields.io/badge/Version-3.6.12-informational) ![AppVersion: v1.31.0](https://img.shields.io/badge/AppVersion-v1.31.0-informational)
[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/netdata)](https://artifacthub.io/packages/search?repo=netdata) ![Version: 3.6.13](https://img.shields.io/badge/Version-3.6.13-informational) ![AppVersion: v1.31.0](https://img.shields.io/badge/AppVersion-v1.31.0-informational)

_Based on the work of varyumin (https://github.com/varyumin/netdata)_.

Expand Down
19 changes: 8 additions & 11 deletions charts/netdata/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,15 @@ spec:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.child.claiming }}
{{- if and .enabled .token .rooms }}
command:
- "/bin/sh"
- "-c"
- exec /usr/sbin/run.sh
-W set2 cloud global enabled true
-W set2 cloud global "cloud base url" "{{ .url }}"
-W "claim -token={{ .token }} -rooms={{ .rooms }} -url={{ .url }}"
{{- end }}
{{- end }}
env:
{{- if .Values.child.claiming.enabled }}
- name: NETDATA_CLAIM_URL
value: "{{ .Values.child.claiming.url }}"
- name: NETDATA_CLAIM_TOKEN
value: "{{ .Values.child.claiming.token }}"
- name: NETDATA_CLAIM_ROOMS
value: "{{ .Values.child.claiming.rooms }}"
{{- end }}
- name: MY_POD_NAME
valueFrom:
fieldRef:
Expand Down
19 changes: 8 additions & 11 deletions charts/netdata/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,15 @@ spec:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ tpl .Values.image.tag . }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.parent.claiming }}
{{- if and .enabled .token .rooms }}
command:
- "/bin/sh"
- "-c"
- exec /usr/sbin/run.sh
-W set2 cloud global enabled true
-W set2 cloud global "cloud base url" "{{ .url }}"
-W "claim -token={{ .token }} -rooms={{ .rooms }} -url={{ .url }}"
{{- end }}
{{- end }}
env:
{{- if .Values.parent.claiming.enabled }}
- name: NETDATA_CLAIM_URL
value: "{{ .Values.parent.claiming.url }}"
- name: NETDATA_CLAIM_TOKEN
value: "{{ .Values.parent.claiming.token }}"
- name: NETDATA_CLAIM_ROOMS
value: "{{ .Values.parent.claiming.rooms }}"
{{- end }}
- name: MY_POD_NAME
valueFrom:
fieldRef:
Expand Down

0 comments on commit ee017b6

Please sign in to comment.