Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add helm chart #328

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/chart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release Chart

on:
push:
branches:
- master
paths:
- charts/process-exporter/Chart.yaml

workflow_dispatch:

jobs:
release:
name: Release
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Configure Git
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"

- name: Set up Helm
uses: azure/[email protected]

- name: Release chart
uses: helm/[email protected]
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CR_RELEASE_NAME_TEMPLATE: helm-chart-{{ .Version }}
21 changes: 21 additions & 0 deletions charts/process-exporter/.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
9 changes: 9 additions & 0 deletions charts/process-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: v2
name: process-exporter
description: Process-exporter is an agent which ships several information about each processes running on the operating system
type: application
appVersion: 0.8.4
version: 1.0.0
home: https://github.com/ncabatoff/process-exporter
sources:
- https://github.com/ncabatoff/process-exporter
115 changes: 115 additions & 0 deletions charts/process-exporter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# process-exporter

[process-exporter](https://github.com/ncabatoff/process-exporter) is an agent which ships several information about each processes running on the operating system

![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.8.4](https://img.shields.io/badge/AppVersion-0.8.4-informational?style=flat-square)

## Get Repo Info

```console
helm repo add process-exporter https://ncabatoff.github.io/process-exporter
helm repo update
```

## Install Chart

**Important:** only helm3 is supported

```console
helm install [RELEASE_NAME] process-exporter/process-exporter
```

The command deploys process-exporter on the Kubernetes cluster in the default configuration.

_See [configuration](#configuration) below._

_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._

## Uninstall Chart

```console
helm uninstall [RELEASE_NAME]
```

This removes all the Kubernetes components associated with the chart and deletes the release.

_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._

## Upgrading Chart

```console
helm upgrade [RELEASE_NAME] [CHART] --install
```

_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| commonLabels | object | `{}` | |
| configmap.configFile.process_names[0].cmdline[0] | string | `".+"` | |
| configmap.configFile.process_names[0].name | string | `"{{.Comm}}"` | |
| configmap.enabled | bool | `true` | |
| configmap.mountPath | string | `"/config"` | |
| configmap.name | string | `""` | |
| containerSecurityContext.readOnlyRootFilesystem | bool | `true` | |
| daemonsetAnnotations | object | `{}` | |
| dnsConfig | object | `{}` | |
| env | object | `{}` | |
| extraArgs | list | `[]` | |
| extraVolumeMounts | list | `[]` | |
| extraVolumes | list | `[]` | |
| fullnameOverride | string | `""` | |
| hostIPC | bool | `false` | |
| hostNetwork | bool | `false` | |
| hostPID | bool | `true` | |
| hostProcFsMount.mountPropagation | string | `""` | |
| image.digest | string | `""` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.repository | string | `"ncabatoff/process-exporter"` | |
| image.tag | string | `""` | |
| imagePullSecrets | list | `[]` | |
| livenessProbe.failureThreshold | int | `3` | |
| livenessProbe.httpGet.httpHeaders | list | `[]` | |
| livenessProbe.httpGet.path | string | `"/"` | |
| livenessProbe.httpGet.port | int | `9256` | |
| livenessProbe.httpGet.scheme | string | `"HTTP"` | |
| livenessProbe.initialDelaySeconds | int | `0` | |
| livenessProbe.periodSeconds | int | `10` | |
| livenessProbe.successThreshold | int | `1` | |
| livenessProbe.timeoutSeconds | int | `1` | |
| nameOverride | string | `""` | |
| namespaceOverride | string | `""` | |
| nodeSelector."kubernetes.io/os" | string | `"linux"` | |
| podAnnotations."cluster-autoscaler.kubernetes.io/safe-to-evict" | string | `"true"` | |
| podLabels | object | `{}` | |
| port.name | string | `"http"` | |
| port.number | int | `9256` | |
| readinessProbe.failureThreshold | int | `3` | |
| readinessProbe.httpGet.httpHeaders | list | `[]` | |
| readinessProbe.httpGet.path | string | `"/"` | |
| readinessProbe.httpGet.port | int | `9256` | |
| readinessProbe.httpGet.scheme | string | `"HTTP"` | |
| readinessProbe.initialDelaySeconds | int | `0` | |
| readinessProbe.periodSeconds | int | `10` | |
| readinessProbe.successThreshold | int | `1` | |
| readinessProbe.timeoutSeconds | int | `1` | |
| resources | object | `{}` | |
| restartPolicy | string | `nil` | |
| revisionHistoryLimit | int | `10` | |
| securityContext.fsGroup | int | `65534` | |
| securityContext.runAsGroup | int | `65534` | |
| securityContext.runAsNonRoot | bool | `true` | |
| securityContext.runAsUser | int | `65534` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.automountServiceAccountToken | bool | `false` | |
| serviceAccount.create | bool | `true` | |
| serviceAccount.imagePullSecrets | list | `[]` | |
| serviceAccount.name | string | `nil` | |
| terminationGracePeriodSeconds | string | `nil` | |
| tolerations[0].effect | string | `"NoSchedule"` | |
| tolerations[0].operator | string | `"Exists"` | |
| updateStrategy.rollingUpdate.maxUnavailable | int | `1` | |
| updateStrategy.type | string | `"RollingUpdate"` | |
47 changes: 47 additions & 0 deletions charts/process-exporter/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{{ template "chart.header" . }}
[process-exporter](https://github.com/ncabatoff/process-exporter) is an agent which ships several information about each processes running on the operating system

{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}

{{ template "chart.requirementsSection" . }}

## Get Repo Info

```console
helm repo add process-exporter https://ncabatoff.github.io/process-exporter
helm repo update
```

## Install Chart

**Important:** only helm3 is supported

```console
helm install [RELEASE_NAME] process-exporter/process-exporter
```

The command deploys process-exporter on the Kubernetes cluster in the default configuration.

_See [configuration](#configuration) below._

_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._

## Uninstall Chart

```console
helm uninstall [RELEASE_NAME]
```

This removes all the Kubernetes components associated with the chart and deletes the release.

_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._

## Upgrading Chart

```console
helm upgrade [RELEASE_NAME] [CHART] --install
```

_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._

{{ template "chart.valuesSection" . }}
Empty file.
106 changes: 106 additions & 0 deletions charts/process-exporter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "process-exporter.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 "process-exporter.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 "process-exporter.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "process-exporter.labels" -}}
helm.sh/chart: {{ include "process-exporter.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: metrics
app.kubernetes.io/part-of: {{ include "process-exporter.name" . }}
{{ include "process-exporter.selectorLabels" . }}
{{- with .Chart.AppVersion }}
app.kubernetes.io/version: {{ . | quote }}
{{- end }}
{{- with .Values.commonLabels }}
{{ tpl (toYaml .) $ }}
{{- end }}
{{- if .Values.releaseLabel }}
release: {{ .Release.Name }}
{{- end }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "process-exporter.selectorLabels" -}}
app.kubernetes.io/name: {{ include "process-exporter.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the configmap to use
*/}}
{{- define "process-exporter.configmapName" -}}
{{- if .Values.configmap.name }}
{{- .Values.configmap.name }}
{{- else }}
{{- (include "process-exporter.fullname" .) }}-config
{{- end }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "process-exporter.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "process-exporter.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
The image to use
*/}}
{{- define "process-exporter.image" -}}
{{- if .Values.image.sha }}
{{- fail "image.sha forbidden. Use image.digest instead" }}
{{- else if .Values.image.digest }}
{{- printf "%s:%s@%s" .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) .Values.image.digest }}
{{- else }}
{{- printf "%s:%s" .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) }}
{{- end }}
{{- end }}

{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
*/}}
{{- define "process-exporter.namespace" -}}
{{- if .Values.namespaceOverride }}
{{- .Values.namespaceOverride }}
{{- else }}
{{- .Release.Namespace }}
{{- end }}
{{- end }}
16 changes: 16 additions & 0 deletions charts/process-exporter/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.configmap.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "process-exporter.configmapName" . }}
namespace: {{ include "process-exporter.namespace" . }}
labels:
{{- include "process-exporter.labels" . | nindent 4 }}
{{- with .Values.configmap.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
data:
process_exporter.yml: |
{{- toYaml .Values.configmap.configFile | nindent 4 }}
{{- end }}
Loading