added repo
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
apiVersion: v2
|
||||
name: telegraf-operator
|
||||
description: A Helm chart for Kubernetes to deploy telegraf-operator
|
||||
keywords:
|
||||
- telegraf
|
||||
- telegraf-operator
|
||||
- sidecar
|
||||
- operator
|
||||
- injector
|
||||
- mutatingwebhook
|
||||
- influxdata
|
||||
- influxdb
|
||||
|
||||
maintainers:
|
||||
- name: wojciechka
|
||||
email: wkocjan@influxdata.com
|
||||
- name: rawkode
|
||||
|
||||
kubeVersion: ">= 1.13.0-r0"
|
||||
home: https://github.com/influxdata/telegraf-operator
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: application
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
version: 1.3.11
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application.
|
||||
appVersion: v1.3.10
|
||||
@@ -0,0 +1,85 @@
|
||||
# Telegraf-operator Helm chart
|
||||
|
||||
> Default installation expects `cert-manager` to be running in the cluster.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Helm v2 or later
|
||||
- Kubernetes 1.11+ with Beta APIs enabled
|
||||
|
||||
## Install the chart
|
||||
|
||||
1. Add the InfluxData Helm repository:
|
||||
|
||||
```bash
|
||||
helm repo add influxdata https://helm.influxdata.com/
|
||||
```
|
||||
|
||||
2. Run the following command, providing a name for your release:
|
||||
|
||||
```bash
|
||||
helm upgrade --install my-release influxdata/telegraf-operator
|
||||
```
|
||||
|
||||
> **Tip**: `--install` can be shortened to `-i`.
|
||||
|
||||
This command deploys Telegraf-operator on the Kubernetes cluster using the default configuration. To find parameters you can configure during installation, see [Configure the chart](#configure-the-chart).
|
||||
|
||||
> **Tip**: To view all Helm chart releases, run `helm list`.
|
||||
|
||||
## Uninstall the chart
|
||||
|
||||
To uninstall the `my-release` deployment, use the following command:
|
||||
|
||||
```bash
|
||||
helm uninstall my-release
|
||||
```
|
||||
|
||||
This command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||
|
||||
## Configure the chart
|
||||
|
||||
Configurable parameters, their descriptions, and their default values are stored in `values.yaml`.
|
||||
|
||||
To configure the chart, do either of the following:
|
||||
|
||||
- Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade --install`. For example, use the following command:
|
||||
|
||||
```bash
|
||||
helm upgrade --install my-release \
|
||||
--set persistence.enabled=true \
|
||||
influxdata/telegraf-operator
|
||||
```
|
||||
|
||||
This command enables persistence.
|
||||
|
||||
- Provide a YAML file that specifies parameter values while installing the chart. For example, use the following command:
|
||||
|
||||
```bash
|
||||
helm upgrade --install my-release -f values.yaml influxdata/telegraf-operator
|
||||
```
|
||||
|
||||
> **Tip**: Use the default [values.yaml](values.yaml).
|
||||
|
||||
For information about running Telegraf-operator in Docker, see the [full image documentation](https://hub.docker.com/_/kapacitor/).
|
||||
|
||||
## Contribute to the chart
|
||||
|
||||
```shell
|
||||
helm template --namespace=telegraf-operator telegraf-operator .
|
||||
```
|
||||
|
||||
### Test installation with Kind
|
||||
|
||||
```shell
|
||||
kind create cluster --name=telegraf-operator-test
|
||||
kubectl config use-context kind-telegraf-operator-test
|
||||
kubectl apply -f tests/influxdb.yml
|
||||
helm install telegraf-operator .
|
||||
kubectl apply -f tests/redis.yml
|
||||
kind delete cluster --name=telegraf-operator-test
|
||||
```
|
||||
|
||||
## Cert-manager integration
|
||||
|
||||
For better security there is already an integration with cert-manger >0.13 that can be enabled but you have to provide your own instalation of cert-manager in the cluster
|
||||
@@ -0,0 +1,184 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "telegraf-operator.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Maintainer - Akshay Gupta
|
||||
Tolerations and nodeSelector via Resources Requests.
|
||||
*/}}
|
||||
{{- define "meesho.getCpu" -}}
|
||||
{{- $cpu := toString .Values.resources.requests.cpu -}}
|
||||
{{- if contains "m" $cpu -}}
|
||||
{{- $cpu := trimAll "m" $cpu | float64 -}}
|
||||
{{- $cpu := $cpu | float64 -}}
|
||||
{{- printf "%f" $cpu -}}
|
||||
{{- else -}}
|
||||
{{- $cpu := mulf $cpu 1000.000 -}}
|
||||
{{- printf "%f" $cpu -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "meesho.getMem" -}}
|
||||
{{- $mem := toString .Values.resources.requests.memory -}}
|
||||
{{- if contains "Mi" $mem -}}
|
||||
{{- $mem := trimAll "Mi" $mem | float64 -}}
|
||||
{{- printf "%f" $mem -}}
|
||||
{{- else if contains "Gi" $mem -}}
|
||||
{{- $mem := trimAll "Gi" $mem | float64 -}}
|
||||
{{- $mem := mulf $mem 1024.000 -}}
|
||||
{{- printf "%f" $mem -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "meesho.getRatio" -}}
|
||||
{{- $cpu := (include "meesho.getCpu" .) -}}
|
||||
{{- $mem := (include "meesho.getMem" .) -}}
|
||||
{{- $ratio := divf $mem $cpu -}}
|
||||
{{- if gt $ratio 4.00 -}}
|
||||
{{- printf "1to8" -}}
|
||||
{{- else if gt $ratio 2.00 -}}
|
||||
{{- printf "1to4" -}}
|
||||
{{- else -}}
|
||||
{{- printf "1to2" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "meesho.dedicatedValue" -}}
|
||||
{{- if (index .Values.labels "arch") -}}
|
||||
{{- if (index .Values.labels "runpod") -}}
|
||||
{{- $cpu := (include "meesho.getCpu" .) -}}
|
||||
{{- $mem := (include "meesho.getMem" .) -}}
|
||||
{{- $ratio := (include "meesho.getRatio" .) -}}
|
||||
{{- $arch := .Values.labels.arch -}}
|
||||
{{- $runPod := .Values.labels.runpod -}}
|
||||
{{- printf "%s-%s-%s" $ratio $arch $runPod -}}
|
||||
{{- else -}}
|
||||
{{- printf "missing-runpod-label" -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- printf "missing-arch-label" -}}
|
||||
{{- end -}}
|
||||
{{- 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 "telegraf-operator.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 "telegraf-operator.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "telegraf-operator.labels" -}}
|
||||
helm.sh/chart: {{ include "telegraf-operator.chart" . }}
|
||||
{{ include "telegraf-operator.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "telegraf-operator.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "telegraf-operator.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "telegraf-operator.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "telegraf-operator.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Generate certificates for telegraf-operator mutating webhook
|
||||
*/}}
|
||||
{{- define "telegraf-operator.non_certmanager" -}}
|
||||
{{- $altNames := list ( printf "%s.%s" (include "telegraf-operator.fullname" .) .Release.Namespace ) ( printf "%s.%s.svc" (include "telegraf-operator.fullname" .) .Release.Namespace ) -}}
|
||||
{{- $ca := genCA "telegraf-operator-ca" 365 -}}
|
||||
{{- $cert := genSignedCert ( include "telegraf-operator.fullname" . ) nil $altNames 365 $ca -}}
|
||||
apiVersion: admissionregistration.k8s.io/v1
|
||||
kind: MutatingWebhookConfiguration
|
||||
metadata:
|
||||
annotations:
|
||||
cert-manager.io/inject-ca-from: "{{ .Values.namespace }}/{{ include "telegraf-operator.fullname" . }}"
|
||||
labels:
|
||||
{{- include "telegraf-operator.labels" . | nindent 4 }}
|
||||
name: {{ include "telegraf-operator.fullname" . }}
|
||||
webhooks:
|
||||
- clientConfig:
|
||||
service:
|
||||
name: {{ include "telegraf-operator.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
path: /mutate-v1-pod
|
||||
caBundle: {{ $ca.Cert | b64enc }}
|
||||
failurePolicy: Ignore
|
||||
sideEffects: None
|
||||
admissionReviewVersions:
|
||||
- 'v1'
|
||||
name: telegraf.influxdata.com
|
||||
{{- if .Values.webhook.excludeNamespaces }}
|
||||
namespaceSelector:
|
||||
matchExpressions:
|
||||
- key: kubernetes.io/metadata.name
|
||||
operator: NotIn
|
||||
values:
|
||||
{{- range .Values.webhook.excludeNamespaces }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- '*'
|
||||
apiVersions:
|
||||
- '*'
|
||||
operations:
|
||||
- CREATE
|
||||
- DELETE
|
||||
resources:
|
||||
- pods
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
type: kubernetes.io/tls
|
||||
metadata:
|
||||
name: telegraf-operator-tls
|
||||
labels:
|
||||
{{- include "telegraf-operator.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
"helm.sh/hook": "pre-install,pre-upgrade"
|
||||
"helm.sh/hook-delete-policy": "before-hook-creation"
|
||||
data:
|
||||
tls.crt: {{ $cert.Cert | b64enc }}
|
||||
tls.key: {{ $cert.Key | b64enc }}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,18 @@
|
||||
{{- if .Values.certManager.enable -}}
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: {{ include "telegraf-operator.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "telegraf-operator.labels" . | nindent 4 }}
|
||||
spec:
|
||||
dnsNames:
|
||||
- "{{ include "telegraf-operator.fullname" . }}.{{ .Release.Namespace }}.svc"
|
||||
- "{{ include "telegraf-operator.fullname" . }}.{{ .Release.Namespace }}"
|
||||
isCA: true
|
||||
issuerRef:
|
||||
kind: Issuer
|
||||
name: telegraf-operator-issuer
|
||||
secretName: telegraf-operator-tls
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,23 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "telegraf-operator.labels" . | nindent 4 }}
|
||||
name: {{ include "telegraf-operator.fullname" . }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- secrets
|
||||
verbs:
|
||||
- '*'
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- namespaces
|
||||
verbs: ["get", "list"]
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- pods
|
||||
verbs: ["get"]
|
||||
@@ -0,0 +1,14 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "telegraf-operator.labels" . | nindent 4 }}
|
||||
name: {{ include "telegraf-operator.fullname" . }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ include "telegraf-operator.fullname" . }}
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ include "telegraf-operator.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
@@ -0,0 +1,102 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "telegraf-operator.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "telegraf-operator.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "telegraf-operator.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "telegraf-operator.selectorLabels" . | nindent 8 }}
|
||||
{{- if eq .Values.certManager.enable false }}
|
||||
annotations:
|
||||
checksum/config: {{ include (print $.Template.BasePath "/tls.yml") . | sha256sum }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
args:
|
||||
- "--telegraf-default-class={{ .Values.classes.default }}"
|
||||
- --telegraf-classes-directory=/etc/telegraf-operator
|
||||
- --enable-default-internal-plugin
|
||||
- "--telegraf-image={{ .Values.image.sidecarImage }}"
|
||||
{{- if eq .Values.requireAnnotationsForSecret true }}
|
||||
- "--require-annotations-for-secret"
|
||||
{{- end }}
|
||||
{{- if eq .Values.hotReload true }}
|
||||
- "--telegraf-watch-config=inotify"
|
||||
{{- end }}
|
||||
env:
|
||||
- name: TZ
|
||||
value: Asia/Kolkata
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
ports:
|
||||
- name: https
|
||||
containerPort: 9443
|
||||
protocol: TCP
|
||||
volumeMounts:
|
||||
- mountPath: /etc/certs
|
||||
name: certs
|
||||
readOnly: true
|
||||
- mountPath: /etc/telegraf-operator
|
||||
name: classes
|
||||
readOnly: true
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "telegraf-operator.fullname" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
volumes:
|
||||
- name: certs
|
||||
secret:
|
||||
secretName: telegraf-operator-tls
|
||||
- name: classes
|
||||
secret:
|
||||
secretName: {{ .Values.classes.secretName }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.schedulerName }}
|
||||
schedulerName: "{{ .Values.schedulerName }}"
|
||||
{{- end }}
|
||||
nodeSelector:
|
||||
{{- if .Values.dedicatedValue }}
|
||||
dedicated: {{ include "meesho.dedicatedValue" . }}
|
||||
{{- else }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
{{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
tolerations:
|
||||
{{- if .Values.dedicatedValue }}
|
||||
- key: "dedicated"
|
||||
operator: "Equal"
|
||||
value: {{ include "meesho.dedicatedValue" . }}
|
||||
effect: "NoSchedule"
|
||||
{{- else }}
|
||||
{{- with .Values.tolerations }}
|
||||
{{ toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,11 @@
|
||||
{{- if .Values.certManager.enable -}}
|
||||
apiVersion: cert-manager.io/v1
|
||||
kind: Issuer
|
||||
metadata:
|
||||
name: telegraf-operator-issuer
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "telegraf-operator.labels" . | nindent 4 }}
|
||||
spec:
|
||||
selfSigned: {}
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,41 @@
|
||||
{{- if eq .Values.certManager.enable true -}}
|
||||
apiVersion: admissionregistration.k8s.io/v1
|
||||
kind: MutatingWebhookConfiguration
|
||||
metadata:
|
||||
annotations:
|
||||
cert-manager.io/inject-ca-from: "{{ .Release.Namespace }}/{{ include "telegraf-operator.fullname" . }}"
|
||||
labels:
|
||||
{{- include "telegraf-operator.labels" . | nindent 4 }}
|
||||
name: {{ include "telegraf-operator.fullname" . }}
|
||||
webhooks:
|
||||
- clientConfig:
|
||||
service:
|
||||
name: {{ include "telegraf-operator.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
path: /mutate-v1-pod
|
||||
failurePolicy: Ignore
|
||||
sideEffects: None
|
||||
admissionReviewVersions:
|
||||
- 'v1'
|
||||
name: telegraf.influxdata.com
|
||||
{{- if .Values.webhook.excludeNamespaces }}
|
||||
namespaceSelector:
|
||||
matchExpressions:
|
||||
- key: kubernetes.io/metadata.name
|
||||
operator: NotIn
|
||||
values:
|
||||
{{- range .Values.webhook.excludeNamespaces }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- '*'
|
||||
apiVersions:
|
||||
- '*'
|
||||
operations:
|
||||
- CREATE
|
||||
- DELETE
|
||||
resources:
|
||||
- pods
|
||||
{{- end }}
|
||||
@@ -0,0 +1,16 @@
|
||||
{{- if .Capabilities.APIVersions.Has "policy/v1" }}
|
||||
apiVersion: policy/v1
|
||||
{{- else }}
|
||||
apiVersion: policy/v1beta1
|
||||
{{- end }}
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ include "telegraf-operator.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "telegraf-operator.labels" . | nindent 4 }}
|
||||
spec:
|
||||
minAvailable: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "telegraf-operator.selectorLabels" . | nindent 6 }}
|
||||
@@ -0,0 +1,8 @@
|
||||
{{- if .Values.classes.data }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ .Values.classes.secretName }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
stringData: {{ .Values.classes.data | toYaml | nindent 2 }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "telegraf-operator.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "telegraf-operator.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: https
|
||||
port: 443
|
||||
protocol: TCP
|
||||
targetPort: 9443
|
||||
selector:
|
||||
{{- include "telegraf-operator.selectorLabels" . | nindent 4 }}
|
||||
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "telegraf-operator.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "telegraf-operator.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{{- if eq .Values.certManager.enable false -}}
|
||||
{{ ( include "telegraf-operator.non_certmanager" . ) }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,42 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: influxdb
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: influxdb
|
||||
namespace: influxdb
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: influxdb
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: influxdb
|
||||
spec:
|
||||
containers:
|
||||
- name: influxdb
|
||||
image: influxdb:1.7.9
|
||||
- name: chronograf
|
||||
image: chronograf:1.6.2
|
||||
args: ["--influxdb-url=http://localhost:8086"]
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
app: influxdb
|
||||
name: influxdb
|
||||
namespace: influxdb
|
||||
spec:
|
||||
ports:
|
||||
- name: server
|
||||
port: 8086
|
||||
- name: chronograf
|
||||
port: 8888
|
||||
selector:
|
||||
app: influxdb
|
||||
@@ -0,0 +1,25 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: test
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: test
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
serviceName: redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
annotations:
|
||||
telegraf.influxdata.com/ports: "8080,9090"
|
||||
spec:
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:alpine
|
||||
@@ -0,0 +1,64 @@
|
||||
replicaCount: 3
|
||||
image:
|
||||
repository: quay.io/influxdb/telegraf-operator
|
||||
pullPolicy: IfNotPresent
|
||||
sidecarImage: "docker.io/library/telegraf:1.22"
|
||||
|
||||
classes:
|
||||
secretName: "telegraf-operator-classes"
|
||||
default: "infra"
|
||||
data:
|
||||
infra: |
|
||||
[[outputs.influxdb]]
|
||||
urls = ["http://influxdb.influxdb:8086"]
|
||||
[global_tags]
|
||||
env = "ci"
|
||||
hostname = "$HOSTNAME"
|
||||
nodename = "$NODENAME"
|
||||
type = "infra"
|
||||
|
||||
certManager:
|
||||
enable: false
|
||||
|
||||
webhook:
|
||||
excludeNamespaces:
|
||||
- kube-system
|
||||
- kube-public
|
||||
- kube-node-lease
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
serviceAccount:
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
resources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 256Mi
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 64Mi
|
||||
sidecarResources:
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 200Mi
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 10Mi
|
||||
nodeSelector: {}
|
||||
tolerations: []
|
||||
affinity: {}
|
||||
requireAnnotationsForSecret: false
|
||||
# allow hot reload ; disabled by default to support versions of telegraf
|
||||
# that do not support hot-reload and --watch-config flag
|
||||
hotReload: false
|
||||
Reference in New Issue
Block a user