mirror of
https://github.com/nikdoof/helm-charts.git
synced 2025-12-14 05:52:17 +00:00
[vsphere-go-influxdb] New chart
This commit is contained in:
56
charts/vsphere-influxdb-go/templates/_helpers.tpl
Normal file
56
charts/vsphere-influxdb-go/templates/_helpers.tpl
Normal file
@@ -0,0 +1,56 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "vsphere-influxdb-go.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 "vsphere-influxdb-go.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 "vsphere-influxdb-go.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "vsphere-influxdb-go.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "vsphere-influxdb-go.name" . }}
|
||||
helm.sh/chart: {{ include "vsphere-influxdb-go.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 -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "vsphere-influxdb-go.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "vsphere-influxdb-go.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
86
charts/vsphere-influxdb-go/templates/configmap.yaml
Normal file
86
charts/vsphere-influxdb-go/templates/configmap.yaml
Normal file
@@ -0,0 +1,86 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
config.json: "{\r\n \"Domain\": \".lab\",\r\n \"RemoveHostDomainName\": false,\r\n
|
||||
\ \"Interval\": 60,\r\n \"VCenters\": [],\r\n \"InfluxDB\": {\r\n \"Prefix\":
|
||||
\"vsphere_\",\r\n \"Hostname\": \"http://influxdb:8086\",\r\n \"Database\":
|
||||
\"vmware_performance\"\r\n },\r\n \"Metrics\": [\r\n {\r\n \"ObjectType\":
|
||||
[\r\n \"VirtualMachine\",\r\n \"HostSystem\"\r\n
|
||||
\ ],\r\n \"Definition\": [\r\n {\r\n \"Metric\":
|
||||
\"cpu.usage.average\",\r\n \"Instances\": \"*\"\r\n },\r\n
|
||||
\ {\r\n \"Metric\": \"cpu.usage.maximum\",\r\n
|
||||
\ \"Instances\": \"*\"\r\n },\r\n {\r\n
|
||||
\ \"Metric\": \"cpu.usagemhz.average\",\r\n \"Instances\":
|
||||
\"*\"\r\n },\r\n {\r\n \"Metric\":
|
||||
\"cpu.usagemhz.maximum\",\r\n \"Instances\": \"*\"\r\n },\r\n
|
||||
\ {\r\n \"Metric\": \"cpu.wait.summation\",\r\n
|
||||
\ \"Instances\": \"*\"\r\n },\r\n {\r\n
|
||||
\ \"Metric\": \"cpu.system.summation\",\r\n \"Instances\":
|
||||
\"*\"\r\n },\r\n {\r\n \"Metric\":
|
||||
\"cpu.ready.summation\",\r\n \"Instances\": \"*\"\r\n },\r\n
|
||||
\ {\r\n \"Metric\": \"mem.usage.average\",\r\n
|
||||
\ \"Instances\": \"*\"\r\n },\r\n {\r\n
|
||||
\ \"Metric\": \"mem.usage.maximum\",\r\n \"Instances\":
|
||||
\"*\"\r\n },\r\n {\r\n \"Metric\":
|
||||
\"mem.consumed.average\",\r\n \"Instances\": \"*\"\r\n },\r\n
|
||||
\ {\r\n \"Metric\": \"mem.consumed.maximum\",\r\n
|
||||
\ \"Instances\": \"*\"\r\n },\r\n {\r\n
|
||||
\ \"Metric\": \"mem.active.average\",\r\n \"Instances\":
|
||||
\"*\"\r\n },\r\n {\r\n \"Metric\":
|
||||
\"mem.active.maximum\",\r\n \"Instances\": \"*\"\r\n },\r\n
|
||||
\ {\r\n \"Metric\": \"mem.vmmemctl.average\",\r\n
|
||||
\ \"Instances\": \"*\"\r\n },\r\n {\r\n
|
||||
\ \"Metric\": \"mem.vmmemctl.maximum\",\r\n \"Instances\":
|
||||
\"*\"\r\n },\r\n {\r\n \"Metric\":
|
||||
\"mem.totalCapacity.average\",\r\n \"Instances\": \"*\"\r\n
|
||||
\ },\r\n {\r\n \"Metric\": \"net.packetsRx.summation\",\r\n
|
||||
\ \"Instances\": \"*\"\r\n },\r\n {\r\n
|
||||
\ \"Metric\": \"net.packetsTx.summation\",\r\n \"Instances\":
|
||||
\"*\"\r\n },\r\n {\r\n \"Metric\":
|
||||
\"net.throughput.usage.average\",\r\n \"Instances\": \"*\"\r\n
|
||||
\ },\r\n {\r\n \"Metric\": \"net.received.average\",\r\n
|
||||
\ \"Instances\": \"*\"\r\n },\r\n {\r\n
|
||||
\ \"Metric\": \"net.transmitted.average\",\r\n \"Instances\":
|
||||
\"*\"\r\n },\r\n {\r\n \"Metric\":
|
||||
\"net.throughput.usage.nfs.average\",\r\n \"Instances\": \"*\"\r\n
|
||||
\ },\r\n {\r\n \"Metric\": \"datastore.numberReadAveraged.average\",\r\n
|
||||
\ \"Instances\": \"*\"\r\n },\r\n {\r\n
|
||||
\ \"Metric\": \"datastore.numberWriteAveraged.average\",\r\n
|
||||
\ \"Instances\": \"*\"\r\n },\r\n {\r\n
|
||||
\ \"Metric\": \"datastore.read.average\",\r\n \"Instances\":
|
||||
\"*\"\r\n },\r\n {\r\n \"Metric\":
|
||||
\"datastore.write.average\",\r\n \"Instances\": \"*\"\r\n },\r\n
|
||||
\ {\r\n \"Metric\": \"datastore.totalReadLatency.average\",\r\n
|
||||
\ \"Instances\": \"*\"\r\n },\r\n {\r\n
|
||||
\ \"Metric\": \"datastore.totalWriteLatency.average\",\r\n \"Instances\":
|
||||
\"*\"\r\n },\r\n {\r\n \"Metric\":
|
||||
\"mem.capacity.provisioned.average\",\r\n \"Instances\": \"*\"\r\n
|
||||
\ },\r\n {\r\n \"Metric\": \"cpu.corecount.provisioned.average\",\r\n
|
||||
\ \"Instances\": \"*\"\r\n }\r\n ]\r\n
|
||||
\ },\r\n {\r\n \"ObjectType\": [\r\n \"VirtualMachine\"\r\n
|
||||
\ ],\r\n \"Definition\": [\r\n {\r\n \"Metric\":
|
||||
\"datastore.datastoreVMObservedLatency.latest\",\r\n \"Instances\":
|
||||
\"*\"\r\n }\r\n ]\r\n },\r\n {\r\n \"ObjectType\":
|
||||
[\r\n \"HostSystem\"\r\n ],\r\n \"Definition\":
|
||||
[\r\n {\r\n \"Metric\": \"disk.maxTotalLatency.latest\",\r\n
|
||||
\ \"Instances\": \"\"\r\n },\r\n {\r\n
|
||||
\ \"Metric\": \"disk.numberReadAveraged.average\",\r\n \"Instances\":
|
||||
\"*\"\r\n },\r\n {\r\n \"Metric\":
|
||||
\"disk.numberWriteAveraged.average\",\r\n \"Instances\": \"*\"\r\n
|
||||
\ },\r\n {\r\n \"Metric\": \"net.throughput.contention.summation\",\r\n
|
||||
\ \"Instances\": \"*\"\r\n }\r\n ]\r\n
|
||||
\ },\r\n {\r\n \"ObjectType\": [\r\n \"Datastore\"\r\n
|
||||
\ ],\r\n \"Definition\": [\r\n {\r\n \"Metric\":
|
||||
\"disk.capacity.latest\",\r\n \"Instances\": \"*\"\r\n },\r\n
|
||||
\ {\r\n \"Metric\": \"disk.used.latest\",\r\n
|
||||
\ \"Instances\": \"*\"\r\n }\r\n ]\r\n
|
||||
\ }\r\n ]\r\n}"
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: vsphere-influxdb-go-config
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "vsphere-influxdb-go.name" . }}
|
||||
helm.sh/chart: {{ include "vsphere-influxdb-go.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ include "vsphere-influxdb-go.name" . }}
|
||||
|
||||
98
charts/vsphere-influxdb-go/templates/cronjob.yaml
Normal file
98
charts/vsphere-influxdb-go/templates/cronjob.yaml
Normal file
@@ -0,0 +1,98 @@
|
||||
---
|
||||
apiVersion: batch/v1beta1
|
||||
kind: CronJob
|
||||
metadata:
|
||||
name: {{ include "vsphere-influxdb-go.fullname" . }}-cronjob
|
||||
{{- if .Values.deploymentAnnotations }}
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.deploymentAnnotations }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "vsphere-influxdb-go.name" . }}
|
||||
helm.sh/chart: {{ include "vsphere-influxdb-go.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ include "vsphere-influxdb-go.name" . }}
|
||||
spec:
|
||||
schedule: {{ .Values.cronjob.schedule | quote }}
|
||||
successfulJobsHistoryLimit: {{ .Values.cronjob.successfulJobsHistoryLimit }}
|
||||
failedJobsHistoryLimit: {{ .Values.cronjob.failedJobsHistoryLimit }}
|
||||
concurrencyPolicy: Forbid
|
||||
{{- if .Values.cronjob.startingDeadlineSeconds }}
|
||||
startingDeadlineSeconds: {{ .Values.cronjob.startingDeadlineSeconds }}
|
||||
{{- end }}
|
||||
jobTemplate:
|
||||
spec:
|
||||
backoffLimit: 0
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "vsphere-influxdb-go.name" . }}
|
||||
helm.sh/chart: {{ include "vsphere-influxdb-go.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ include "vsphere-influxdb-go.name" . }}
|
||||
spec:
|
||||
restartPolicy: Never
|
||||
{{- if .Values.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
command: ["/vsphere-influxdb-go", "-config=/config/config.json"]
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
resources:
|
||||
{{ toYaml .Values.resources | indent 16 }}
|
||||
env:
|
||||
- name: VSPHERE_HOSTNAME
|
||||
value: {{ .Values.vsphere.hostname }}
|
||||
- name: VSPHERE_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ default "vsphere-influxdb-go-secret" .Values.existingSecretName }}
|
||||
key: vsphere.username
|
||||
- name: VSPHERE_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ default "vsphere-influxdb-go-secret" .Values.existingSecretName }}
|
||||
key: vsphere.password
|
||||
- name: INFLUX_HOSTNAME
|
||||
value: {{ .Values.influxdb.hostname }}
|
||||
- name: INFLUX_DATABASE
|
||||
value: {{ .Values.influxdb.database }}
|
||||
{{- if .Values.influxdb.authenticated }}
|
||||
- name: INFLUX_USERNAME
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ default "vsphere-influxdb-go-secret" .Values.existingSecretName }}
|
||||
key: influxdb.username
|
||||
- name: INFLUX_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ default "vsphere-influxdb-go-secret" .Values.existingSecretName }}
|
||||
key: influxdb.password
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: config-volume
|
||||
mountPath: /config
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: vsphere-influxdb-go-config
|
||||
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{ toYaml . | indent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{ toYaml . | indent 12 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{ toYaml . | indent 12 }}:
|
||||
{{- end }}
|
||||
20
charts/vsphere-influxdb-go/templates/secrets.yaml
Normal file
20
charts/vsphere-influxdb-go/templates/secrets.yaml
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
{{- if not (.Values.existingSecretName) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: vsphere-influxdb-go-secret
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "vsphere-influxdb-go.name" . }}
|
||||
helm.sh/chart: {{ include "vsphere-influxdb-go.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ include "vsphere-influxdb-go.name" . }}
|
||||
type: Opaque
|
||||
data:
|
||||
vsphere.username: {{ .Values.vsphere.username | b64enc }}
|
||||
vsphere.password: {{ .Values.vsphere.password | b64enc }}
|
||||
{{- if .Values.influxdb.authenticated }}
|
||||
influxdb.username: {{ .Values.influxdb.username | b64enc }}
|
||||
influxdb.password: {{ .Values.influxdb.password | b64enc }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user