Sensu Support (#241)

* sensu support

* adding requested documentation for endpoint
This commit is contained in:
Shane Starcher
2016-12-19 15:00:26 -08:00
committed by Lachlan Evenson
parent 14546e2c3a
commit 0c62b3e5ad
10 changed files with 336 additions and 0 deletions
+21
View File
@@ -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
+17
View File
@@ -0,0 +1,17 @@
apiVersion: v1
name: sensu
version: 0.1.0
description: Sensu monitoring framework backed by the Redis transport
keywords:
- sensu
- monitoring
home: https://sensuapp.org/
sources:
- https://github.com/kubernetes/charts
- https://github.com/sstarcher/docker-sensu
- https://github.com/sensu/sensu
maintainers:
- name: Shane Starcher
email: shane.starcher@gmail.com
icon: https://raw.githubusercontent.com/sensu/sensu/master/sensu-logo.png
engine: gotpl
+96
View File
@@ -0,0 +1,96 @@
# Sensu
[Sensu](https://sensuapp.org/) is monitoring that doesn't suck.
## TL;DR;
```console
$ helm install stable/sensu
```
## Introduction
This chart bootstraps a [Sensu](https://github.com/sstarcher/docker-sensu) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
## Prerequisites
- Kubernetes 1.4+ with Beta APIs enabled
## Get this chart
Download the latest release of the chart from the [releases](../../../releases) page.
Alternatively, clone the repo if you wish to use the development snapshot:
```console
$ git clone https://github.com/kubernetes/charts.git
```
## Installing the Chart
To install the chart with the release name `my-release`:
```console
$ helm install --name my-release stable/sensu
```
*Replace the `x.x.x` placeholder with the chart release version.*
The command deploys Sensu on the Kubernetes cluster in the default configuration. The [configuration](#configuration) section lists the parameters that can be configured during installation.
> **Tip**: List all releases using `helm list`
## Uninstalling the Chart
To uninstall/delete the `my-release` deployment:
```console
$ 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 Sensu chart and their default values.
| Parameter | Description | Default |
| ------------------------------- | ------------------------------- | ---------------------------------------------------------- |
| `image` | Sensu image | `sstarcher/sensu` |
| `imageTag` | Sensu version | `0.26` |
| `imagePullPolicy` | Image pull policy | `IfNotPresent` |
| `replicaCount` | Number of sensu replicas | `1` |
| `httpPort` | Service port for kubernetes | `80` |
| `deis.routable` | Enables routing through the Deis router | `false` |
| `deis.domain` | The service name for deis to route | `sensu` |
| `server.resources.requests.cpu` | CPU request for sensu server | `100m` |
| `server.resources.requests.memory` | Memory request for sensu server | `100Mi` |
| `server.resources.limits.cpu` | CPU limit for sensu server | `` |
| `server.resources.limits.memory` | Memory limit for sensu server | `` |
| `api.resources.requests.cpu` | CPU request for api server | `50m` |
| `api.resources.requests.memory` | Memory request for api server | `100Mi` |
| `api.resources.limits.cpu` | CPU limit for api server | `` |
| `api.resources.limits.memory` | Memory limit for api server | `` |
| `REDIS_PORT` | Default port for redis | `6379` |
| `REDIS_DB` | The Redis instance DB to use/select | `0` |
| `REDIS_AUTO_RECONNECT` | Reconnect to Redis in the event of a connection failure | `true` |
| `REDIS_RECONNECT_ON_ERROR` | Reconnect to Redis in the event of a Redis error, e.g. READONLY | `true` |
Configuration reference for sensu [Sensu/Docs](https://sensuapp.org/docs/latest/reference/)
```console
$ helm install --name my-release \
--set imageTag=0.26.5 \
stable/sensu
```
The above command sets the Sensu version to `0.26.5`.
Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,
```console
$ helm install --name my-release -f values.yaml stable/sensu
```
> **Tip**: You can use the default [values.yaml](values.yaml)
+6
View File
@@ -0,0 +1,6 @@
dependencies:
- name: redis
repository: https://kubernetes-charts.storage.googleapis.com/
version: 0.4.1
digest: sha256:eb0ce32c8ed56c97ae0469a903c6d62e50b00c3770618bb140ef8b660e3de789
generated: 2016-11-22T09:09:22.04416797-05:00
+4
View File
@@ -0,0 +1,4 @@
dependencies:
- name: redis
version: 0.4.1
repository: https://kubernetes-charts.storage.googleapis.com/
+20
View File
@@ -0,0 +1,20 @@
Getting Started:
1. Get the Sensu API URL to visit by running these commands in the same shell:
{{- if contains "NodePort" .Values.serviceType }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.serviceType }}
**** NOTE: It may take a few minutes for the LoadBalancer IP to be available. ****
**** You can watch the status of by running 'kubectl get svc -w {{ template "fullname" . }}' ****
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.httpPort }}/login
{{- else if contains "ClusterIP" .Values.serviceType }}
echo 'API endpoints docs at https://sensuapp.org/docs/0.24/api/health-and-info-api.html'
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ template "fullname" . }}" -o jsonpath="{.items[0].metadata.name}")
echo http://127.0.0.1:4567/info
kubectl port-forward $POD_NAME 4567:4567
{{- end }}
+24
View File
@@ -0,0 +1,24 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 24 -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "redis.fullname" -}}
{{- printf "%s-%s" .Release.Name "redis" | trunc 24 -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 24 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 24 -}}
{{- end -}}
+82
View File
@@ -0,0 +1,82 @@
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: {{template "fullname" . }}
labels:
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
app: {{ template "fullname" . }}
release: {{ .Release.Name | quote }}
spec:
containers:
- name: server
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
imagePullPolicy: {{ .Values.pullPolicy }}
args:
- server
{{ toYaml .Values.server.resources | indent 8 }}
env:
- name: API_HOST
value: localhost
- name: API_PORT
value: '4567'
- name: REDIS_HOST
value: {{ template "redis.fullname" . }}
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "redis.fullname" . }}
key: redis-password
- name: REDIS_DB
value: {{ .Values.REDIS_DB | quote }}
- name: REDIS_AUTO_RECONNECT
value: {{ .Values.REDIS_AUTO_RECONNECT | quote}}
- name: REDIS_RECONNECT_ON_ERROR
value: {{ .Values.REDIS_RECONNECT_ON_ERROR | quote }}
- name: REDIS_PORT
value: {{ .Values.REDIS_PORT | quote }}
- name: api
image: "{{ .Values.image }}:{{ .Values.imageTag }}"
imagePullPolicy: {{ .Values.pullPolicy }}
args:
- api
{{ toYaml .Values.api.resources | indent 8 }}
env:
- name: REDIS_HOST
value: {{ template "redis.fullname" . }}
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: {{ template "redis.fullname" . }}
key: redis-password
- name: REDIS_DB
value: {{ .Values.REDIS_DB | quote }}
- name: REDIS_AUTO_RECONNECT
value: {{ .Values.REDIS_AUTO_RECONNECT | quote}}
- name: REDIS_RECONNECT_ON_ERROR
value: {{ .Values.REDIS_RECONNECT_ON_ERROR | quote }}
- name: REDIS_PORT
value: {{ .Values.REDIS_PORT | quote }}
ports:
- containerPort: 4567
readinessProbe:
httpGet:
path: /info
port: 4567
initialDelaySeconds: 30
timeoutSeconds: 1
livenessProbe:
httpGet:
path: /info
port: 4567
initialDelaySeconds: 30
timeoutSeconds: 1
+20
View File
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "fullname" . }}
labels:
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
{{ if .Values.deis.routable }}
router.deis.io/routable: "true"
annotations:
router.deis.io/domains: {{ .Values.deis.domains | quote }}
{{end}}
spec:
type: {{.Values.serviceType }}
ports:
- port: {{ .Values.httpPort }}
targetPort: 4567
selector:
app: {{ template "fullname" . }}
+46
View File
@@ -0,0 +1,46 @@
# Docker image name
image: "sstarcher/sensu"
# Docker image tag
imageTag: "0.26"
# Image pull policy for the container
pullPolicy: "IfNotPresent"
# How many sensu containers to spawn
replicaCount: 1
# How to publish the service http://kubernetes.io/docs/user-guide/services/#publishing-services---service-types
serviceType: ClusterIP
# Service port to expose Sensu on
httpPort: 4567
# If set to true, the service will be exposed via the Deis Router if setup https://github.com/deis/router
deis:
routable: false
domains: sensu
# CPU and Memory limit and request for Sensu Server
server:
resources:
requests:
cpu: 100m
memory: 100Mi
# CPU and Memory limit and request for Sensu Api
api:
resources:
requests:
cpu: 50m
memory: 100Mi
# Redis configuration
REDIS_PORT: 6379
REDIS_DB: 0
REDIS_AUTO_RECONNECT: true
REDIS_RECONNECT_ON_ERROR: true
# Redis chart configuration
redis:
persistence:
enabled: false