Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
influxdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
influxdb
Commits
4eb7881d
Unverified
Commit
4eb7881d
authored
May 22, 2020
by
Giacomo Tirabassi
Committed by
GitHub
May 22, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
making telegraf-operator work (#92)
* making telegraf-operator work * cutting a new version of the chart * addressed review
parent
21c78bc2
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
133 additions
and
74 deletions
+133
-74
Chart.yaml
charts/telegraf-operator/Chart.yaml
+1
-1
README.md
charts/telegraf-operator/README.md
+9
-4
test-values.yaml
charts/telegraf-operator/ci/test-values.yaml
+0
-50
_helpers.tpl
charts/telegraf-operator/templates/_helpers.tpl
+42
-3
mutatingwebhookconfiguration.yml
...egraf-operator/templates/mutatingwebhookconfiguration.yml
+2
-0
secret-classes.yml
charts/telegraf-operator/templates/secret-classes.yml
+0
-15
tls.yml
charts/telegraf-operator/templates/tls.yml
+3
-0
influxdb.yml
charts/telegraf-operator/tests/influxdb.yml
+42
-0
redis.yml
charts/telegraf-operator/tests/redis.yml
+25
-0
values.yaml
charts/telegraf-operator/values.yaml
+9
-1
No files found.
charts/telegraf-operator/Chart.yaml
View file @
4eb7881d
...
...
@@ -31,7 +31,7 @@ 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.0.
0
version
:
1.0.
1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
...
...
charts/telegraf-operator/README.md
View file @
4eb7881d
# Telegraf-operator
> Default installation expects cert-manager to be running in the cluster
## Usage
```
console
...
...
@@ -17,9 +15,16 @@ helm install telegraf-operator influxdata/telegraf-operator
helm template
--namespace
=
telegraf-operator telegraf-operator
.
```
Test
ing CI template
Test
installation with Kind
```
shell
helm template
--namespace
=
telegraf-operator
--values
=
./ci/values.yaml telegraf-operator
.
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
charts/telegraf-operator/ci/test-values.yaml
deleted
100644 → 0
View file @
21c78bc2
replicaCount
:
3
image
:
repository
:
quay.io/influxdb/telegraf-operator
pullPolicy
:
IfNotPresent
sidecarImage
:
"
docker.io/library/telegraf:1.14.1"
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
:
chart
:
enable
:
false
certificate
:
enable
:
false
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
:
100m
memory
:
128Mi
requests
:
cpu
:
50m
memory
:
64Mi
nodeSelector
:
{}
tolerations
:
[]
affinity
:
{}
charts/telegraf-operator/templates/_helpers.tpl
View file @
4eb7881d
...
...
@@ -65,10 +65,49 @@ Create the name of the service account to use
{
{
/*
Generate
certificates
for
telegraf
-
operator
mutating
webhook
*/
}
}
{{- define "telegraf-operator.
gen-certs
" -}}
{{- define "telegraf-operator.
non_certmanager
" -}}
{{- $altNames := list ( printf "%s.%s" (include "telegraf-operator.name" .) .Release.Namespace ) ( printf "%s.%s.svc" (include "telegraf-operator.name" .) .Release.Namespace ) -}}
{{- $ca := genCA "telegraf-operator-ca" 365 -}}
{{- $cert := genSignedCert ( include "telegraf-operator.name" . ) nil $altNames 365 $ca -}}
tls.crt: {{ $cert.Cert | b64enc }}
tls.key: {{ $cert.Key | b64enc }}
apiVersion: admissionregistration.k8s.io/v1beta1
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
name: telegraf.influxdata.com
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"
"helm.sh/hook-delete-policy": "before-hook-creation"
data:
tls.crt: {{ $cert.Cert | b64enc }}
tls.key: {{ $cert.Key | b64enc }}
{{- end -}}
charts/telegraf-operator/templates/mutatingwebhookconfiguration.yml
View file @
4eb7881d
{{
- if eq .Values.certManager.enable true -
}}
apiVersion
:
admissionregistration.k8s.io/v1beta1
kind
:
MutatingWebhookConfiguration
metadata
:
...
...
@@ -24,3 +25,4 @@ webhooks:
-
DELETE
resources
:
-
pods
{{
- end
}}
charts/telegraf-operator/templates/secret-classes.yml
View file @
4eb7881d
...
...
@@ -6,18 +6,3 @@ metadata:
namespace
:
{{
.Release.Namespace
}}
stringData
:
{{
.Values.classes.data | toYaml | nindent 2
}}
{{
- end
}}
---
{{
- if eq .Values.certManager.enable false -
}}
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"
"
helm.sh/hook-delete-policy"
:
"
before-hook-creation"
data
:
{{
( include "telegraf-operator.gen-certs" . ) | indent 2
}}
{{
- end
}}
charts/telegraf-operator/templates/tls.yml
0 → 100644
View file @
4eb7881d
{{
- if eq .Values.certManager.enable false -
}}
{{
( include "telegraf-operator.non_certmanager" . )
}}
{{
- end
}}
charts/telegraf-operator/tests/influxdb.yml
0 → 100644
View file @
4eb7881d
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
charts/telegraf-operator/tests/redis.yml
0 → 100644
View file @
4eb7881d
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
charts/telegraf-operator/values.yaml
View file @
4eb7881d
...
...
@@ -7,7 +7,15 @@ image:
classes
:
secretName
:
"
telegraf-operator-classes"
default
:
"
infra"
data
:
{}
data
:
infra
:
|
[[outputs.influxdb]]
urls = ["http://influxdb.influxdb:8086"]
[global_tags]
env = "ci"
hostname = "$HOSTNAME"
nodename = "$NODENAME"
type = "infra"
certManager
:
enable
:
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment