Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Add scalyr #1066

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 14 additions & 0 deletions stable/scalyr/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
description: Scalyr Agent
home: https://www.scalyr.com
icon: https://www.scalyr.com/s2/src/img/logo-reverse.png
keywords:
- monitoring
- alerting
- logging
maintainers:
- email: [email protected]
name: Pierre Ozoux
name: scalyr
sources:
- https://www.scalyr.com/help/install-agent-docker
version: 0.1.0
67 changes: 67 additions & 0 deletions stable/scalyr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Scalyr

[Scalyr](https://www.scalyr.com/) is a hosted infrastructure logging platform.

## Introduction

This chart adds the Scalyr Agent to all nodes in your cluster via a DaemonSet.

## Prerequisites

- Kubernetes 1.2+ with Beta APIs enabled

## Installing the Chart

To install the chart with the release name `my-release`, retrieve your Scalyr API key from your account and run:

```bash
$ helm install --name my-release \
--set scalyr.apiKey=YOUR-KEY-HERE stable/scalyr
```

After a few minutes, you should see hosts and logs being reported in scalyr.

> **Tip**: List all releases using `helm list`

## Uninstalling the Chart

To uninstall/delete the `my-release` deployment:

```bash
$ helm delete my-release
```

The command removes all the Kubernetes components associated with the chart and deletes the release.

## Configuration

The following tables lists the configurable parameters of the Datadog chart and their default values.

| Parameter | Description | Default |
|-----------------------------|------------------------------------|-------------------------------------------|
| `scalyr.apiKey` | Your Scalyr API key | `Nil` You must provide your own key |
| `scalyr.config.reportContainerMetrics` | Report container metrics. | `false` |
| `image.repository` | The image repository to pull from | `datadog/docker-dd-agent` |
| `image.tag` | The image tag to pull | `latest` |
| `imagePullPolicy` | Image pull policy | `IfNotPresent` |
| `resources.requests.cpu` | CPU resource requests | 128M |
| `resources.limits.cpu` | CPU resource limits | 512Mi |
| `resources.requests.memory` | Memory resource requests | 50m |
| `resources.limits.memory` | Memory resource limits | 256m |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

```bash
$ helm install --name my-release \
--set scalyr.apiKey=YOUR-KEY-HERE \
stable/scalyr
```

Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,

```bash
$ helm install --name my-release -f values.yaml stable/scalyr
```

> **Tip**: You can use the default [values.yaml](values.yaml)
23 changes: 23 additions & 0 deletions stable/scalyr/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if .Values.scalyr.apiKey -}}
Scalyr agents are spinning up on each node in your cluster. After a few
minutes, you should see your agents starting in your event stream:

https://www.scalyr.com/logStart

No further action should be required.

{{- else -}}
##############################################################################
#### ERROR: You did not set a scalyr.apiKey. ####
##############################################################################

This deployment will be incomplete until you get your API key from Scalyr.
Once registered you can request an API key at:

https://www.scalyr.com/

Then run:

helm upgrade {{ .Release.Name }} \
--set scalyr.apiKey=YOUR-KEY-HERE stable/scalyr
{{- end }}
16 changes: 16 additions & 0 deletions stable/scalyr/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "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).
*/}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
21 changes: 21 additions & 0 deletions stable/scalyr/templates/cm-agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
data:
agent.json: |-
{
implicit_metric_monitor: false,
implicit_agent_process_metrics_monitor: false,
import_vars: [ "API_KEY" ],
api_key: "$API_KEY",
monitors: [{
module: "scalyr_agent.builtin_monitors.docker_monitor",
report_container_metrics: {{ .Values.scalyr.config.reportContainerMetrics }}
}]
}
47 changes: 47 additions & 0 deletions stable/scalyr/templates/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{{- if .Values.scalyr.apiKey }}
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: "{{ .Release.Service }}"
release: "{{ .Release.Name }}"
spec:
template:
metadata:
labels:
app: {{ template "fullname" . }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add release label: release: "{{ .Release.Name }}"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, done

release: "{{ .Release.Name }}"
name: {{ template "fullname" . }}
spec:
tolerations:
- operator: "Exists"
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{ toYaml .Values.resources | indent 12 }}
ports:
env:
- name: API_KEY
valueFrom:
secretKeyRef:
name: {{ template "fullname" . }}
key: api-key
volumeMounts:
- name: dockersocket
mountPath: /var/scalyr/docker.sock
readOnly: true
- name: configuration
mountPath: /etc/scalyr-agent-2
volumes:
- name: dockersocket
hostPath:
path: /var/run/docker.sock
- name: configuration
configMap:
name: {{ template "fullname" . }}
{{ end }}
12 changes: 12 additions & 0 deletions stable/scalyr/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
type: Opaque
data:
api-key: {{ required "A valid .Values.scalyr.apiKey entry required!" .Values.scalyr.apiKey | b64enc | quote }}
21 changes: 21 additions & 0 deletions stable/scalyr/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Default values for scalyr.
image:
repository: scalyr/scalyr-docker-agent
tag: 2.0.27
pullPolicy: IfNotPresent

scalyr:
## You'll need to set this to your Scalyr API key before the agent will run.
## ref: https://www.scalyr.com
##
# apiKey:
config:
reportContainerMetrics: false

# resources:
# requests:
# cpu: 50m
# memory: 128Mi
# limits:
# cpu: 256m
# memory: 512Mi