From c6a2c1bcf649e49607cf90905c014cf9e9976f88 Mon Sep 17 00:00:00 2001 From: Armand Leopold Date: Thu, 25 Mar 2021 12:28:04 +0100 Subject: [PATCH 1/3] add chart --- charts/doccano/Chart.yaml | 2 +- charts/doccano/README.md | 2 +- charts/doccano/templates/deployment.yaml | 2 +- charts/gitlabmonitor/.helmignore | 21 ++++ charts/gitlabmonitor/Chart.yaml | 22 ++++ charts/gitlabmonitor/LICENSE | 21 ++++ charts/gitlabmonitor/README.md | 105 ++++++++++++++++++ charts/gitlabmonitor/templates/NOTES.txt | 1 + charts/gitlabmonitor/templates/_helpers.tpl | 45 ++++++++ .../gitlabmonitor/templates/deployment.yaml | 38 +++++++ charts/gitlabmonitor/templates/ingress.yaml | 33 ++++++ charts/gitlabmonitor/templates/registry.yaml | 10 ++ charts/gitlabmonitor/templates/service.yaml | 14 +++ charts/gitlabmonitor/values.yaml | 73 ++++++++++++ 14 files changed, 386 insertions(+), 3 deletions(-) create mode 100644 charts/gitlabmonitor/.helmignore create mode 100644 charts/gitlabmonitor/Chart.yaml create mode 100644 charts/gitlabmonitor/LICENSE create mode 100644 charts/gitlabmonitor/README.md create mode 100644 charts/gitlabmonitor/templates/NOTES.txt create mode 100644 charts/gitlabmonitor/templates/_helpers.tpl create mode 100644 charts/gitlabmonitor/templates/deployment.yaml create mode 100644 charts/gitlabmonitor/templates/ingress.yaml create mode 100644 charts/gitlabmonitor/templates/registry.yaml create mode 100644 charts/gitlabmonitor/templates/service.yaml create mode 100644 charts/gitlabmonitor/values.yaml diff --git a/charts/doccano/Chart.yaml b/charts/doccano/Chart.yaml index b89bb24..c8cb45d 100644 --- a/charts/doccano/Chart.yaml +++ b/charts/doccano/Chart.yaml @@ -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 diff --git a/charts/doccano/README.md b/charts/doccano/README.md index adf0220..695e9f9 100644 --- a/charts/doccano/README.md +++ b/charts/doccano/README.md @@ -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']` | diff --git a/charts/doccano/templates/deployment.yaml b/charts/doccano/templates/deployment.yaml index da87596..5c790cb 100644 --- a/charts/doccano/templates/deployment.yaml +++ b/charts/doccano/templates/deployment.yaml @@ -46,7 +46,7 @@ spec: - mountPath: {{ .Values.persistence.mountPath }} name: {{ .Values.persistence.volumeName }} imagePullSecrets: - - name: {{ .Values.imagePullSecrets }} + - name: {{ .Values.image.imagePullSecrets }} initContainers: - args: - chown diff --git a/charts/gitlabmonitor/.helmignore b/charts/gitlabmonitor/.helmignore new file mode 100644 index 0000000..f0c1319 --- /dev/null +++ b/charts/gitlabmonitor/.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/charts/gitlabmonitor/Chart.yaml b/charts/gitlabmonitor/Chart.yaml new file mode 100644 index 0000000..2eb8dc4 --- /dev/null +++ b/charts/gitlabmonitor/Chart.yaml @@ -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: armand.leopold@curie.fr +kubeVersion: ">= 1.14.0-0" +keywords: + - dashboard + - devops + - gitlab + - git +annotations: + artifacthub.io/images: | + - name: gitlab-monitor + image: timoschwarzer/gitlab-monitor:latest diff --git a/charts/gitlabmonitor/LICENSE b/charts/gitlabmonitor/LICENSE new file mode 100644 index 0000000..66b4051 --- /dev/null +++ b/charts/gitlabmonitor/LICENSE @@ -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. diff --git a/charts/gitlabmonitor/README.md b/charts/gitlabmonitor/README.md new file mode 100644 index 0000000..9139ba6 --- /dev/null +++ b/charts/gitlabmonitor/README.md @@ -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` | diff --git a/charts/gitlabmonitor/templates/NOTES.txt b/charts/gitlabmonitor/templates/NOTES.txt new file mode 100644 index 0000000..0a7bdb4 --- /dev/null +++ b/charts/gitlabmonitor/templates/NOTES.txt @@ -0,0 +1 @@ +Gitlab Monitor installed ! diff --git a/charts/gitlabmonitor/templates/_helpers.tpl b/charts/gitlabmonitor/templates/_helpers.tpl new file mode 100644 index 0000000..ce5a17b --- /dev/null +++ b/charts/gitlabmonitor/templates/_helpers.tpl @@ -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 -}} diff --git a/charts/gitlabmonitor/templates/deployment.yaml b/charts/gitlabmonitor/templates/deployment.yaml new file mode 100644 index 0000000..c82738f --- /dev/null +++ b/charts/gitlabmonitor/templates/deployment.yaml @@ -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 }} diff --git a/charts/gitlabmonitor/templates/ingress.yaml b/charts/gitlabmonitor/templates/ingress.yaml new file mode 100644 index 0000000..94d1283 --- /dev/null +++ b/charts/gitlabmonitor/templates/ingress.yaml @@ -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 -}} diff --git a/charts/gitlabmonitor/templates/registry.yaml b/charts/gitlabmonitor/templates/registry.yaml new file mode 100644 index 0000000..c449bd1 --- /dev/null +++ b/charts/gitlabmonitor/templates/registry.yaml @@ -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 -}} diff --git a/charts/gitlabmonitor/templates/service.yaml b/charts/gitlabmonitor/templates/service.yaml new file mode 100644 index 0000000..914af53 --- /dev/null +++ b/charts/gitlabmonitor/templates/service.yaml @@ -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 }} diff --git a/charts/gitlabmonitor/values.yaml b/charts/gitlabmonitor/values.yaml new file mode 100644 index 0000000..62575f9 --- /dev/null +++ b/charts/gitlabmonitor/values.yaml @@ -0,0 +1,73 @@ +image: + replicaCount: 1 + pullPolicy: IfNotPresent + repository: timoschwarzer/gitlab-monitor + tag: "latest" + deployRegistry: false + imagePullSecrets: registrysecret + dataSecret: |- + {"auths":{"registry.company.com":{"password":"","username":""}}} + +service: + type: ClusterIP + targetPort: 80 + protocol: TCP + +resources: + limits: + cpu: 100m + memory: 128Mi + requests: + cpu: 100m + memory: 128Mi + +ingress: + enabled: true + hostnames: + - gitlabmonitor.company.com + tls: + - hosts: + - gitlabmonitor.company.com + secretName: gitlabmonitor + +config: | + { + "title": "Gitlabmonitor", + "pollingIntervalMultiplier": 1.0, + "gitlabApi": "https://gitlab.com/api/v4", + "privateToken": "", + "maxAge": 168, + "fetchCount": 101, + "pipelinesOnly": true, + "showRestartedJobs": false, + "showPipelineIds": false, + "showUsers": true, + "showJobs": "iconAndName", + "projectVisibility": "private", + "backgroundRefresh": false, + "showProjectOnlyOn": [ + "pending", + "running", + "failed", + "canceled", + "skipped", + "manual", + "success" ], + "filter": { + "include": ".*", + "includeTags": ".*", + "exclude": null, + "excludeTags": null + }, + "projectFilter": { + "*": { + "include": ".*", + "exclude": null, + "default": "master", + "showMerged": false, + "showTags": true, + "historyCount": 3, + "notifyFailureOn": null + } + } + } From 4539459561dcc17f2156aa89b6b7e80a70893dfd Mon Sep 17 00:00:00 2001 From: Armand Leopold Date: Thu, 25 Mar 2021 12:29:36 +0100 Subject: [PATCH 2/3] lint version number --- charts/gitlabmonitor/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/gitlabmonitor/Chart.yaml b/charts/gitlabmonitor/Chart.yaml index 2eb8dc4..27e4a9d 100644 --- a/charts/gitlabmonitor/Chart.yaml +++ b/charts/gitlabmonitor/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: gitlab-monitor description: A web-based monitor dashboard for GitLab CI -appVersion: 1.7 +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 From b3ad308ced4f5f94fed4831fdeb9a2c12d917e6f Mon Sep 17 00:00:00 2001 From: Armand Leopold Date: Thu, 25 Mar 2021 12:31:28 +0100 Subject: [PATCH 3/3] add name --- charts/gitlabmonitor/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/gitlabmonitor/values.yaml b/charts/gitlabmonitor/values.yaml index 62575f9..946ec3e 100644 --- a/charts/gitlabmonitor/values.yaml +++ b/charts/gitlabmonitor/values.yaml @@ -2,6 +2,7 @@ image: replicaCount: 1 pullPolicy: IfNotPresent repository: timoschwarzer/gitlab-monitor + name: gitlabmonitor tag: "latest" deployRegistry: false imagePullSecrets: registrysecret