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

[stable/logdna-agent]: v1.1.0 #14047

Closed
wants to merge 4 commits 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
21 changes: 21 additions & 0 deletions stable/logdna-agent/.helmignore
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions stable/logdna-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Change Log

This file documents all notable changes to `LogDNA Agent Helm Chart`. The release numbering uses [semantic versioning](http://semver.org).

## v1.1.0

* Fix `autoupdate` Type Mismatch
* Support for Custom `Secrets` Template
* Support for Custom `LogDNA API Hostname`
* Support for Custom `LogDNA Ingestion Hostname`

## v1.0.0

* Initial Release
8 changes: 6 additions & 2 deletions stable/logdna-agent/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: logdna-agent
description: Run this, get logs. All cluster containers. LogDNA collector agent daemonset for Kubernetes.
version: 1.0.0
description: LogDNA collector agent daemonset for Kubernetes.
version: 1.1.0
appVersion: 1.5.6
keywords:
- logs
Expand All @@ -20,3 +20,7 @@ sources:
maintainers:
- name: leeliu
email: lee@logdna.com
- name: smusali
email: samir.musali@logdna.com
tillerVersion: ">=2.4.0"
kubeVersion: ">=1.12.4"
21 changes: 21 additions & 0 deletions stable/logdna-agent/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 LogDNA, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 6 additions & 0 deletions stable/logdna-agent/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
approvers:
- smusali
- leeliu
reviewers:
- smusali
- leeliu
30 changes: 26 additions & 4 deletions stable/logdna-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,33 @@ This chart deploys LogDNA collector agents to all nodes in your cluster. Logs wi
## Prerequisites

- Kubernetes 1.2+
- A LogDNA Ingestion Key

### Creating a Secret

The logdna-agent chart requires that you store your ingestion key inside a kubernetes secret using the key name logdna-agent-key. We suggest that you name the secret with the name of your release followed by logdna-agent, separated with a dash. For example if you plan to create a deployment with release name my-release then use this command (replaceing the X's with your ingestion key and substituting namespace_name with the namespace you want to use):

```
kubectl create secret generic my-release-logdna-agent \
--from-literal='logdna-agent-key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
--namespace namespace_name
```
When installing the chart you must refer to the name of the secret you have created. In our previous example that name is `my-release-logdna-agent`.

## Installing the Chart

To install the chart with the release name `my-release`, please follow directions from https://app.logdna.com/pages/add-source to obtain your LogDNA Ingestion Key:
### Obtain LogDNA Ingestion Key from LogDNA server instance
Please follow directions from [LogDNA Instructions Page](https://app.logdna.com/pages/add-source) to obtain your LogDNA Ingestion Key.

### Install
To install the chart with the release name `my-release`:

```bash
$ helm install --name my-release \
--set logdna.key=LOGDNA_INGESTION_KEY,logdna.autoupdate=1 stable/logdna-agent
```

You should see logs in https://app.logdna.com in a few seconds.
You should see logs in [LogDNA Console](https://app.logdna.com) in a few seconds.

### Tags support:
```bash
Expand All @@ -49,9 +65,10 @@ The following tables lists the configurable parameters of the LogDNA Agent chart

Parameter | Description | Default
--- | --- | ---
`logdna.key` | LogDNA Ingestion Key (Required) | None
`logdna.key` | LogDNA Ingestion Key (Required if no `secrets` provided) | None
`logdna.secrets` | Custom Template Having `logdna-agent-key` (Required if no `key` provided) | None
`logdna.tags` | Optional tags such as `production` | None
`logdna.autoupdate` | Optionally turn on autoupdate by setting to 1 (auto sets image.pullPolicy to always) | `0`
`logdna.autoupdate` | Optionally turn on autoupdate by setting to `"1"` (auto sets image.pullPolicy to always) | `"0"`
`image.pullPolicy` | Image pull policy | `IfNotPresent`
`image.tag` | Image tag | `latest`
`resources.limits.memory` | Memory resource limits | 500Mi |
Expand All @@ -70,4 +87,9 @@ Alternatively, a YAML file that specifies the values for the above parameters ca
$ helm install --name my-release -f values.yaml stable/logdna-agent
```

## Support

### Connecting to LogDNA server instance
If you configure your agent to connect to LogDNA directly, you may contact LogDNA support through the [LogDNA web console](https://app.logdna.com/) if you experience issues connecting to LogDNA directly.

> **Tip**: You can use the default [values.yaml](values.yaml)
12 changes: 8 additions & 4 deletions stable/logdna-agent/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{{- if not .Values.logdna.key -}}
#############################################################
### ERROR: Please specify an ingestion key `logdna.key` ###
#############################################################
{{- if not (or .Values.logdna.key .Values.logdna.secrets) -}}
############################################################################
### ERROR: ###
### Please, Specify: ###
### - either LogDNA Ingestion Key `logdna.key` ###
### - or Custom Template `logdna.secrets` Having `logdna-agent-key` ###
### ###
############################################################################


Please follow directions from https://app.logdna.com/pages/add-source
Expand Down
36 changes: 30 additions & 6 deletions stable/logdna-agent/templates/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
{{- if .Values.logdna.key -}}
apiVersion: extensions/v1beta1
{{- if (or .Values.logdna.key .Values.logdna.secrets) -}}
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ template "logdna.name" . }}
labels:
app: {{ template "logdna.name" . }}
chart: {{ template "logdna.chart" . }}
helm.sh/chart: {{ template "logdna.chart" . }}
release: {{ .Release.Name }}
spec:
template:
metadata:
labels:
app: {{ template "logdna.name" . }}
chart: {{ template "logdna.chart" . }}
helm.sh/chart: {{ template "logdna.chart" . }}
release: {{ .Release.Name }}
spec:
containers:
- name: {{ template "logdna.name" . }}
image: "{{.Values.image.name}}:{{.Values.image.tag}}"
{{- if eq .Values.logdna.autoupdate "1" }}
imagePullPolicy: "always"
{{- else }}
{{- if eq .Values.logdna.autoupdate "0" }}
imagePullPolicy: "{{.Values.image.pullPolicy}}"
{{- else }}
imagePullPolicy: "always"
{{- end }}
env:
- name: LOGDNA_AGENT_KEY
valueFrom:
secretKeyRef:
name: {{ template "logdna.name" . }}
name: {{ if .Values.logdna.secrets -}}{{ .Values.logdna.secrets }}{{ else }}{{ template "logdna.name" . }}{{ end }}
key: logdna-agent-key
- name: LOGDNA_PLATFORM
value: k8s
Expand All @@ -38,6 +40,14 @@ spec:
{{- if .Values.logdna.autoupdate }}
- name: LOGDNA_AUTOUPDATE
value: {{ .Values.logdna.autoupdate }}
{{- end }}
{{- if .Values.logdna.apihost }}
- name: LDAPIHOST
value: {{ .Values.logdna.apihost }}
{{- end }}
{{- if .Values.logdna.loghost }}
- name: LDLOGHOST
value: {{ .Values.logdna.loghost }}
{{- end }}
resources:
{{ toYaml .Values.resources | indent 12 }}
Expand Down Expand Up @@ -75,6 +85,20 @@ spec:
- name: logdnahostname
hostPath:
path: /etc/hostname
livenessProbe:
exec:
command:
- /usr/bin/logdna-agent
- --version
initialDelaySeconds: 30
periodSeconds: 30
readinessProbe:
exec:
command:
- /usr/bin/logdna-agent
- --version
initialDelaySeconds: 30
periodSeconds: 30
tolerations:
{{ toYaml .Values.daemonset.tolerations | indent 8 }}
{{ end }}
2 changes: 2 additions & 0 deletions stable/logdna-agent/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.logdna.key -}}
apiVersion: v1
kind: Secret
metadata:
Expand All @@ -9,3 +10,4 @@ metadata:
type: Opaque
data:
logdna-agent-key: {{ default "" .Values.logdna.key | b64enc | quote }}
{{ end }}
101 changes: 101 additions & 0 deletions stable/logdna-agent/values-metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
image:
__metadata:
label: Image
description: Docker Image Configuration Values
name:
__metadata:
label: Image Name
description: Docker Image Name
type: string
required: true
tag:
__metadata:
label: Image Tag
description: Docker Image Tag
type: string
required: true
pullPolicy:
__metadata:
label: Image Pull Policy
description: Docker Image Pull Policy
type: string
required: true


logdna:
__metadata:
label: LogDNA
description: logdna configuration values
key:
__metadata:
label: Ingestion Key
description: LogDNA Ingestion Key
type: string
required: true

## In the Absence of key
secrets:
__metadata:
label: Custom Secrets
description: Custom Secrets Template containing LogDNA Ingestion Key
type: string
required: false

## Optional settings
autoupdate:
__metadata:
label: Auto Update
description: Whether the Agent Auto Updates or Not
type: string
required: false
tags:
__metadata:
label: Tags
description: Comma-Separated List of Tags
type: string
required: false

apihost:
__metadata:
label: LogDNA API Host
description: LogDNA API Hostname
type: string
required: false

loghost:
__metadata:
label: LogDNA Logs Host
description: LogDNA Ingestion Hostname
type: string
required: false

resources:
__metadata:
label: Resources
description: kubernetes resource configuration values
requests:
cpu:
__metadata:
label: CPU
description: Kubernetes Resource Request CPU
type: string
required: true

limits:
memory:
__metadata:
label: Memory
description: Kubernetes Resource Memory Limit
type: string
required: true

daemonset:
__metadata:
label: Daemonset
description: K8S DaemonSet Configuration Values
tolerations:
__metadata:
label: Tolerations
type: string
description: List of Tolerations
required: false
12 changes: 7 additions & 5 deletions stable/logdna-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ image:
logdna:
## Please follow directions from https://app.logdna.com/pages/add-source

## An ingestion key is required for this chart to run
# key:
## An ingestion key or custom secrets template is required to run this chart
key: ""
## secrets: ""

## Optional settings
autoupdate: 0
# tags:

autoupdate: "0"
tags: ""
apihost: api.logdna.com
loghost: logs.logdna.com
name: logdna-agent

resources:
Expand Down