From e3ddeed9d1dfc5a3d9fb3538a7c2e2199aea6975 Mon Sep 17 00:00:00 2001 From: Kurt Bendlin Date: Sat, 24 Jul 2021 23:36:05 +0200 Subject: [PATCH] initial chart for statping (some bugs) --- charts/statping/.gitignore | 1 + charts/statping/.helmignore | 21 ++++++++++ charts/statping/Chart.yaml | 12 ++++++ charts/statping/README.md | 37 +++++++++++++++++ charts/statping/README.md.gotmpl | 29 ++++++++++++++ charts/statping/templates/NOTES.txt | 0 charts/statping/templates/_helpers.tpl | 32 +++++++++++++++ charts/statping/templates/deployment.yaml | 38 ++++++++++++++++++ charts/statping/templates/ingress.yaml | 49 +++++++++++++++++++++++ charts/statping/templates/service.yaml | 18 +++++++++ charts/statping/values.yaml | 35 ++++++++++++++++ 11 files changed, 272 insertions(+) create mode 100644 charts/statping/.gitignore create mode 100755 charts/statping/.helmignore create mode 100755 charts/statping/Chart.yaml create mode 100644 charts/statping/README.md create mode 100644 charts/statping/README.md.gotmpl create mode 100755 charts/statping/templates/NOTES.txt create mode 100755 charts/statping/templates/_helpers.tpl create mode 100755 charts/statping/templates/deployment.yaml create mode 100755 charts/statping/templates/ingress.yaml create mode 100755 charts/statping/templates/service.yaml create mode 100755 charts/statping/values.yaml diff --git a/charts/statping/.gitignore b/charts/statping/.gitignore new file mode 100644 index 0000000..14d0c73 --- /dev/null +++ b/charts/statping/.gitignore @@ -0,0 +1 @@ +charts/.* \ No newline at end of file diff --git a/charts/statping/.helmignore b/charts/statping/.helmignore new file mode 100755 index 0000000..f0c1319 --- /dev/null +++ b/charts/statping/.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/statping/Chart.yaml b/charts/statping/Chart.yaml new file mode 100755 index 0000000..2269040 --- /dev/null +++ b/charts/statping/Chart.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +name: statping +icon: https://camo.githubusercontent.com/adc90af589fd69235a49fc1e71eb55d6a9a9890c786ebcd578d1ac04fe8a884f/68747470733a2f2f73332d75732d776573742d322e616d617a6f6e6177732e636f6d2f676974696d67732f7374617470696e672e706e67 +version: 0.0.1 +appVersion: "v.0.90.74" +description: A chart containing statping +home: https://github.com/statping/statping +sources: + - https://github.com/statping/statping +maintainers: + - name: kurt108 +deprecated: false diff --git a/charts/statping/README.md b/charts/statping/README.md new file mode 100644 index 0000000..a250c67 --- /dev/null +++ b/charts/statping/README.md @@ -0,0 +1,37 @@ +[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kurt108)](https://artifacthub.io/packages/search?repo=kurt108) + +# statping + +A chart containing statping + +0.0.1 + +Installing the Chart + +```console +$ helm repo add kurt108 https://kurt108.github.io/helm-charts +"kurt108" has been added to your repositories +$ helm repo update +Hang tight while we grab the latest from your chart repositories... +...Successfully got an update from the "kurt108" chart repository +... +Update Complete. ⎈ Happy Helming!⎈ +$ helm install my-release kurt108/statping +NAME: my-release +... +``` + +## Values + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| image.pullPolicy | string | `"IfNotPresent"` | | +| image.repository | string | `"statping/statping"` | | +| image.tag | string | `"v0.90.74"` | | +| ingress.annotations | object | `{}` | | +| ingress.hosts[0] | string | `"statping.domain"` | | +| ingress.path | string | `"/"` | | +| replicaCount | int | `1` | | +| resources | object | `{}` | | +| service.name | string | `"statping"` | | +| service.type | string | `"ClusterIP"` | | \ No newline at end of file diff --git a/charts/statping/README.md.gotmpl b/charts/statping/README.md.gotmpl new file mode 100644 index 0000000..bd635e2 --- /dev/null +++ b/charts/statping/README.md.gotmpl @@ -0,0 +1,29 @@ +[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kurt108)](https://artifacthub.io/packages/search?repo=kurt108) + + +{{ template "chart.header" . }} +{{ template "chart.description" . }} + + +{{ template "chart.version" . }} + + + +Installing the Chart + +```console +$ helm repo add kurt108 https://kurt108.github.io/helm-charts +"kurt108" has been added to your repositories +$ helm repo update +Hang tight while we grab the latest from your chart repositories... +...Successfully got an update from the "kurt108" chart repository +... +Update Complete. ⎈ Happy Helming!⎈ +$ helm install my-release kurt108/statping +NAME: my-release +... +``` + +{{ template "chart.requirementsSection" . }} + +{{- template "chart.valuesSection" . -}} diff --git a/charts/statping/templates/NOTES.txt b/charts/statping/templates/NOTES.txt new file mode 100755 index 0000000..e69de29 diff --git a/charts/statping/templates/_helpers.tpl b/charts/statping/templates/_helpers.tpl new file mode 100755 index 0000000..10d7bd1 --- /dev/null +++ b/charts/statping/templates/_helpers.tpl @@ -0,0 +1,32 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "statping.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} +{{- 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 "statping.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 "statping.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} + diff --git a/charts/statping/templates/deployment.yaml b/charts/statping/templates/deployment.yaml new file mode 100755 index 0000000..eb24df9 --- /dev/null +++ b/charts/statping/templates/deployment.yaml @@ -0,0 +1,38 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ template "statping.fullname" . }} + labels: + chart: {{ template "statping.name" . }} + app: {{ template "statping.name" . }} + chart: {{ template "statping.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.replicaCount }} + selector: + matchLabels: + app: {{ template "statping.name" . }} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ template "statping.name" . }} + release: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: http + containerPort: 8080 + env: +{{- range $name, $value := .Values.env.open }} +{{- if not (empty $value) }} + - name: {{ $name | quote }} + value: {{ $value | quote }} +{{- end }} +{{- end }} + resources: +{{ toYaml .Values.resources | indent 12 }} diff --git a/charts/statping/templates/ingress.yaml b/charts/statping/templates/ingress.yaml new file mode 100755 index 0000000..608a476 --- /dev/null +++ b/charts/statping/templates/ingress.yaml @@ -0,0 +1,49 @@ +{{- $fullName := include "statping.fullname" . -}} +{{- $servicePath := .Values.ingress.path -}} +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} +apiVersion: networking.k8s.io/v1 +{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress" }} +apiVersion: networking.k8s.io/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + {{- if .Values.ingress.annotations }} + annotations: +{{ toYaml .Values.ingress.annotations | indent 4 }} +{{- end }} + labels: + app: {{ template "statping.name" . }} + chart: {{ template "statping.chart" . }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} +{{- if .labels }} +{{ toYaml .labels | indent 4 }} +{{- end }} +spec: + rules: +{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1/Ingress" }} + {{- range $host := .Values.ingress.hosts }} + - host: {{ $host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ $fullName }} + port: + number: 8080 +{{- end }} +{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1/Ingress" }} + {{- range $host := .Values.ingress.hosts }} + - host: {{ $host }} + http: + paths: + - path: / + backend: + serviceName: {{ $fullName }} + servicePort: 8080 +{{- end }} +{{- end }} + diff --git a/charts/statping/templates/service.yaml b/charts/statping/templates/service.yaml new file mode 100755 index 0000000..13f86f5 --- /dev/null +++ b/charts/statping/templates/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ template "statping.fullname" . }} + labels: + app: {{ template "statping.name" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + type: {{ .Values.service.type }} + ports: + - port: 8080 + targetPort: 8080 + protocol: TCP + name: {{ .Values.service.name }} + selector: + app: {{ template "statping.name" . }} + release: {{ .Release.Name }} \ No newline at end of file diff --git a/charts/statping/values.yaml b/charts/statping/values.yaml new file mode 100755 index 0000000..3e6bd43 --- /dev/null +++ b/charts/statping/values.yaml @@ -0,0 +1,35 @@ +replicaCount: 1 + +env: + open: + VIRTUAL_HOST: localhost + VIRTUAL_PORT: 8080 + DB_HOST: postgres + DB_USER: statup + DB_PASS: password123 + DB_DATABASE: statup + NAME: STATPING + DESCRIPTION: This is a Statping instance + +ingress: + enabled: true + hosts: + - "statping.domain" + # Use this if you are using Traefik as your ingress-router + # path: "/scale" + # Use this if you are using nginx as your ingress-router + path: "/" + annotations: {} + +image: + repository: statping/statping + tag: v0.90.74 + pullPolicy: IfNotPresent + +service: + name: statping + type: ClusterIP + + +resources: {} +