From 777f4711d4a7c7c8afef16e3549cba6259e71bf4 Mon Sep 17 00:00:00 2001 From: Nicolas Ochem Date: Thu, 20 Jan 2022 14:03:57 -0800 Subject: [PATCH] Pyrometer (#351) * add basic (working) pyrometer chart * add yaml config * change port to 80 * service nodeport * add README * add helmignore * bounce pod when configmap changes (fix teztnets dailynet deployment) --- charts/pyrometer/.helmignore | 23 ++++++++++++++ charts/pyrometer/Chart.yaml | 7 +++++ charts/pyrometer/README.md | 3 ++ charts/pyrometer/templates/configmap.yaml | 8 +++++ charts/pyrometer/templates/deployment.yaml | 36 ++++++++++++++++++++++ charts/pyrometer/templates/service.yaml | 14 +++++++++ charts/pyrometer/values.yaml | 4 +++ 7 files changed, 95 insertions(+) create mode 100644 charts/pyrometer/.helmignore create mode 100644 charts/pyrometer/Chart.yaml create mode 100644 charts/pyrometer/README.md create mode 100644 charts/pyrometer/templates/configmap.yaml create mode 100644 charts/pyrometer/templates/deployment.yaml create mode 100644 charts/pyrometer/templates/service.yaml create mode 100644 charts/pyrometer/values.yaml diff --git a/charts/pyrometer/.helmignore b/charts/pyrometer/.helmignore new file mode 100644 index 000000000..0e8a0eb36 --- /dev/null +++ b/charts/pyrometer/.helmignore @@ -0,0 +1,23 @@ +# 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 +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/charts/pyrometer/Chart.yaml b/charts/pyrometer/Chart.yaml new file mode 100644 index 000000000..a3e48c143 --- /dev/null +++ b/charts/pyrometer/Chart.yaml @@ -0,0 +1,7 @@ +apiVersion: v2 +name: pyrometer +description: Deploys pyrometer Tezos monitoring solution + +type: application +version: 0.1.0 +appVersion: "1.16.0" diff --git a/charts/pyrometer/README.md b/charts/pyrometer/README.md new file mode 100644 index 000000000..80c51fed4 --- /dev/null +++ b/charts/pyrometer/README.md @@ -0,0 +1,3 @@ +## Pyrometer chart + +A chart to deploy the [pyrometer](https://gitlab.com/tezos-kiln/pyrometer) Tezos monitoring tool. diff --git a/charts/pyrometer/templates/configmap.yaml b/charts/pyrometer/templates/configmap.yaml new file mode 100644 index 000000000..fbe281348 --- /dev/null +++ b/charts/pyrometer/templates/configmap.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +data: + config.json: | +{{ .Values.config | mustToPrettyJson | indent 4 }} +kind: ConfigMap +metadata: + name: pyrometer-config + namespace: {{ .Release.Namespace }} diff --git a/charts/pyrometer/templates/deployment.yaml b/charts/pyrometer/templates/deployment.yaml new file mode 100644 index 000000000..6b133078d --- /dev/null +++ b/charts/pyrometer/templates/deployment.yaml @@ -0,0 +1,36 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: pyrometer + namespace: {{ .Release.Namespace }} +spec: + selector: + matchLabels: + app: pyrometer + template: + metadata: + labels: + app: pyrometer + annotations: + # ensure that the pod bounces each time configmap changes + # https://helm.sh/docs/howto/charts_tips_and_tricks/#automatically-roll-deployments + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} + spec: + containers: + - name: pyrometer + image: {{ .Values.images.pyrometer }} + args: + - run + - -c + - '/config/config.json' + ports: + - name: http + containerPort: 80 + protocol: TCP + volumeMounts: + - name: config-volume + mountPath: /config/ + volumes: + - name: config-volume + configMap: + name: pyrometer-config diff --git a/charts/pyrometer/templates/service.yaml b/charts/pyrometer/templates/service.yaml new file mode 100644 index 000000000..25c40ada4 --- /dev/null +++ b/charts/pyrometer/templates/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: pyrometer + namespace: {{ .Release.Namespace }} +spec: + type: NodePort + ports: + - port: 80 + targetPort: http + protocol: TCP + name: http + selector: + app: pyrometer diff --git a/charts/pyrometer/values.yaml b/charts/pyrometer/values.yaml new file mode 100644 index 000000000..b4a474d99 --- /dev/null +++ b/charts/pyrometer/values.yaml @@ -0,0 +1,4 @@ +# Pass below the pyrometer config, in yaml format (will be converted to toml) +config: {} +images: + pyrometer: registry.gitlab.com/tezos-kiln/pyrometer:latest