mirror of
https://github.com/helm/charts.git
synced 2026-08-23 22:37:45 +00:00
Add initial version of Sematext agent chart (#10202)
* Add initial version of Sematext agent chart Signed-off-by: Alen Komljen <alen.komljen@live.com> * Set home to chart metadata Signed-off-by: Alen Komljen <alen.komljen@live.com> * Update maintainer name Signed-off-by: Alen Komljen <alen.komljen@live.com> * Address a few minor issues and improve the readme Signed-off-by: Alen Komljen <alen.komljen@live.com>
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
4df52d5628
commit
4d83b646dc
@@ -0,0 +1,21 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
@@ -0,0 +1,17 @@
|
||||
apiVersion: v1
|
||||
appVersion: "1.0"
|
||||
version: 1.0.1
|
||||
description: Helm chart for deploying Sematext Agent to Kubernetes
|
||||
keywords:
|
||||
- sematext
|
||||
- observability
|
||||
- monitoring
|
||||
- logging
|
||||
- containers
|
||||
- ebpf
|
||||
home: https://sematext.com/cloud
|
||||
icon: https://sematext.com/wp-content/uploads/2017/09/octi-square-logo-200x200-2.png
|
||||
maintainers:
|
||||
- name: komljen
|
||||
email: alen.komljen@sematext.com
|
||||
name: sematext-agent
|
||||
@@ -0,0 +1,4 @@
|
||||
approvers:
|
||||
- komljen
|
||||
reviewers:
|
||||
- komljen
|
||||
@@ -0,0 +1,77 @@
|
||||
# Sematext Agent
|
||||
|
||||
Sematext Agent collects metrics about hosts (CPU, memory, disk, network, processes), containers (both Docker and rkt) and orchestrator platforms and ships that to [Sematext Cloud](https://sematext.com/cloud). Sematext Cloud is available in the US and EU regions.
|
||||
|
||||
## Introduction
|
||||
|
||||
This chart installs the Sematext Agent to all nodes in your cluster via a `DaemonSet` resource.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Kubernetes 1.9+
|
||||
- You need to create [a new Docker app in Sematext Cloud](https://apps.sematext.com/ui/integrations/create/docker) to get relevant tokens
|
||||
|
||||
## Installation
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
After a few minutes, you should see logs, metrics, and events reported in Sematext web UI.
|
||||
|
||||
**NOTE:** If you want to use Sematext in EU region set the region as well `--set region=EU`. Also, it is worth mentioning that the agent is running as a privileged container.
|
||||
|
||||
## Deleting
|
||||
|
||||
To uninstall the chart delete `release_name` deployment:
|
||||
|
||||
```bash
|
||||
$ helm delete --purge release_name
|
||||
```
|
||||
|
||||
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||
|
||||
## Configuration
|
||||
|
||||
The following table lists the configuration parameters of the `sematext-agent` chart and default values.
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|-------------------------------|--------------------------------------|-------------------------------------------|
|
||||
| `containerToken` | Sematext Container token | `Nil` Provide your Container token |
|
||||
| `logsToken` | Sematext Logs token | `Nil` Provide your Logs 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` |
|
||||
| `agent.image.pullPolicy` | Image pull policy | `Always` |
|
||||
| `agent.service.port` | Service port | `80` |
|
||||
| `agent.service.type` | Service type | `ClusterIP` |
|
||||
| `agent.resources` | Agent resources | `{}` |
|
||||
| `logagent.image.repository` | The image repository | `sematext/logagent` |
|
||||
| `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` |
|
||||
| `serviceAccount.create` | Create a service account | `true` |
|
||||
| `serviceAccount.name` | Service account name | `Nil` Defaults to chart name |
|
||||
| `rbac.create` | RBAC enabled | `true` |
|
||||
| `tolerations` | Tolerations | `[]` |
|
||||
| `nodeSelector` | Node selector | `{}` |
|
||||
|
||||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example:
|
||||
|
||||
```bash
|
||||
$ helm install --name release_name \
|
||||
--set containerToken=YOUR_CONTAINER_TOKEN \
|
||||
stable/sematext-agent
|
||||
```
|
||||
|
||||
Alternatively, you can use a YAML file that specifies the values while installing the chart. For example:
|
||||
|
||||
```bash
|
||||
$ helm install --name release_name -f custom_values.yaml stable/sematext-agent
|
||||
```
|
||||
@@ -0,0 +1,212 @@
|
||||
# ========================================================
|
||||
# Definition of autodiscovery patterns
|
||||
# ========================================================
|
||||
|
||||
# The top level element identifies the app type.
|
||||
# The value of this element is used by AA to correctly
|
||||
# setup the corresponding agent. Then we have a number
|
||||
# of attributes that determines whether certain app is
|
||||
# discovered as such. Firstly, the `process` accepts a
|
||||
# regular expression pattern to identify process's image
|
||||
# name that originated the event and is susceptible for
|
||||
# classification.
|
||||
# Then, we have `args` that represents the regular expression
|
||||
# used to match the tokens from process's command line. The
|
||||
# sequence of well-known ports is also used as an advice to
|
||||
# autodisco machinery that specific service could expose these
|
||||
# ports. The Infra agent also sends requests to these ports
|
||||
# in order to get additional meta info.
|
||||
|
||||
|
||||
# Finally, `labels` attribute provides custom key-value pairs
|
||||
# that are attached as container labels/env vars. The naming
|
||||
# of some of them might be specific to AA framework and thus
|
||||
# are used by itself.
|
||||
|
||||
# You can use any valid go template (https://golang.org/pkg/text/template/)
|
||||
# construct inside yaml file. You can access command line args
|
||||
# or discovered ports like this:
|
||||
#
|
||||
# labels:
|
||||
# cmdline: "{{ .Args}}"
|
||||
#
|
||||
# For instance to get the container id or container name you
|
||||
# would use the following go template action. Please note that built-in `isset`
|
||||
# function is used to ensure container details are present since some
|
||||
# apps can be discovered in the VM or baremetal host and thus lack container
|
||||
# meta.
|
||||
#
|
||||
# labels:
|
||||
# container.name: '{{if isset .ContainerInfo "Name"}}{{ .ContainerInfo.Name }}{{end}}'
|
||||
# container.id: '{{if isset .ContainerInfo "ID"}}{{ .ContainerInfo.ID }}{{end}}'
|
||||
|
||||
# You can also query app meta info through `Meta` field. For example, to get
|
||||
# the version of nginx server use '{{if isset .Meta "Version"}}{{ .Meta.Version }}{{end}}'
|
||||
# in `labels` section.
|
||||
|
||||
# To pull secrets that are attached to containers use '{{index .Secrets "SECRET_NAME"}}'
|
||||
|
||||
cassandra:
|
||||
process: java
|
||||
args: .*org.apache.cassandra.service.CassandraDaemon.*
|
||||
ports:
|
||||
- 7199
|
||||
- 7000
|
||||
- 7001
|
||||
- 9160
|
||||
- 9042
|
||||
|
||||
clickhouse:
|
||||
process: clickhouse-.*
|
||||
args: clickhouse-server --config=.*
|
||||
ports:
|
||||
- 8123
|
||||
- 9000
|
||||
- 9009
|
||||
labels:
|
||||
SPM_MONITOR_CLICKHOUSE_DB_HOST_PORT: "{{ .IP }}:8123"
|
||||
SPM_MONITOR_CLICKHOUSE_DB_USER:
|
||||
SPM_MONITOR_CLICKHOUSE_DB_PASSWORD:
|
||||
|
||||
es:
|
||||
process: java
|
||||
args: .*org.elasticsearch.bootstrap.Elasticsearch.*
|
||||
ports:
|
||||
- 9200
|
||||
- 9300
|
||||
- 9201
|
||||
- 9202
|
||||
- 9301
|
||||
- 9302
|
||||
|
||||
haproxy:
|
||||
process: haproxy
|
||||
args: .*haproxy.*haproxy.cfg.*-p
|
||||
|
||||
httpd:
|
||||
process: httpd
|
||||
args: httpd-*D*
|
||||
ports:
|
||||
- 80
|
||||
- 443
|
||||
- 8080
|
||||
- 8443
|
||||
|
||||
kafka:
|
||||
process: java
|
||||
args: kafka.Kafka .*server\.properties
|
||||
ports:
|
||||
- 9092
|
||||
|
||||
mongodb:
|
||||
process: mongod|listener|conn\d+
|
||||
args: mongod.*|listener|conn\d+
|
||||
ports:
|
||||
- 27017
|
||||
|
||||
mysql:
|
||||
process: mysqld
|
||||
args: mysqld.*
|
||||
ports:
|
||||
- 3306
|
||||
|
||||
nginx:
|
||||
process: nginx
|
||||
args: "nginx: master process.*|nginx: worker process.*|nginx -g daemon off.*"
|
||||
ports:
|
||||
- 80
|
||||
- 443
|
||||
- 8080
|
||||
- 8443
|
||||
labels:
|
||||
container.name: '{{if isset .ContainerInfo "Name"}}{{ .ContainerInfo.Name }}{{end}}'
|
||||
container.id: '{{if isset .ContainerInfo "ID"}}{{ .ContainerInfo.ID }}{{end}}'
|
||||
version: '{{if isset .Meta "Version"}}{{ .Meta.Version }}{{end}}'
|
||||
|
||||
redis:
|
||||
process: redis-server
|
||||
args: redis-server .*
|
||||
ports:
|
||||
- 6379
|
||||
|
||||
solr:
|
||||
process: java
|
||||
args: .*-Dsolr.solr.home.*|.*-Dsolr.install.dir.*
|
||||
ports:
|
||||
- 8983
|
||||
- 7983
|
||||
|
||||
spark-master:
|
||||
process: java
|
||||
args: .*org.apache.spark.deploy.master.Master.*
|
||||
ports:
|
||||
- 7707
|
||||
- 4040
|
||||
|
||||
spark-worker:
|
||||
process: java
|
||||
args: .*org.apache.spark.deploy.worker.Worker.*
|
||||
ports:
|
||||
- 7707
|
||||
- 4040
|
||||
|
||||
spark-driver:
|
||||
process: java
|
||||
args: .*org.apache.spark.deploy.SparkSubmit.*--deploy-mode client.*|.*org.apache.spark.deploy.worker.DriverWrapper.*
|
||||
ports:
|
||||
- 7707
|
||||
- 4040
|
||||
|
||||
spark-executor:
|
||||
process: java
|
||||
args: .*org.apache.spark.executor.CoarseGrainedExecutorBackend.*
|
||||
ports:
|
||||
- 7707
|
||||
- 4040
|
||||
|
||||
storm-nimbus:
|
||||
process: java
|
||||
args: .*org.apache.storm.daemon.nimbus.*
|
||||
ports:
|
||||
- 6627
|
||||
- 6700
|
||||
- 6701
|
||||
- 6702
|
||||
- 6703
|
||||
|
||||
storm-supervisor:
|
||||
process: java
|
||||
args: .*org.apache.storm.daemon.supervisor.Supervisor.*
|
||||
ports:
|
||||
- 6627
|
||||
- 6700
|
||||
- 6701
|
||||
- 6702
|
||||
- 6703
|
||||
|
||||
storm-worker:
|
||||
process: java
|
||||
args: .*org.apache.storm.daemon.worker.*
|
||||
ports:
|
||||
- 6627
|
||||
- 6700
|
||||
- 6701
|
||||
- 6702
|
||||
- 6703
|
||||
|
||||
tomcat:
|
||||
process: java
|
||||
args: .*catalina.*org.apache.catalina.startup.Bootstrap.*
|
||||
ports:
|
||||
- 80
|
||||
- 443
|
||||
- 8080
|
||||
- 8443
|
||||
|
||||
zookeeper:
|
||||
process: java
|
||||
args: .*-Dzookeeper.log.dir.*|.*org.apache.zookeeper.server.quorum.QuorumPeerMain.*
|
||||
ports:
|
||||
- 2181
|
||||
- 2888
|
||||
- 3888
|
||||
@@ -0,0 +1,51 @@
|
||||
{{- if and (not .Values.containerToken) (not .Values.logsToken) -}}
|
||||
|
||||
###############################################################################
|
||||
# ERROR: Please provide containerToken and/or logsToken! #
|
||||
###############################################################################
|
||||
|
||||
Depending on which region you want to use, create a container and/or logs apps
|
||||
to get your tokens. Then, start the app with:
|
||||
|
||||
helm install --name release_name \
|
||||
--set sematext.containerToken=YOUR_CONTAINER_TOKEN \
|
||||
stable/sematext-agent
|
||||
|
||||
Or if you created both apps use:
|
||||
|
||||
helm install --name release_name \
|
||||
--set containerToken=YOUR_CONTAINER_TOKEN,logsToken=YOUR_LOGS_TOKEN \
|
||||
stable/sematext-agent
|
||||
|
||||
Please check the README file for all available parameters.
|
||||
|
||||
{{- else if not .Values.logsToken -}}
|
||||
|
||||
Missing logsToken! 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" }}
|
||||
After a few minutes check your app at https://apps.eu.sematext.com/ui/monitoring
|
||||
{{ end }}
|
||||
|
||||
{{- else if not .Values.containerToken -}}
|
||||
|
||||
Missing containerToken! You will only receive logs.
|
||||
{{ if eq .Values.region "US" }}
|
||||
After a few minutes check your app at https://apps.sematext.com/ui/logs
|
||||
{{ else if eq .Values.region "EU" }}
|
||||
After a few minutes check your app at https://apps.eu.sematext.com/ui/logs
|
||||
{{ end }}
|
||||
|
||||
{{- else -}}
|
||||
|
||||
You are all set!
|
||||
{{ if eq .Values.region "US" }}
|
||||
After a few minutes check your metrics app at https://apps.sematext.com/ui/monitoring
|
||||
or logs at https://apps.sematext.com/ui/logs
|
||||
{{ else if eq .Values.region "EU" }}
|
||||
After a few minutes check your metrics app at https://apps.eu.sematext.com/ui/monitoring
|
||||
or logs at https://apps.eu.sematext.com/ui/logs
|
||||
{{ end }}
|
||||
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,43 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "sematext-agent.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "sematext-agent.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "sematext-agent.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "sematext-agent.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "sematext-agent.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,40 @@
|
||||
{{- if .Values.rbac.create }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ template "sematext-agent.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "sematext-agent.name" . }}
|
||||
chart: {{ template "sematext-agent.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- events
|
||||
- pods
|
||||
- configmaps
|
||||
- nodes
|
||||
- secrets
|
||||
verbs:
|
||||
- list
|
||||
- get
|
||||
- watch
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- pods
|
||||
- configmaps
|
||||
verbs:
|
||||
- create
|
||||
- delete
|
||||
- update
|
||||
- apiGroups:
|
||||
- apps
|
||||
resources:
|
||||
- deployments
|
||||
verbs:
|
||||
- watch
|
||||
- list
|
||||
{{- end }}
|
||||
@@ -0,0 +1,19 @@
|
||||
{{- if .Values.rbac.create }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: {{ template "sematext-agent.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "sematext-agent.name" . }}
|
||||
chart: {{ template "sematext-agent.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ template "sematext-agent.fullname" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "sematext-agent.serviceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "sematext-agent.fullname" . }}-agent-autodisco
|
||||
labels:
|
||||
app: {{ template "sematext-agent.name" . }}-agent-autodisco
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
data:
|
||||
autodisco.yml: |-
|
||||
{{- range .Files.Lines "files/autodisco.yml" }}
|
||||
{{ . }}{{ end }}
|
||||
@@ -0,0 +1,27 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "sematext-agent.fullname" . }}-agent
|
||||
labels:
|
||||
app: {{ template "sematext-agent.name" . }}-agent
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
data:
|
||||
API_SERVER_PORT: "{{ .Values.agent.service.port }}"
|
||||
{{- range $key, $val := .Values.agent.config }}
|
||||
{{ $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 }}
|
||||
{{- else if eq .Values.region "EU" }}
|
||||
SERVER_BASE_URL: "https://spm-receiver.eu.sematext.com"
|
||||
EVENTS_RECEIVER_URL: "https://event-receiver.eu.sematext.com"
|
||||
LOGS_RECEIVER_URL: "https://logsene-receiver.eu.sematext.com"
|
||||
{{- else if eq .Values.region "US" }}
|
||||
SERVER_BASE_URL: "https://spm-receiver.sematext.com"
|
||||
EVENTS_RECEIVER_URL: "https://event-receiver.sematext.com"
|
||||
LOGS_RECEIVER_URL: "https://logsene-receiver.sematext.com"
|
||||
{{- end }}
|
||||
@@ -0,0 +1,17 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "sematext-agent.fullname" . }}-logagent
|
||||
labels:
|
||||
app: {{ template "sematext-agent.name" . }}-logagent
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
data:
|
||||
REGION: {{ .Values.region | quote }}
|
||||
{{- range $key, $val := .Values.logagent.config }}
|
||||
{{ $key }}: {{ $val | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.customUrl }}
|
||||
LOGS_RECEIVER_URL: {{ default "" .Values.customUrl.logsServer | quote }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,140 @@
|
||||
{{- if or (.Values.infraToken) (.Values.logsToken) (.Values.containerToken) }}
|
||||
{{- if .Capabilities.APIVersions.Has "apps/v1" }}
|
||||
apiVersion: apps/v1
|
||||
{{- else }}
|
||||
apiVersion: extensions/v1beta1
|
||||
{{- end }}
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: {{ template "sematext-agent.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "sematext-agent.name" . }}
|
||||
chart: {{ template "sematext-agent.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ template "sematext-agent.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ template "sematext-agent.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
annotations:
|
||||
checksum/config-agent: {{ include (print $.Template.BasePath "/configmap-agent.yaml") . | sha256sum }}
|
||||
checksum/config-agent-autodisco: {{ include (print $.Template.BasePath "/configmap-agent-autodisco.yaml") . | sha256sum }}
|
||||
checksum/config-logagent: {{ include (print $.Template.BasePath "/configmap-logagent.yaml") . | sha256sum }}
|
||||
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
||||
spec:
|
||||
serviceAccountName: {{ template "sematext-agent.serviceAccountName" . }}
|
||||
containers:
|
||||
- name: agent
|
||||
image: "{{ .Values.agent.image.repository }}:{{ .Values.agent.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.agent.image.pullPolicy }}
|
||||
env:
|
||||
- name: INFRA_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "sematext-agent.fullname" . }}
|
||||
key: infra-token
|
||||
- name: CONTAINER_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "sematext-agent.fullname" . }}
|
||||
key: container-token
|
||||
- name: LOGS_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "sematext-agent.fullname" . }}
|
||||
key: logs-token
|
||||
- name: NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ template "sematext-agent.fullname" . }}-agent
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: {{ .Values.agent.service.port }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: {{ .Values.agent.service.port }}
|
||||
volumeMounts:
|
||||
- name: procfs
|
||||
mountPath: /host/proc
|
||||
readOnly: true
|
||||
- name: sysfs
|
||||
mountPath: /host/sys
|
||||
readOnly: true
|
||||
- name: etc
|
||||
mountPath: /host/etc
|
||||
readOnly: true
|
||||
- name: debugfs
|
||||
mountPath: /sys/kernel/debug
|
||||
- name: docker-sock
|
||||
mountPath: /var/run/docker.sock
|
||||
- name: journal
|
||||
mountPath: /opt/spm/st-agent
|
||||
- name: autodisco-template
|
||||
mountPath: /etc/agent
|
||||
securityContext:
|
||||
privileged: true
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.agent.service.port }}
|
||||
protocol: TCP
|
||||
resources:
|
||||
{{ toYaml .Values.agent.resources | indent 12 }}
|
||||
- name: logagent
|
||||
image: "{{ .Values.logagent.image.repository }}:{{ .Values.logagent.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.logagent.image.pullPolicy }}
|
||||
env:
|
||||
- name: LOGS_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ template "sematext-agent.fullname" . }}
|
||||
key: logs-token
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: {{ template "sematext-agent.fullname" . }}-logagent
|
||||
volumeMounts:
|
||||
- name: docker-sock
|
||||
mountPath: /var/run/docker.sock
|
||||
resources:
|
||||
{{ toYaml .Values.logagent.resources | indent 12 }}
|
||||
volumes:
|
||||
- name: procfs
|
||||
hostPath:
|
||||
path: /proc
|
||||
- name: sysfs
|
||||
hostPath:
|
||||
path: /sys
|
||||
- name: etc
|
||||
hostPath:
|
||||
path: /etc
|
||||
- name: debugfs
|
||||
hostPath:
|
||||
path: /sys/kernel/debug
|
||||
- name: docker-sock
|
||||
hostPath:
|
||||
path: /var/run/docker.sock
|
||||
- name: journal
|
||||
hostPath:
|
||||
path: /opt/spm/st-agent
|
||||
- name: autodisco-template
|
||||
configMap:
|
||||
name: {{ template "sematext-agent.fullname" . }}-agent-autodisco
|
||||
{{ if .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
- name: {{ .Values.imagePullSecrets }}
|
||||
{{- end }}
|
||||
nodeSelector:
|
||||
{{ toYaml .Values.nodeSelector | indent 8 }}
|
||||
tolerations:
|
||||
{{ toYaml .Values.tolerations | indent 8 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "sematext-agent.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "sematext-agent.name" . }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
release: {{ .Release.Name }}
|
||||
type: Opaque
|
||||
data:
|
||||
infra-token: {{ default "" .Values.infraToken | b64enc | quote }}
|
||||
container-token: {{ default "" .Values.containerToken | b64enc | quote }}
|
||||
logs-token: {{ default "" .Values.logsToken | b64enc | quote }}
|
||||
@@ -0,0 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "sematext-agent.fullname" . }}
|
||||
labels:
|
||||
app: {{ template "sematext-agent.name" . }}
|
||||
chart: {{ template "sematext-agent.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
type: {{ .Values.agent.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.agent.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app: {{ template "sematext-agent.name" . }}
|
||||
release: {{ .Release.Name }}
|
||||
@@ -0,0 +1,11 @@
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ template "sematext-agent.serviceAccountName" . }}
|
||||
labels:
|
||||
app: {{ template "sematext-agent.name" . }}
|
||||
chart: {{ template "sematext-agent.chart" . }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,63 @@
|
||||
agent:
|
||||
image:
|
||||
repository: sematext/agent
|
||||
tag: latest
|
||||
pullPolicy: Always
|
||||
service:
|
||||
port: 80
|
||||
type: ClusterIP
|
||||
config:
|
||||
JOURNAL_DIR: /opt/spm/st-agent
|
||||
PIPELINE_CONSOLE_OUTPUT: false
|
||||
PIPELINE_NULL_OUTPUT: false
|
||||
API_SERVER_HOST: 0.0.0.0
|
||||
LOGGING_WRITE_EVENTS: false
|
||||
LOGGING_REQUEST_TRACKING: false
|
||||
AUTODISCO_TEMPLATES_PATH: /etc/agent/autodisco.yml
|
||||
LOGGING_LEVEL: warn
|
||||
resources: {}
|
||||
|
||||
logagent:
|
||||
image:
|
||||
repository: sematext/logagent
|
||||
tag: latest
|
||||
pullPolicy: Always
|
||||
config:
|
||||
LOGSENE_BULK_SIZE: "1000"
|
||||
LOGSENE_LOG_INTERVAL: "10000"
|
||||
resources: {}
|
||||
|
||||
rbac:
|
||||
# Specifies whether RBAC resources should be created
|
||||
create: true
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a ServiceAccount should be created
|
||||
create: true
|
||||
# The name of the ServiceAccount to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name:
|
||||
|
||||
# represents the infra token where most metrics, packages, processes, etc. are shipped
|
||||
infraToken: null
|
||||
# determines the token for the container app (container metrics are delivered here)
|
||||
containerToken: null
|
||||
# logsene token to send logs
|
||||
logsToken: null
|
||||
|
||||
# for private images
|
||||
# imagePullSecrets:
|
||||
|
||||
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
|
||||
|
||||
tolerations: []
|
||||
|
||||
# Node labels for pod assignment
|
||||
# Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
nodeSelector: {}
|
||||
Reference in New Issue
Block a user