diff --git a/stable/uchiwa/.helmignore b/stable/uchiwa/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/stable/uchiwa/.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 diff --git a/stable/uchiwa/Chart.yaml b/stable/uchiwa/Chart.yaml new file mode 100755 index 0000000000..c5e720b134 --- /dev/null +++ b/stable/uchiwa/Chart.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +name: uchiwa +version: 0.1.0 +description: Dashboard for the Sensu monitoring framework +keywords: +- uchiwa +- sensu +- monitoring +home: https://uchiwa.io/ +sources: +- https://github.com/kubernetes/charts +- https://github.com/sstarcher/docker-uchiwa +- https://github.com/sensu/uchiwa +maintainers: +- name: Shane Starcher + email: shane.starcher@gmail.com +icon: https://uchiwa.io/img/favicon.png +engine: gotpl \ No newline at end of file diff --git a/stable/uchiwa/README.md b/stable/uchiwa/README.md new file mode 100644 index 0000000000..74a5498cf7 --- /dev/null +++ b/stable/uchiwa/README.md @@ -0,0 +1,88 @@ +# Uchiwa + +[Uchiwa](https://uchiwa.io) is a simple yet effective open-source dashboard for the Sensu monitoring framework. + + +## TL;DR; + +```console +$ helm install stable/uchiwa +``` + +## Introduction + +This chart bootstraps a [Uchiwa](https://github.com/sstarcher/docker-uchiwa) 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/uchiwa +``` + +*Replace the `x.x.x` placeholder with the chart release version.* + +The command deploys Uchiwa 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 Uchiwa chart and their default values. + +| Parameter | Description | Default | +| ------------------------------- | ------------------------------- | ---------------------------------------------------------- | +| `image` | Uchiwa image | `sstarcher/uchiwa` | +| `imageTag` | Uchiwa version | `0.19` | +| `imagePullPolicy` | Image pull policy | `IfNotPresent` | +| `replicaCount` | Number of uchiwa replicas | `1` | +| `httpPort` | Service port for kubernetes | `80` | +| `routable` | Enables routing through the Deis router | `false` | +| `resources.requests.cpu` | CPU request for uchiwa | `10m` | +| `resources.requests.memory` | Memory request for uchiwa | `50Mi` | +| `resources.limits.cpu` | CPU limit for uchiwa | `` | +| `resources.limits.memory` | Memory limit for uchiwa | `50Mi` | +| `config` | Configuration to pass to Uchiwa | `json defined in values.yaml` | + +Detailed documentaion for the `config` json can be found at [Uchiwa/Docs](https://docs.uchiwa.io/getting-started/configuration/) + +```console +$ helm install --name my-release \ + --set imageTag=0.18.2 \ + stable/uchiwa +``` + +The above command sets the Uchiwa version to `0.18.2`. + +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/uchiwa +``` + +> **Tip**: You can use the default [values.yaml](values.yaml) diff --git a/stable/uchiwa/templates/NOTES.txt b/stable/uchiwa/templates/NOTES.txt new file mode 100644 index 0000000000..c19a397a43 --- /dev/null +++ b/stable/uchiwa/templates/NOTES.txt @@ -0,0 +1,19 @@ +Getting Started: + + +1. Get the Uchiwa 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 }} + 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:3000 + kubectl port-forward $POD_NAME 3000:3000 +{{- end }} diff --git a/stable/uchiwa/templates/_helpers.tpl b/stable/uchiwa/templates/_helpers.tpl new file mode 100644 index 0000000000..da95264bcc --- /dev/null +++ b/stable/uchiwa/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 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 -}} \ No newline at end of file diff --git a/stable/uchiwa/templates/configmap.yaml b/stable/uchiwa/templates/configmap.yaml new file mode 100644 index 0000000000..0dddd724ee --- /dev/null +++ b/stable/uchiwa/templates/configmap.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "fullname" . }} + labels: + release: {{ .Release.Name | quote }} + app: {{ template "fullname" . }} + heritage: {{ .Release.Service | quote }} +data: + config.json.tmpl: '{{ .Values.config }}' diff --git a/stable/uchiwa/templates/deployment.yaml b/stable/uchiwa/templates/deployment.yaml new file mode 100644 index 0000000000..eafca16f82 --- /dev/null +++ b/stable/uchiwa/templates/deployment.yaml @@ -0,0 +1,41 @@ +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: uchiwa + image: "{{ .Values.image }}:{{ .Values.imageTag }}" + imagePullPolicy: {{ .Values.pullPolicy }} +{{ toYaml .Values.resources | indent 8 }} + livenessProbe: + httpGet: + path: / + port: 3000 + readinessProbe: + httpGet: + path: / + port: 3000 + ports: + - containerPort: 3000 + volumeMounts: + - name: config + mountPath: /config/ + volumes: + - name: config + configMap: + name: {{ template "fullname" . }} + items: + - path: config.json.tmpl + key: config.json.tmpl diff --git a/stable/uchiwa/templates/svc.yaml b/stable/uchiwa/templates/svc.yaml new file mode 100644 index 0000000000..ca8b1610ab --- /dev/null +++ b/stable/uchiwa/templates/svc.yaml @@ -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: 3000 + selector: + app: {{ template "fullname" . }} \ No newline at end of file diff --git a/stable/uchiwa/values.yaml b/stable/uchiwa/values.yaml new file mode 100644 index 0000000000..7c2fbec7e5 --- /dev/null +++ b/stable/uchiwa/values.yaml @@ -0,0 +1,47 @@ +# Docker image name +image: "sstarcher/uchiwa" +# Docker image tag +imageTag: "0.19" + +# Image pull policy for the container +pullPolicy: "IfNotPresent" + +# How many uchiwa 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 Uchiwa on +httpPort: 80 + +# If set to true, the service will be exposed via the Deis Router if setup https://github.com/deis/router +deis: + routable: false + domains: uchiwa + +# CPU and Memory limit and request for Uchiwa +resources: + limits: + memory: 50Mi + requests: + memory: 50Mi + cpu: 10m + +# Uchiwa configuration https://docs.uchiwa.io/getting-started/configuration/ +config: |- + { + "sensu": [ + { + "name": "Sensu", + "host": "sensu", + "port": 4567 + } + ], + "uchiwa": { + "host": "0.0.0.0", + "port": 3000, + "refresh": 10, + "loglevel": "info" + } + }