From 456f4a61e014b71bdcfad0cfea8fa96bcdd941d8 Mon Sep 17 00:00:00 2001 From: Alen Komljen Date: Wed, 20 Mar 2019 16:08:59 +0100 Subject: [PATCH] SC-4103 Update custom URL variables and other improvments (#12401) Signed-off-by: Alen Komljen --- stable/sematext-agent/Chart.yaml | 2 +- stable/sematext-agent/README.md | 10 +++++----- stable/sematext-agent/templates/NOTES.txt | 10 +++++----- stable/sematext-agent/templates/clusterrole.yaml | 14 ++++++++++++++ .../sematext-agent/templates/configmap-agent.yaml | 6 +++--- .../templates/configmap-logagent.yaml | 2 +- stable/sematext-agent/templates/daemonset.yaml | 12 +++++++++++- stable/sematext-agent/templates/secret.yaml | 2 +- stable/sematext-agent/values.yaml | 8 ++++---- 9 files changed, 45 insertions(+), 21 deletions(-) diff --git a/stable/sematext-agent/Chart.yaml b/stable/sematext-agent/Chart.yaml index 77eb6711cc..024cd1637c 100644 --- a/stable/sematext-agent/Chart.yaml +++ b/stable/sematext-agent/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 appVersion: "1.0" -version: 1.0.2 +version: 1.0.3 description: Helm chart for deploying Sematext Agent to Kubernetes keywords: - sematext diff --git a/stable/sematext-agent/README.md b/stable/sematext-agent/README.md index 896ab7dd6b..9f9b495f63 100644 --- a/stable/sematext-agent/README.md +++ b/stable/sematext-agent/README.md @@ -17,7 +17,7 @@ To install the chart run the following command: ```bash $ helm install --name release_name \ - --set containerToken=YOUR_CONTAINER_TOKEN,logsToken=YOUR_LOGS_TOKEN stable/sematext-agent + --set containerToken=YOUR_CONTAINER_TOKEN,logseneToken=YOUR_LOGS_TOKEN stable/sematext-agent ``` After a few minutes, you should see logs, metrics, and events reported in Sematext web UI. @@ -41,7 +41,7 @@ The following table lists the configuration parameters of the `sematext-agent` c | Parameter | Description | Default | |-------------------------------|--------------------------------------|-------------------------------------------| | `containerToken` | Sematext Container token | `Nil` Provide your Container token | -| `logsToken` | Sematext Logs token | `Nil` Provide your Logs token | +| `logseneToken` | Sematext Logsene token | `Nil` Provide your Logsene token | | `region` | Sematext region | `US` Sematext US or EU region | | `agent.image.repository` | The image repository | `sematext/agent` | | `agent.image.tag` | The image tag | `latest` | @@ -53,9 +53,9 @@ The following table lists the configuration parameters of the `sematext-agent` c | `logagent.image.tag` | The image tag | `latest` | | `logagent.image.pullPolicy` | Image pull policy | `Always` | | `logagent.resources` | Logagent resources | `{}` | -| `customUrl.metricsServer` | Custom endpoint for Metrics receiver | `Nil` | -| `customUrl.logsServer` | Custom endpoint for Logs receiver | `Nil` | -| `customUrl.eventServer` | Custom endpoint for Event receiver | `Nil` | +| `customUrl.serverBaseUrl` | Custom Base URL | `Nil` | +| `customUrl.logsReceiverUrl` | Custom Logsene receiver URL | `Nil` | +| `customUrl.eventsRecieverUrl` | Custom Event receiver URL | `Nil` | | `serviceAccount.create` | Create a service account | `true` | | `serviceAccount.name` | Service account name | `Nil` Defaults to chart name | | `rbac.create` | RBAC enabled | `true` | diff --git a/stable/sematext-agent/templates/NOTES.txt b/stable/sematext-agent/templates/NOTES.txt index 3b78525697..1af8b9cc87 100644 --- a/stable/sematext-agent/templates/NOTES.txt +++ b/stable/sematext-agent/templates/NOTES.txt @@ -1,7 +1,7 @@ -{{- if and (not .Values.containerToken) (not .Values.logsToken) -}} +{{- if and (not .Values.containerToken) (not .Values.logseneToken) -}} ############################################################################### -# ERROR: Please provide containerToken and/or logsToken! # +# ERROR: Please provide containerToken and/or logseneToken! # ############################################################################### Depending on which region you want to use, create a container and/or logs apps @@ -14,14 +14,14 @@ helm install --name release_name \ Or if you created both apps use: helm install --name release_name \ - --set containerToken=YOUR_CONTAINER_TOKEN,logsToken=YOUR_LOGS_TOKEN \ + --set containerToken=YOUR_CONTAINER_TOKEN,logseneToken=YOUR_LOGS_TOKEN \ stable/sematext-agent Please check the README file for all available parameters. -{{- else if not .Values.logsToken -}} +{{- else if not .Values.logseneToken -}} -Missing logsToken! You will only receive metrics and events. +Missing logseneToken! You will only receive metrics and events. {{ if eq .Values.region "US" }} After a few minutes check your app at https://apps.sematext.com/ui/monitoring {{ else if eq .Values.region "EU" }} diff --git a/stable/sematext-agent/templates/clusterrole.yaml b/stable/sematext-agent/templates/clusterrole.yaml index f6ea84acc3..dfb56df56b 100644 --- a/stable/sematext-agent/templates/clusterrole.yaml +++ b/stable/sematext-agent/templates/clusterrole.yaml @@ -21,6 +21,12 @@ rules: - list - get - watch +- apiGroups: + - "" + resources: + - nodes/metrics + verbs: + - get - apiGroups: - "" resources: @@ -37,4 +43,12 @@ rules: verbs: - watch - list +- apiGroups: + - extensions + resources: + - replicasets + verbs: + - get + - watch + - list {{- end }} diff --git a/stable/sematext-agent/templates/configmap-agent.yaml b/stable/sematext-agent/templates/configmap-agent.yaml index f78aa082e9..f2a1623288 100644 --- a/stable/sematext-agent/templates/configmap-agent.yaml +++ b/stable/sematext-agent/templates/configmap-agent.yaml @@ -13,9 +13,9 @@ data: {{ $key }}: {{ $val | quote }} {{- end }} {{- if .Values.customUrl }} - SERVER_BASE_URL: {{ default "" .Values.customUrl.metricsServer | quote }} - EVENTS_RECEIVER_URL: {{ default "" .Values.customUrl.eventServer | quote }} - LOGS_RECEIVER_URL: {{ default "" .Values.customUrl.logsServer | quote }} + SERVER_BASE_URL: {{ default "" .Values.customUrl.serverBaseUrl | quote }} + EVENTS_RECEIVER_URL: {{ default "" .Values.customUrl.eventsRecieverUrl | quote }} + LOGS_RECEIVER_URL: {{ default "" .Values.customUrl.logsReceiverUrl | quote }} {{- else if eq .Values.region "EU" }} SERVER_BASE_URL: "https://spm-receiver.eu.sematext.com" EVENTS_RECEIVER_URL: "https://event-receiver.eu.sematext.com" diff --git a/stable/sematext-agent/templates/configmap-logagent.yaml b/stable/sematext-agent/templates/configmap-logagent.yaml index 9e42689d92..b8060e3d72 100644 --- a/stable/sematext-agent/templates/configmap-logagent.yaml +++ b/stable/sematext-agent/templates/configmap-logagent.yaml @@ -13,5 +13,5 @@ data: {{ $key }}: {{ $val | quote }} {{- end }} {{- if .Values.customUrl }} - LOGS_RECEIVER_URL: {{ default "" .Values.customUrl.logsServer | quote }} + LOGS_RECEIVER_URL: {{ default "" .Values.customUrl.logsReceiverUrl | quote }} {{- end }} diff --git a/stable/sematext-agent/templates/daemonset.yaml b/stable/sematext-agent/templates/daemonset.yaml index e592bf551f..f85dd6dd37 100644 --- a/stable/sematext-agent/templates/daemonset.yaml +++ b/stable/sematext-agent/templates/daemonset.yaml @@ -1,4 +1,4 @@ -{{- if or (.Values.infraToken) (.Values.logsToken) (.Values.containerToken) }} +{{- if or (.Values.infraToken) (.Values.logseneToken) (.Values.containerToken) }} {{- if .Capabilities.APIVersions.Has "apps/v1" }} apiVersion: apps/v1 {{- else }} @@ -53,6 +53,10 @@ spec: valueFrom: fieldRef: fieldPath: spec.nodeName + - name: STA_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace envFrom: - configMapRef: name: {{ template "sematext-agent.fullname" . }}-agent @@ -80,6 +84,9 @@ spec: mountPath: /var/run/docker.sock - name: journal mountPath: /opt/spm/st-agent + - name: lib + mountPath: /host/usr/lib + readOnly: true - name: autodisco-template mountPath: /etc/agent securityContext: @@ -126,6 +133,9 @@ spec: - name: journal hostPath: path: /opt/spm/st-agent + - name: lib + hostPath: + path: /host/usr/lib - name: autodisco-template configMap: name: {{ template "sematext-agent.fullname" . }}-agent-autodisco diff --git a/stable/sematext-agent/templates/secret.yaml b/stable/sematext-agent/templates/secret.yaml index e167187bcc..2a20bda7fd 100644 --- a/stable/sematext-agent/templates/secret.yaml +++ b/stable/sematext-agent/templates/secret.yaml @@ -10,4 +10,4 @@ type: Opaque data: infra-token: {{ default "" .Values.infraToken | b64enc | quote }} container-token: {{ default "" .Values.containerToken | b64enc | quote }} - logs-token: {{ default "" .Values.logsToken | b64enc | quote }} + logs-token: {{ default "" .Values.logseneToken | b64enc | quote }} diff --git a/stable/sematext-agent/values.yaml b/stable/sematext-agent/values.yaml index fc4f327257..5e547ff24a 100644 --- a/stable/sematext-agent/values.yaml +++ b/stable/sematext-agent/values.yaml @@ -43,7 +43,7 @@ infraToken: null # determines the token for the container app (container metrics are delivered here) containerToken: null # logsene token to send logs -logsToken: null +logseneToken: null # for private images # imagePullSecrets: @@ -52,9 +52,9 @@ region: US # support for custom URLs customUrl: {} - # metricsServer: https://metrics-receiver.apps.test.sematext.com - # eventServer: https://event-receiver.apps.test.sematext.com - # logsServer: https://logs-token-receiver.apps.test.sematext.com + # serverBaseUrl: https://metrics-receiver.apps.test.sematext.com + # eventsRecieverUrl: https://event-receiver.apps.test.sematext.com + # logsReceiverUrl: https://logs-token-receiver.apps.test.sematext.com tolerations: []