From 54924ce4bc6bcb6ca77ea31b0f46d1d09da66d01 Mon Sep 17 00:00:00 2001 From: Samir Musali Date: Tue, 21 May 2019 15:48:58 -0400 Subject: [PATCH 1/4] Updates: v1.1.0 (#1) * v1.1.0 * Update README.md Signed-off-by: Samir Musali --- stable/logdna-agent/CHANGELOG.md | 12 ++++++++++++ stable/logdna-agent/Chart.yaml | 4 +++- stable/logdna-agent/OWNERS | 6 ++++++ stable/logdna-agent/README.md | 5 +++-- stable/logdna-agent/templates/NOTES.txt | 12 ++++++++---- stable/logdna-agent/templates/daemonset.yaml | 10 +++++----- stable/logdna-agent/templates/secrets.yaml | 2 ++ stable/logdna-agent/values.yaml | 7 ++++--- 8 files changed, 43 insertions(+), 15 deletions(-) create mode 100644 stable/logdna-agent/CHANGELOG.md create mode 100644 stable/logdna-agent/OWNERS diff --git a/stable/logdna-agent/CHANGELOG.md b/stable/logdna-agent/CHANGELOG.md new file mode 100644 index 000000000000..90f5cc056397 --- /dev/null +++ b/stable/logdna-agent/CHANGELOG.md @@ -0,0 +1,12 @@ +# 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 + +## v1.0.0 + +* Initial Release \ No newline at end of file diff --git a/stable/logdna-agent/Chart.yaml b/stable/logdna-agent/Chart.yaml index d0fe912c6a3a..fd39dc681bec 100644 --- a/stable/logdna-agent/Chart.yaml +++ b/stable/logdna-agent/Chart.yaml @@ -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 +version: 1.1.0 appVersion: 1.5.6 keywords: - logs @@ -20,3 +20,5 @@ sources: maintainers: - name: leeliu email: lee@logdna.com +- name: smusali + email: samir.musali@logdna.com \ No newline at end of file diff --git a/stable/logdna-agent/OWNERS b/stable/logdna-agent/OWNERS new file mode 100644 index 000000000000..2d87c76507c7 --- /dev/null +++ b/stable/logdna-agent/OWNERS @@ -0,0 +1,6 @@ +approvers: +- smusali +- leeliu +reviewers: +- smusali +- leeliu \ No newline at end of file diff --git a/stable/logdna-agent/README.md b/stable/logdna-agent/README.md index c7c908f3e800..d0657394556c 100644 --- a/stable/logdna-agent/README.md +++ b/stable/logdna-agent/README.md @@ -49,9 +49,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 | diff --git a/stable/logdna-agent/templates/NOTES.txt b/stable/logdna-agent/templates/NOTES.txt index f8669b06799b..7fcbb8673fa4 100644 --- a/stable/logdna-agent/templates/NOTES.txt +++ b/stable/logdna-agent/templates/NOTES.txt @@ -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 diff --git a/stable/logdna-agent/templates/daemonset.yaml b/stable/logdna-agent/templates/daemonset.yaml index 83be99374688..f970d962c378 100644 --- a/stable/logdna-agent/templates/daemonset.yaml +++ b/stable/logdna-agent/templates/daemonset.yaml @@ -1,4 +1,4 @@ -{{- if .Values.logdna.key -}} +{{- if (or .Values.logdna.key .Values.logdna.secrets) -}} apiVersion: extensions/v1beta1 kind: DaemonSet metadata: @@ -18,16 +18,16 @@ 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 diff --git a/stable/logdna-agent/templates/secrets.yaml b/stable/logdna-agent/templates/secrets.yaml index 0f6a1d882492..5bed06e66b8e 100644 --- a/stable/logdna-agent/templates/secrets.yaml +++ b/stable/logdna-agent/templates/secrets.yaml @@ -1,3 +1,4 @@ +{{- if .Values.logdna.key -}} apiVersion: v1 kind: Secret metadata: @@ -9,3 +10,4 @@ metadata: type: Opaque data: logdna-agent-key: {{ default "" .Values.logdna.key | b64enc | quote }} +{{ end }} \ No newline at end of file diff --git a/stable/logdna-agent/values.yaml b/stable/logdna-agent/values.yaml index 82a12d04a5b6..3ea4385e0143 100644 --- a/stable/logdna-agent/values.yaml +++ b/stable/logdna-agent/values.yaml @@ -6,11 +6,12 @@ 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 + autoupdate: "0" # tags: name: logdna-agent From 7bb1abac9e01e504bc3081ec94c24de6c4bd1a08 Mon Sep 17 00:00:00 2001 From: Samir Musali Date: Wed, 22 May 2019 16:23:27 -0400 Subject: [PATCH 2/4] One Last Commit Signed-off-by: Samir Musali --- stable/logdna-agent/Chart.yaml | 2 +- stable/logdna-agent/templates/secrets.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stable/logdna-agent/Chart.yaml b/stable/logdna-agent/Chart.yaml index fd39dc681bec..8e61c360e885 100644 --- a/stable/logdna-agent/Chart.yaml +++ b/stable/logdna-agent/Chart.yaml @@ -21,4 +21,4 @@ maintainers: - name: leeliu email: lee@logdna.com - name: smusali - email: samir.musali@logdna.com \ No newline at end of file + email: samir.musali@logdna.com diff --git a/stable/logdna-agent/templates/secrets.yaml b/stable/logdna-agent/templates/secrets.yaml index 5bed06e66b8e..3e1d317b5c51 100644 --- a/stable/logdna-agent/templates/secrets.yaml +++ b/stable/logdna-agent/templates/secrets.yaml @@ -10,4 +10,4 @@ metadata: type: Opaque data: logdna-agent-key: {{ default "" .Values.logdna.key | b64enc | quote }} -{{ end }} \ No newline at end of file +{{ end }} From d16513d8c41c34c7f4777237fa95351e86a6d027 Mon Sep 17 00:00:00 2001 From: Samir Musali Date: Wed, 22 May 2019 18:25:07 -0400 Subject: [PATCH 3/4] Adding LICENSE, .helmignore, and Metadata for Values; Updating README, Chart, Values, and DaemonSet Signed-off-by: Samir Musali --- stable/logdna-agent/.helmignore | 21 ++++ stable/logdna-agent/Chart.yaml | 4 +- stable/logdna-agent/LICENSE | 21 ++++ stable/logdna-agent/README.md | 25 ++++- stable/logdna-agent/templates/daemonset.yaml | 26 ++++- stable/logdna-agent/values-metadata.yaml | 101 +++++++++++++++++++ stable/logdna-agent/values.yaml | 7 +- 7 files changed, 198 insertions(+), 7 deletions(-) create mode 100644 stable/logdna-agent/.helmignore create mode 100644 stable/logdna-agent/LICENSE create mode 100644 stable/logdna-agent/values-metadata.yaml diff --git a/stable/logdna-agent/.helmignore b/stable/logdna-agent/.helmignore new file mode 100644 index 000000000000..c13e3c8fbb2f --- /dev/null +++ b/stable/logdna-agent/.helmignore @@ -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 \ No newline at end of file diff --git a/stable/logdna-agent/Chart.yaml b/stable/logdna-agent/Chart.yaml index 8e61c360e885..6dc9d0de319e 100644 --- a/stable/logdna-agent/Chart.yaml +++ b/stable/logdna-agent/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: logdna-agent -description: Run this, get logs. All cluster containers. LogDNA collector agent daemonset for Kubernetes. +description: LogDNA collector agent daemonset for Kubernetes. version: 1.1.0 appVersion: 1.5.6 keywords: @@ -22,3 +22,5 @@ maintainers: email: lee@logdna.com - name: smusali email: samir.musali@logdna.com +tillerVersion: ">=2.4.0" +kubeVersion: ">=1.12.4" diff --git a/stable/logdna-agent/LICENSE b/stable/logdna-agent/LICENSE new file mode 100644 index 000000000000..9193d0c8cdb5 --- /dev/null +++ b/stable/logdna-agent/LICENSE @@ -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. diff --git a/stable/logdna-agent/README.md b/stable/logdna-agent/README.md index d0657394556c..b7c6dbb78e0f 100644 --- a/stable/logdna-agent/README.md +++ b/stable/logdna-agent/README.md @@ -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 @@ -71,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) diff --git a/stable/logdna-agent/templates/daemonset.yaml b/stable/logdna-agent/templates/daemonset.yaml index f970d962c378..1a3a1a57d3bb 100644 --- a/stable/logdna-agent/templates/daemonset.yaml +++ b/stable/logdna-agent/templates/daemonset.yaml @@ -1,11 +1,12 @@ {{- if (or .Values.logdna.key .Values.logdna.secrets) -}} -apiVersion: extensions/v1beta1 +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: @@ -13,6 +14,7 @@ spec: labels: app: {{ template "logdna.name" . }} chart: {{ template "logdna.chart" . }} + helm.sh/chart: {{ template "logdna.chart" . }} release: {{ .Release.Name }} spec: containers: @@ -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 }} @@ -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 }} diff --git a/stable/logdna-agent/values-metadata.yaml b/stable/logdna-agent/values-metadata.yaml new file mode 100644 index 000000000000..8d3600fd7ba2 --- /dev/null +++ b/stable/logdna-agent/values-metadata.yaml @@ -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 diff --git a/stable/logdna-agent/values.yaml b/stable/logdna-agent/values.yaml index 3ea4385e0143..b7f6ab4cde0c 100644 --- a/stable/logdna-agent/values.yaml +++ b/stable/logdna-agent/values.yaml @@ -7,13 +7,14 @@ logdna: ## Please follow directions from https://app.logdna.com/pages/add-source ## An ingestion key or custom secrets template is required to run this chart - ## key: "" + key: "" ## secrets: "" ## Optional settings autoupdate: "0" - # tags: - + tags: "" + apihost: api.logdna.com + loghost: logs.logdna.com name: logdna-agent resources: From 74062a92e18b992649822a8ac0ef099bcaa070c7 Mon Sep 17 00:00:00 2001 From: Samir Musali Date: Wed, 22 May 2019 18:28:59 -0400 Subject: [PATCH 4/4] Updated CHANGELOG Signed-off-by: Samir Musali --- stable/logdna-agent/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stable/logdna-agent/CHANGELOG.md b/stable/logdna-agent/CHANGELOG.md index 90f5cc056397..50d861e60138 100644 --- a/stable/logdna-agent/CHANGELOG.md +++ b/stable/logdna-agent/CHANGELOG.md @@ -6,6 +6,8 @@ This file documents all notable changes to `LogDNA Agent Helm Chart`. The releas * Fix `autoupdate` Type Mismatch * Support for Custom `Secrets` Template +* Support for Custom `LogDNA API Hostname` +* Support for Custom `LogDNA Ingestion Hostname` ## v1.0.0