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

Commit

Permalink
use new kube-state-metrics chart as requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaj committed Jun 8, 2017
1 parent 0c15770 commit bcef080
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 129 deletions.
3 changes: 1 addition & 2 deletions stable/datadog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: datadog
version: 0.4.0
version: 0.5.1
description: DataDog Agent
keywords:
- monitoring
Expand All @@ -10,7 +10,6 @@ icon: https://datadog-live.imgix.net/img/dd_logo_70x75.png
sources:
- https://app.datadoghq.com/account/settings#agent/kubernetes
- https://github.com/DataDog/docker-dd-agent
- https://github.com/kubernetes/kube-state-metrics
maintainers:
- name: Greg Taylor
email: gtaylor@gc-taylor.com
Expand Down
25 changes: 8 additions & 17 deletions stable/datadog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Introduction

This chart adds the DataDog Agent to all nodes in your cluster via a DaemonSet.
This chart adds the DataDog Agent to all nodes in your cluster via a DaemonSet. It also depends on the [kube-state-metrics chart](https://github.com/kubernetes/charts/tree/master/stable/kube-state-metrics).

## Prerequisites

Expand Down Expand Up @@ -40,28 +40,19 @@ The following tables lists the configurable parameters of the Datadog chart and
| Parameter | Description | Default |
|--------------------------------------|------------------------------------|-------------------------------------------|
| `datadog.apiKey` | Your Datadog API key | `Nil` You must provide your own key |
| `datadog.image.repository` | The image repository to pull from | `datadog/docker-dd-agent` |
| `datadog.image.tag` | The image tag to pull | `latest` |
| `datadog.image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `image.repository` | The image repository to pull from | `datadog/docker-dd-agent` |
| `image.tag` | The image tag to pull | `latest` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `datadog.env` | Additional Datadog environment variables | `nil` |
| `datadog.apmEnabled` | Enable tracing from the host | `nil` |
| `datadog.autoconf` | Additional Datadog service discovery configurations | `nil` |
| `datadog.checksd` | Additional Datadog service checks | `nil` |
| `datadog.confd` | Additional Datadog service configurations | `nil` |
| `imagePullPolicy` | Image pull policy | `IfNotPresent` |
| `datadog.resources.requests.cpu` | CPU resource requests | `100m` |
| `datadog.resources.limits.cpu` | CPU resource limits | `256m` |
| `datadog.resources.requests.memory` | Memory resource requests | `128Mi` |
| `datadog.resources.limits.memory` | Memory resource limits | `512Mi` |
| `resources.requests.cpu` | CPU resource requests | `100m` |
| `resources.limits.cpu` | CPU resource limits | `256m` |
| `resources.requests.memory` | Memory resource requests | `128Mi` |
| `resources.limits.memory` | Memory resource limits | `512Mi` |
| `kubeStateMetrics.enabled` | If true, create kube-state-metrics | `true` |
| `kubeStateMetrics.name` | kube-state-metrics container name | `kube-state-metrics` |
| `kubeStateMetrics.image.repository` | kube-state-metrics container image repository | `gcr.io/google_containers/kube-state-metrics` |
| `kubeStateMetrics.image.tag` | kube-state-metrics container image tag | `v0.4.1` |
| `kubeStateMetrics.image.pullPolicy` | kube-state-metrics container image pull policy | `IfNotPresent` |
| `kubeStateMetrics.nodeSelector` | node labels for kube-state-metrics pod assignment | `{}` |
| `kubeStateMetrics.podAnnotations` | annotations to be added to kube-state-metrics pods | `{}` |
| `kubeStateMetrics.resources` | kube-state-metrics resource requests and limits (YAML) | `{}` |


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

Expand Down
10 changes: 10 additions & 0 deletions stable/datadog/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
dependencies:
- condition: ""
enabled: false
import-values: null
name: kube-state-metrics
repository: https://kubernetes-charts.storage.googleapis.com/
tags: null
version: 0.1.0
digest: sha256:4a0aae1223aa488202fafd0d1bf83acf79e33658aa182e67246555bb673be5f8
generated: 2017-06-08T14:44:57.672594138+02:00
5 changes: 5 additions & 0 deletions stable/datadog/requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dependencies:
- name: kube-state-metrics
version: 0.1.0
repository: https://kubernetes-charts.storage.googleapis.com/
condition: kubeStateMetrics.enabled
23 changes: 3 additions & 20 deletions stable/datadog/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,12 @@ Expand the name of the chart.
{{- end -}}

{{/*
Create a default fully qualified datadog name.
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 "datadog.fullname" -}}
{{- define "fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.datadog.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified kube-state-metrics name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "kubeStateMetrics.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.kubeStateMetrics.name | trunc 63 | trimSuffix "-" -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand All @@ -47,11 +38,3 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
{{- define "checksd.fullname" -}}
{{- printf "%s-datadog-checksd" .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified secret name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "secret.fullname" -}}
{{- printf "%s-datadog-secret" .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
18 changes: 8 additions & 10 deletions stable/datadog/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,22 @@
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: {{ template "datadog.fullname" . }}
name: {{ template "fullname" . }}
labels:
app: {{ template "name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
template:
metadata:
labels:
app: {{ template "name" . }}
component: "{{ .Values.datadog.name }}"
name: {{ template "datadog.fullname" . }}
app: {{ template "fullname" . }}
name: {{ template "fullname" . }}
spec:
containers:
- name: {{ template "name" . }}-{{ .Values.datadog.name }}
image: "{{ .Values.datadog.image.repository }}:{{ .Values.datadog.image.tag }}"
imagePullPolicy: {{ .Values.datadog.image.pullPolicy }}
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{ toYaml .Values.datadog.resources | indent 12 }}
{{ toYaml .Values.resources | indent 12 }}
ports:
- containerPort: 8125
name: dogstatsdport
Expand All @@ -36,7 +34,7 @@ spec:
- name: API_KEY
valueFrom:
secretKeyRef:
name: {{ template "secret.fullname" . }}
name: {{ template "fullname" . }}
key: api-key
- name: LOG_LEVEL
value: {{ .Values.datadog.logLevel | quote }}
Expand Down
33 changes: 0 additions & 33 deletions stable/datadog/templates/kube-state-metrics-deployment.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions stable/datadog/templates/secrets.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v1
kind: Secret
metadata:
name: {{ template "secret.fullname" . }}
name: {{ template "fullname" . }}
labels:
app: {{ template "secret.fullname" . }}
app: {{ template "fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
Expand Down
55 changes: 10 additions & 45 deletions stable/datadog/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Default values for datadog.
image:
repository: datadog/docker-dd-agent
tag: latest
pullPolicy: IfNotPresent

## deploy the kube-state-metrics deployment
## ref: https://github.com/kubernetes/charts/tree/master/stable/kube-state-metrics
##
kubeStateMetrics.enabled: true

datadog:
## You'll need to set this to your Datadog API key before the agent will run.
Expand All @@ -9,12 +19,6 @@ datadog:
##
name: dd-agent

# Default values for datadog.
image:
repository: datadog/docker-dd-agent
tag: latest
pullPolicy: IfNotPresent

## Set logging verbosity.
## ref: https://github.com/DataDog/docker-dd-agent#environment-variables
##
Expand Down Expand Up @@ -83,42 +87,3 @@ datadog:
limits:
cpu: 256m
memory: 512Mi


kubeStateMetrics:
## Whether to deploy kube-state-metrics
## Ref: https://github.com/kubernetes/kube-state-metrics/
## it can be set to false if it is already deployed some other way
## as Datadog agents will detect it automatically.
enabled: true

## kube-state-metrics container name
##
name: kube-state-metrics

## kube-state-metrics container image
##
image:
repository: gcr.io/google_containers/kube-state-metrics
tag: v0.4.1
pullPolicy: IfNotPresent

## Node labels for kube-state-metrics pod assignment
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
##
nodeSelector: {}

## Annotations to be added to kube-state-metrics pods
##
podAnnotations: {}

## kube-state-metrics resource requests and limits
##
resources: {}
# limits:
# cpu: 10m
# memory: 16Mi
# requests:
# cpu: 10m
# memory: 16Mi

0 comments on commit bcef080

Please sign in to comment.