Skip to content

Commit

Permalink
Merge pull request #4 from curie-data-factory/gitlabmonitor
Browse files Browse the repository at this point in the history
add chart
  • Loading branch information
armandleopold committed Mar 25, 2021
2 parents 30e4a81 + b3ad308 commit 3ef6592
Show file tree
Hide file tree
Showing 14 changed files with 387 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/doccano/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: doccano
appVersion: 1.2.2
version: 1.3.0
version: 1.3.1
description: A Helm chart for doccano, Open source text annotation tool for machine learning practitioner.
home: https://doccano.herokuapp.com/
icon: https://raw.githubusercontent.com/doccano/doccano/master/docs/images/logo/doccano.png
Expand Down
2 changes: 1 addition & 1 deletion charts/doccano/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The following table lists the configurable parameters of the chart and their def
| `deploySecret` | Wether or not to deploy the secret containing Doccano ADMIN_PASSWORD | `true` |
| `ADMIN_PASSWORD` | Doccano Admin Password | `password` |
| `service.type` | Service Type | `ClusterIP` |
| `service.targetPort` | Service Port | `80` |
| `service.targetPort` | Service Port | `8000` |
| `service.protocol` | Service Protocol | `TCP` |
| `ingress.enabled` | Expose application with ingress | `true` |
| `ingress.hostnames` | Urls of exposed application | `['doccano.company.com']` |
Expand Down
2 changes: 1 addition & 1 deletion charts/doccano/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ spec:
- mountPath: {{ .Values.persistence.mountPath }}
name: {{ .Values.persistence.volumeName }}
imagePullSecrets:
- name: {{ .Values.imagePullSecrets }}
- name: {{ .Values.image.imagePullSecrets }}
initContainers:
- args:
- chown
Expand Down
21 changes: 21 additions & 0 deletions charts/gitlabmonitor/.helmignore
Original file line number Diff line number Diff line change
@@ -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
22 changes: 22 additions & 0 deletions charts/gitlabmonitor/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v2
name: gitlab-monitor
description: A web-based monitor dashboard for GitLab CI
appVersion: "1.7"
version: 1.2.5
home: https://github.com/timoschwarzer/gitlab-monitor
icon: https://github.com/timoschwarzer/gitlab-monitor/blob/main/logo.svg
sources:
- https://github.com/timoschwarzer/gitlab-monitor
maintainers:
- name: armandleopold
email: [email protected]
kubeVersion: ">= 1.14.0-0"
keywords:
- dashboard
- devops
- gitlab
- git
annotations:
artifacthub.io/images: |
- name: gitlab-monitor
image: timoschwarzer/gitlab-monitor:latest
21 changes: 21 additions & 0 deletions charts/gitlabmonitor/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021 Institut Curie

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.
105 changes: 105 additions & 0 deletions charts/gitlabmonitor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Gitlab Monitor

A web-based monitor dashboard for GitLab CI

To get more informations :

