From 0918a3138e02c673906357b8779f1644657d2d52 Mon Sep 17 00:00:00 2001 From: Kali Norby Date: Wed, 15 May 2019 22:10:45 -0700 Subject: [PATCH 1/2] Adding podAnnotations to all charts --- chronograf/templates/deployment.yaml | 1 + chronograf/values.yaml | 11 ++++++++--- influxdb/templates/deployment.yaml | 1 + influxdb/values.yaml | 6 +++++- kapacitor/templates/deployment.yaml | 1 + kapacitor/values.yaml | 5 +++++ telegraf-ds/templates/daemonset.yaml | 1 + telegraf-ds/values.yaml | 7 ++++++- telegraf-s/templates/deployment.yaml | 1 + telegraf-s/values.yaml | 8 ++++++-- 10 files changed, 35 insertions(+), 7 deletions(-) diff --git a/chronograf/templates/deployment.yaml b/chronograf/templates/deployment.yaml index 22e6858..13fcb00 100644 --- a/chronograf/templates/deployment.yaml +++ b/chronograf/templates/deployment.yaml @@ -17,6 +17,7 @@ spec: # Include a hash of the secret in the pod template # This means that if the secret changes, the deployment will be rolled checksum/secret: {{ include (print .Template.BasePath "/secret.yaml") . | sha256sum }} +{{ toYaml .Values.podAnnotations | indent 8 }} spec: containers: - name: {{ .Chart.Name }} diff --git a/chronograf/values.yaml b/chronograf/values.yaml index c6b8ba8..95bc510 100644 --- a/chronograf/values.yaml +++ b/chronograf/values.yaml @@ -1,5 +1,5 @@ ## Image Settings -## +## ## ref: https://hub.docker.com/r/library/chronograf/tags/ image: repository: "chronograf" @@ -55,10 +55,15 @@ tolerations: [] ## affinity: {} +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + ## Configure the ingress object to hook into existing infastructure ## ref : http://kubernetes.io/docs/user-guide/ingress/ -## OPTIONALLY you can set .Values.ingress.secretName to set which secret to use -## +## OPTIONALLY you can set .Values.ingress.secretName to set which secret to use +## ingress: enabled: false tls: false diff --git a/influxdb/templates/deployment.yaml b/influxdb/templates/deployment.yaml index 803cc56..6083c29 100644 --- a/influxdb/templates/deployment.yaml +++ b/influxdb/templates/deployment.yaml @@ -17,6 +17,7 @@ spec: # Include a hash of the config in the pod template # This means that if the config changes, the deployment will be rolled checksum/config: {{ include (print .Template.BasePath "/config.yaml") . | sha256sum }} +{{ toYaml .Values.podAnnotations | indent 8 }} spec: containers: - name: {{ template "fullname" . }} diff --git a/influxdb/values.yaml b/influxdb/values.yaml index 2fa97ec..4d6b9a4 100644 --- a/influxdb/values.yaml +++ b/influxdb/values.yaml @@ -52,6 +52,11 @@ tolerations: [] ## affinity: {} +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + ## Change InfluxDB configuration paramaters below: ## Defaults are indicated ## ref: https://docs.influxdata.com/influxdb/v1.7/administration/config/ @@ -168,4 +173,3 @@ config: log_enabled: true enabled: true run_interval: 1s - diff --git a/kapacitor/templates/deployment.yaml b/kapacitor/templates/deployment.yaml index ae85940..d6a1fcd 100644 --- a/kapacitor/templates/deployment.yaml +++ b/kapacitor/templates/deployment.yaml @@ -18,6 +18,7 @@ spec: # Include a hash of the config in the pod template # This means that if the config changes, the deployment will be rolled checksum/config: {{ include (print .Template.BasePath "/config.yaml") . | sha256sum }} +{{ toYaml .Values.podAnnotations | indent 8 }} spec: containers: - name: {{ .Chart.Name }} diff --git a/kapacitor/values.yaml b/kapacitor/values.yaml index 9e4db93..8a49720 100644 --- a/kapacitor/values.yaml +++ b/kapacitor/values.yaml @@ -54,6 +54,11 @@ tolerations: [] ## affinity: {} +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + ## Set the URL of InfluxDB instance to create subscription on ## ref: https://docs.influxdata.com/kapacitor/v1.5/introduction/getting_started/ ## diff --git a/telegraf-ds/templates/daemonset.yaml b/telegraf-ds/templates/daemonset.yaml index 7c5f64c..8754868 100644 --- a/telegraf-ds/templates/daemonset.yaml +++ b/telegraf-ds/templates/daemonset.yaml @@ -15,6 +15,7 @@ spec: # Include a hash of the configmap in the pod template # This means that if the configmap changes, the deployment will be rolled checksum/config: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum }} +{{ toYaml .Values.podAnnotations | indent 8 }} spec: containers: - name: {{ template "fullname" . }} diff --git a/telegraf-ds/values.yaml b/telegraf-ds/values.yaml index 1c50d2b..ac96054 100644 --- a/telegraf-ds/values.yaml +++ b/telegraf-ds/values.yaml @@ -21,6 +21,11 @@ resources: ## tolerations: [] +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + ## Exposed telegraf configuration ## ref: https://docs.influxdata.com/telegraf/v1.8/administration/configuration/ config: @@ -55,7 +60,7 @@ config: url: "https://$HOSTIP:10250" bearer_token: "/var/run/secrets/kubernetes.io/serviceaccount/token" insecure_skip_verify: true - - docker: + - docker: endpoint: "unix:///var/run/docker.sock" timeout: "5s" perdevice: true diff --git a/telegraf-s/templates/deployment.yaml b/telegraf-s/templates/deployment.yaml index 57bd8e7..170f73f 100644 --- a/telegraf-s/templates/deployment.yaml +++ b/telegraf-s/templates/deployment.yaml @@ -16,6 +16,7 @@ spec: # Include a hash of the configmap in the pod template # This means that if the configmap changes, the deployment will be rolled checksum/config: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum }} +{{ toYaml .Values.podAnnotations | indent 8 }} spec: containers: - name: {{ template "fullname" . }} diff --git a/telegraf-s/values.yaml b/telegraf-s/values.yaml index 3d99ec8..d5ccf92 100644 --- a/telegraf-s/values.yaml +++ b/telegraf-s/values.yaml @@ -38,6 +38,11 @@ tolerations: [] ## affinity: {} +## Pod annotations +## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ +## +podAnnotations: {} + ## Configure the service for this telegraf instance. If you are running ## Any of the service plugins you will need this enabled ## Service Plugins: http_listener, statsd, tcp_listener, udp_listener @@ -136,7 +141,7 @@ config: ## server: "localhost:4150" ## topic: "telegraf" ## data_format: "influx" - + # CPU and System is required for chronograf # This may show errors in the logs, but this does not affect performance or functionality inputs: @@ -400,4 +405,3 @@ config: metric_separator: "_" allowed_pending_messages: 10000 percentile_limit: 1000 - From c7ccdcc576091c0b3026a0ed660dbbf644397ece Mon Sep 17 00:00:00 2001 From: Kali Norby Date: Thu, 16 May 2019 10:17:40 -0700 Subject: [PATCH 2/2] Fixing pod annotation inclusion --- chronograf/templates/deployment.yaml | 4 +++- influxdb/templates/deployment.yaml | 4 +++- kapacitor/templates/deployment.yaml | 4 +++- telegraf-ds/templates/daemonset.yaml | 4 +++- telegraf-s/templates/deployment.yaml | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/chronograf/templates/deployment.yaml b/chronograf/templates/deployment.yaml index 13fcb00..d8a8066 100644 --- a/chronograf/templates/deployment.yaml +++ b/chronograf/templates/deployment.yaml @@ -17,7 +17,9 @@ spec: # Include a hash of the secret in the pod template # This means that if the secret changes, the deployment will be rolled checksum/secret: {{ include (print .Template.BasePath "/secret.yaml") . | sha256sum }} -{{ toYaml .Values.podAnnotations | indent 8 }} + {{- range $key, $value := .Values.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} spec: containers: - name: {{ .Chart.Name }} diff --git a/influxdb/templates/deployment.yaml b/influxdb/templates/deployment.yaml index 6083c29..db0edcb 100644 --- a/influxdb/templates/deployment.yaml +++ b/influxdb/templates/deployment.yaml @@ -17,7 +17,9 @@ spec: # Include a hash of the config in the pod template # This means that if the config changes, the deployment will be rolled checksum/config: {{ include (print .Template.BasePath "/config.yaml") . | sha256sum }} -{{ toYaml .Values.podAnnotations | indent 8 }} + {{- range $key, $value := .Values.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} spec: containers: - name: {{ template "fullname" . }} diff --git a/kapacitor/templates/deployment.yaml b/kapacitor/templates/deployment.yaml index d6a1fcd..3ed1bf2 100644 --- a/kapacitor/templates/deployment.yaml +++ b/kapacitor/templates/deployment.yaml @@ -18,7 +18,9 @@ spec: # Include a hash of the config in the pod template # This means that if the config changes, the deployment will be rolled checksum/config: {{ include (print .Template.BasePath "/config.yaml") . | sha256sum }} -{{ toYaml .Values.podAnnotations | indent 8 }} + {{- range $key, $value := .Values.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} spec: containers: - name: {{ .Chart.Name }} diff --git a/telegraf-ds/templates/daemonset.yaml b/telegraf-ds/templates/daemonset.yaml index 8754868..924015f 100644 --- a/telegraf-ds/templates/daemonset.yaml +++ b/telegraf-ds/templates/daemonset.yaml @@ -15,7 +15,9 @@ spec: # Include a hash of the configmap in the pod template # This means that if the configmap changes, the deployment will be rolled checksum/config: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum }} -{{ toYaml .Values.podAnnotations | indent 8 }} + {{- range $key, $value := .Values.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} spec: containers: - name: {{ template "fullname" . }} diff --git a/telegraf-s/templates/deployment.yaml b/telegraf-s/templates/deployment.yaml index 170f73f..5222cd4 100644 --- a/telegraf-s/templates/deployment.yaml +++ b/telegraf-s/templates/deployment.yaml @@ -16,7 +16,9 @@ spec: # Include a hash of the configmap in the pod template # This means that if the configmap changes, the deployment will be rolled checksum/config: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum }} -{{ toYaml .Values.podAnnotations | indent 8 }} + {{- range $key, $value := .Values.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} spec: containers: - name: {{ template "fullname" . }}