diff --git a/stable/coscale/Chart.yaml b/stable/coscale/Chart.yaml new file mode 100755 index 0000000000..2ba2956391 --- /dev/null +++ b/stable/coscale/Chart.yaml @@ -0,0 +1,17 @@ +name: coscale +version: 0.1.0 +appVersion: 3.9.1 +description: CoScale Agent +keywords: + - monitoring + - alerting + - metric + - event + - anomaly detection +home: https://www.coscale.com/ +icon: https://www.coscale.com/hubfs/Logo%20CoScale/CoScale_Logos/new_coscale_logo.png +sources: + - https://app.coscale.com/ +maintainers: + - name: fryckbos + email: frederick.ryckbosch@coscale.com diff --git a/stable/coscale/README.md b/stable/coscale/README.md new file mode 100644 index 0000000000..6e7f13ef02 --- /dev/null +++ b/stable/coscale/README.md @@ -0,0 +1,60 @@ +# CoScale + +[CoScale](https://www.coscale.com/) offers full-stack monitoring for containers and microservices. + +## Introduction + +This chart adds the CoScale 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 CoScale details from your [Agent page](https://app.coscale.com/) and run: + +```bash +$ helm install \ + --name my-release \ + --set coscale.appId=YOUR-APP-ID,coscale.accessToken=YOUR-ACCESS-TOKEN,coscale.templateId=YOUR-TEMPLATE-ID \ + stable/coscale +``` + +After a few minutes, you should see hosts and containers appearing in the CoScale UI. + +> **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 CoScale chart and their default values. + +| Parameter | Description | Default | +|-----------------------------|------------------------------------|-------------------------------------------| +| `coscale.appId` | Your CoScale Application Id | `Nil` You must provide your own | +| `coscale.accessToken` | Your CoScale Access Token | `Nil` You must provide your own | +| `coscale.templateId` | Your CoScale Agent Template Id | `Nil` You must provide your own | +| `image.repository` | The image repository to pull from | `coscale/coscale-agent` | +| `image.tag` | The image tag to pull | `3.10.11` | +| `image.pullPolicy` | The Image pull policy | `IfNotPresent` | + + +Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. + +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/coscale +``` + +> **Tip**: You can use the default [values.yaml](values.yaml) diff --git a/stable/coscale/templates/NOTES.txt b/stable/coscale/templates/NOTES.txt new file mode 100644 index 0000000000..5aa0397fac --- /dev/null +++ b/stable/coscale/templates/NOTES.txt @@ -0,0 +1,26 @@ +{{- if and (and .Values.coscale.appId .Values.coscale.accessToken) .Values.coscale.templateId -}} +CoScale agents are spinning up on each node in your cluster. After a few +seconds, you should see your hosts and hosts appearing in the CoScale UI: + + https://app.coscale.com/ + +No further action should be required. + +{{- else -}} +################################################################################################# +#### ERROR: You did not set a coscale.appId or coscale.accessToken or coscale.templateId #### +################################################################################################# + +This deployment will be incomplete until you get your CoScale Agent Key. +Sing up for a free CoScale trial at https://www.coscale.com/free-trial + +Once registered you can get your Agent Key at: + + https://app.coscale.com/ + +Then run: + + helm upgrade {{ .Release.Name }} \ + --set coscale.appId=YOUR-APP-ID,coscale.accessToken=YOUR-ACCESS-TOKEN,coscale.templateId=YOUR-TEMPLATE-ID \ + stable/coscale +{{- end }} \ No newline at end of file diff --git a/stable/coscale/templates/_helpers.tpl b/stable/coscale/templates/_helpers.tpl new file mode 100644 index 0000000000..f0d83d2edb --- /dev/null +++ b/stable/coscale/templates/_helpers.tpl @@ -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 -}} diff --git a/stable/coscale/templates/daemonset.yaml b/stable/coscale/templates/daemonset.yaml new file mode 100644 index 0000000000..e22534186d --- /dev/null +++ b/stable/coscale/templates/daemonset.yaml @@ -0,0 +1,51 @@ +{{- if and (and .Values.coscale.appId .Values.coscale.accessToken) .Values.coscale.templateId -}} +apiVersion: extensions/v1beta1 +kind: DaemonSet +metadata: + name: {{ template "name" . }} + labels: + app: {{ template "name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +spec: + template: + metadata: + name: {{ template "name" . }} + labels: + app: {{ template "name" . }} + spec: + hostNetwork: true + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + resources: +{{ toYaml .Values.resources | indent 12 }} + env: + - name: APP_ID + valueFrom: + secretKeyRef: + name: {{ template "name" . }} + key: app_id + - name: ACCESS_TOKEN + valueFrom: + secretKeyRef: + name: {{ template "name" . }} + key: access_token + - name: TEMPLATE_ID + value: {{ .Values.coscale.templateId | quote }} + volumeMounts: + - name: dockersocket + mountPath: /var/run/docker.sock + - name: hostroot + mountPath: /host + readOnly: true + volumes: + - hostPath: + path: /var/run/docker.sock + name: dockersocket + - hostPath: + path: / + name: hostroot +{{ end }} diff --git a/stable/coscale/templates/secrets.yaml b/stable/coscale/templates/secrets.yaml new file mode 100644 index 0000000000..f1cede9b2d --- /dev/null +++ b/stable/coscale/templates/secrets.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "name" . }} + labels: + app: {{ template "name" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +type: Opaque +data: + app_id : {{ default "MISSING" .Values.coscale.appId | b64enc | quote }} + access_token : {{ default "MISSING" .Values.coscale.accessToken | b64enc | quote }} \ No newline at end of file diff --git a/stable/coscale/values.yaml b/stable/coscale/values.yaml new file mode 100644 index 0000000000..59559572f5 --- /dev/null +++ b/stable/coscale/values.yaml @@ -0,0 +1,24 @@ +# Default values for CoScale Helm package. + +image: + repository: "coscale/coscale-agent" + tag: "3.10.11" + pullPolicy: "IfNotPresent" + +coscale: + # Required: You need a CoScale AppId before running agents. + appId: "" + + # Required: You need a CoScale AccessToken before running agents. + accessToken: "" + + # Required: You need a CoScale TemplateId before running agents. + templateId: "" + +resources: + requests: + cpu: 100m + memory: 128Mi + limits: + cpu: 256m + memory: 512Mi