* [Github Source Code](https://github.com/timoschwarzer/gitlab-monitor)
* [Dockerhub Docker Image](https://hub.docker.com/r/timoschwarzer/gitlab-monitor)

## Prerequisites

1. Have a running [Kubernetes](https://kubernetes.io/docs/setup/) environment
2. Setup [Helm](https://github.com/kubernetes/helm)

## Installing the Chart

Before you can install the chart you will need to add the `curiedfcharts` repo to [Helm](https://helm.sh/).

```shell
helm repo add curiedfcharts https://curie-data-factory.github.io/helm-charts
helm repo update
```

After you've installed the repo you can install the chart.

```shell
helm upgrade --install --namespace default --values ./my-values.yaml my-release curiedfcharts/gitlab-monitor
```

## Configuration

The following table lists the configurable parameters of the chart and their default values.

`config` :

```yaml
config: |
{
"gitlabApi": "https://gitlab.example.com/api/v4",
"privateToken": "ABCDEF123456",
"maxAge": 168,
"fetchCount": 20,
"pipelinesOnly": false,
"autoZoom": false,
"showPipelineIds": true,
"showJobs": "iconAndName",
"showDurations": true,
"showUsers": false,
"projectVisibility": "any",
"linkToFailureSound": null ,
"title": null,
"pollingIntervalMultiplier": 10,
"filter": {
"include": ".*",
"includeTags": ".*",
"exclude": null,
"excludeTags": null
},
"projectFilter": {
"*": {
"include": ".*",
"exclude": null,
"default": null,
"showMerged": false,
"showTags": true,
"maxPipelines": 10,
"notifyFailureOn": null
}
}
}
```
`resources` :

```yaml
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
```


| Parameter | Description | Default |
|----------------------------------|--------------------------------------------------|---------------------------------------------------------------------|
| `image.replicaCount` | Number of replicas to create | `1` |
| `image.repository` | Image repository. | `timoschwarzer/gitlab-monitor` |
| `image.tag` | Image Tag. | `latest` |
| `image.pullPolicy` | Image pull policy. | `IfNotPresent` |
| `image.name` | Image name | `gitlabmonitor` |
| `image.deployRegistry` | If the image is stored in a private registry | `false` |
| `image.imagePullSecrets` | Docker registry credentials Secret name | `registrysecret` |
| `image.dataSecret` | Secret storing docker image registry credentials | `{"auths":{"registry.compagny.com":{"password":"","username":""}}}` |
| `service.type` | Service Type | `ClusterIP` |
| `service.targetPort` | Service Port | `80` |
| `service.protocol` | Service Protocol | `TCP` |
| `ingress.enabled` | Expose application with ingress | `true` |
| `ingress.hostnames` | Urls of exposed application | `['gitlabmonitor.company.com']` |
| `ingress.tls` | Array of TLS Hosts | `[]` |
| `ingress.tls[hosts]` | Host name | `['gitlabmonitor.company.com']` |
| `ingress.tls[hosts[secretName]]` | Secret for the current host name | `gitlabmonitor` |
| `resources` | Resources requirements & limits | `See values.yaml` |
| `config` | Config values for Gitlab Monitor | `See values.yaml` |
1 change: 1 addition & 0 deletions charts/gitlabmonitor/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Gitlab Monitor installed !
45 changes: 45 additions & 0 deletions charts/gitlabmonitor/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "gitlabmonitor.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).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "gitlabmonitor.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "gitlabmonitor.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Common labels
*/}}
{{- define "gitlabmonitor.labels" -}}
app.kubernetes.io/name: {{ include "gitlabmonitor.name" . }}
helm.sh/chart: {{ include "gitlabmonitor.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
38 changes: 38 additions & 0 deletions charts/gitlabmonitor/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ .Release.Name }}-{{ .Values.image.name }}"
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{ include "gitlabmonitor.labels" . | indent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: "{{ .Release.Name }}-{{ .Values.image.name }}"
release: {{ .Release.Name }}
template:
metadata:
labels:
app: "{{ .Release.Name }}-{{ .Values.image.name }}"
release: {{ .Release.Name }}
annotations:
rollme: {{ randAlphaNum 5 | quote }}
spec:
containers:
- name: {{ .Values.image.name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env:
- name: GITLAB_MONITOR_CONFIG
value: | {{ .Values.config | trim | nindent 12 }}
ports:
- containerPort: {{ .Values.service.targetPort }}
name: {{ .Values.service.targetPort }}{{ .Values.service.protocol | lower }}
protocol: {{ .Values.service.protocol }}
resources:
{{ toYaml .Values.resources | indent 12 }}
imagePullSecrets:
- name: {{ .Values.image.imagePullSecrets }}
33 changes: 33 additions & 0 deletions charts/gitlabmonitor/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{{- if .Values.ingress.enabled -}}
{{- $serviceName := print .Release.Name "-" .Values.image.name "-" .Values.service.type | lower -}}
{{- $servicePort := print .Values.service.targetPort .Values.service.protocol | lower -}}

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: {{ .Values.image.name }}
labels:
app: {{ .Values.image.name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
{{- if .Values.ingress.annotations }}
annotations:
{{ toYaml .Values.ingress.annotations | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end }}
rules:
{{- range .Values.ingress.hostnames }}
- host: "{{ . }}"
http:
paths:
- path: /
backend:
serviceName: {{ $serviceName }}
servicePort: {{ $servicePort }}
{{- end }}
{{- end -}}
10 changes: 10 additions & 0 deletions charts/gitlabmonitor/templates/registry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if .Values.image.deployRegistry -}}
apiVersion: v1
kind: Secret
type: kubernetes.io/dockerconfigjson
metadata:
name: {{ .Values.image.imagePullSecrets }}
namespace: {{ .Release.Namespace }}
data:
.dockerconfigjson: {{ .Values.image.dataSecret | b64enc }}
{{- end -}}
14 changes: 14 additions & 0 deletions charts/gitlabmonitor/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: "{{ .Release.Name }}-{{ .Values.image.name }}"
spec:
type: {{ .Values.service.type }}
ports:
- name: "http"
port: {{ .Values.service.targetPort }}
protocol: {{ .Values.service.protocol }}
targetPort: {{ .Values.service.targetPort }}
selector:
app: "{{ .Release.Name }}-{{ .Values.image.name }}"
release: {{ .Release.Name }}
Loading

0 comments on commit 3ef6592

Please sign in to comment.