forked from deis/monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(influxdb): Use stable/influxdb chart
closes deis#180 * This moves to using the influxdb chart in the stable repository * Sets the version to 0.4.0 * Adds two pre-upgrade hooks to the base monitor chart. These hooks allow the chart to migrate data from the old volume mount location to the new one provided by the influxdb chart. * If `influxdb_location` is set to `off-cluster` it will delete the deployment resource using a post-install or post-upgrade hook.
- Loading branch information
Jonathan Chauncey
committed
Apr 18, 2017
1 parent
977d0f3
commit f83a491
Showing
18 changed files
with
255 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
charts/monitor/charts/influxdb/templates/monitor-influxdb-api-svc.yaml
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
charts/monitor/charts/influxdb/templates/monitor-influxdb-creds-secret.yaml
This file was deleted.
Oops, something went wrong.
69 changes: 0 additions & 69 deletions
69
charts/monitor/charts/influxdb/templates/monitor-influxdb-deployment.yaml
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
charts/monitor/charts/influxdb/templates/monitor-influxdb-pvc.yaml
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
charts/monitor/charts/influxdb/templates/monitor-influxdb-ui-svc.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: deis-monitor-migrate-data | ||
annotations: | ||
"helm.sh/hook": "pre-upgrade" | ||
"helm.sh/hook-weight": "0" | ||
spec: | ||
template: | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- name: deis-monitor-migrate-data | ||
image: "lachlanevenson/k8s-kubectl" | ||
command: ["/bin/sh", "-c"] | ||
args: ["(if [ -d /var/lib/influxdb/data/_internal ]; then \ | ||
echo 'Nothing to migrate!'; \ | ||
else \ | ||
echo Creating directories; \ | ||
mkdir /var/lib/influxdb/data; \ | ||
(if [ -d /var/lib/influxdb/db/wal ]; then \ | ||
echo 'Moving data from /db/wal'; \ | ||
mv /var/lib/influxdb/db/wal /var/lib/influxdb; \ | ||
else \ | ||
echo 'Directory /var/lib/influxdb/db/wal does not exist!'; \ | ||
fi); \ | ||
(if [ -d /var/lib/influxdb/db/_internal ]; then \ | ||
echo 'Moving data from /db/*'; \ | ||
mv /var/lib/influxdb/db/* /var/lib/influxdb/data; \ | ||
else \ | ||
echo 'Directory /var/lib/influxdb/db does not exist!'; \ | ||
fi); | ||
fi)"] | ||
volumeMounts: | ||
- name: data | ||
mountPath: /var/lib/influxdb | ||
volumes: | ||
- name: data | ||
persistentVolumeClaim: | ||
claimName: deis-monitor-influxdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
dependencies: | ||
- condition: "" | ||
enabled: false | ||
import-values: null | ||
name: influxdb | ||
repository: http://127.0.0.1:8879 | ||
tags: null | ||
version: 0.4.1 | ||
digest: sha256:b034be0df67d05c3f222f01f996fed5d2a70bbc4033500cb5dfd82b5b84651d2 | ||
generated: 2017-04-11T18:05:43.257195189-04:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# dependencies: | ||
# - name: influxdb | ||
# version: "0.4.0" | ||
# repository: https://kubernetes-charts.storage.googleapis.com | ||
|
||
dependencies: | ||
- name: influxdb | ||
version: "0.4.1" | ||
repository: http://127.0.0.1:8879 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{{- if eq .Values.global.influxdb_location "off-cluster" }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: deis-monitor-delete-influxdb-deployment-{{ randAlphaNum 5 | lower }} | ||
labels: | ||
heritage: {{.Release.Service | quote }} | ||
release: {{.Release.Name | quote }} | ||
chart: {{.Chart.Name}} | ||
annotations: | ||
"helm.sh/hook": post-install,post-upgrade | ||
"helm.sh/hook-weight": "-10" | ||
spec: | ||
template: | ||
metadata: | ||
name: "{{.Release.Name}}" | ||
labels: | ||
heritage: {{.Release.Service | quote }} | ||
release: {{.Release.Name | quote }} | ||
chart: "{{.Chart.Name}}" | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- name: deis-monitor-delete-influxdb-deployment | ||
image: "lachlanevenson/k8s-kubectl" | ||
command: ["/bin/sh", "-c"] | ||
args: ["(kubectl delete deploy {{.Release.Name}}-influxdb) \ | ||
|| \ | ||
true"] | ||
- name: deis-monitor-delete-telegraf-pods | ||
image: "lachlanevenson/k8s-kubectl" | ||
command: ["/bin/sh", "-c"] | ||
args: ["kubectl get pods | grep deis-monitor-telegraf | awk '{print $1}' | xargs kubectl delete pod \ | ||
|| \ | ||
true"] | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{{ $tillerVersion := semver .Capabilities.TillerVersion.SemVer }} | ||
{{ $comparingVersion := semver "2.3.0" }} | ||
|
||
{{- if gt ($tillerVersion | $comparingVersion.Compare) -1 }} | ||
{{- if .Values.influxdb.persistence.enabled }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: deis-monitor-kill-pods-{{ randAlphaNum 5 | lower }} | ||
labels: | ||
heritage: {{.Release.Service | quote }} | ||
release: {{.Release.Name | quote }} | ||
chart: {{.Chart.Name}} | ||
annotations: | ||
"helm.sh/hook": pre-upgrade | ||
"helm.sh/hook-weight": "-10" | ||
spec: | ||
template: | ||
metadata: | ||
name: "{{.Release.Name}}" | ||
labels: | ||
heritage: {{.Release.Service | quote }} | ||
release: {{.Release.Name | quote }} | ||
chart: "{{.Chart.Name}}" | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- name: deis-monitor-kill-pods | ||
image: "lachlanevenson/k8s-kubectl" | ||
command: ["/bin/sh", "-c"] | ||
args: ["(kubectl delete daemonset deis-monitor-telegraf && | ||
kubectl delete deploy deis-monitor-influxdb && | ||
sleep 30) || true"] | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{{ $tillerVersion := semver .Capabilities.TillerVersion.SemVer }} | ||
{{ $comparingVersion := semver "2.3.0" }} | ||
|
||
{{- if gt ($tillerVersion | $comparingVersion.Compare) -1 }} | ||
{{- if .Values.influxdb.persistence.enabled }} | ||
apiVersion: batch/v1 | ||
kind: Job | ||
metadata: | ||
name: deis-monitor-migrate-data-{{ randAlphaNum 5 | lower }} | ||
labels: | ||
heritage: {{.Release.Service | quote }} | ||
release: {{.Release.Name | quote }} | ||
chart: {{.Chart.Name}} | ||
annotations: | ||
"helm.sh/hook": "pre-upgrade" | ||
"helm.sh/hook-weight": "0" | ||
spec: | ||
template: | ||
metadata: | ||
name: "{{.Release.Name}}" | ||
labels: | ||
heritage: {{.Release.Service | quote }} | ||
release: {{.Release.Name | quote }} | ||
chart: "{{.Chart.Name}}" | ||
spec: | ||
restartPolicy: Never | ||
containers: | ||
- name: deis-monitor-migrate-data | ||
image: "lachlanevenson/k8s-kubectl" | ||
command: ["/bin/sh", "-c"] | ||
args: ["(if [ -d {{ .Values.influxdb.config.storage_directory }}/data/_internal ]; then \ | ||
echo 'Nothing to migrate!'; \ | ||
else \ | ||
echo Creating directories; \ | ||
mkdir {{ .Values.influxdb.config.storage_directory }}/data; \ | ||
(if [ -d {{ .Values.influxdb.config.storage_directory }}/db/wal ]; then \ | ||
echo 'Moving data from /db/wal'; \ | ||
mv {{ .Values.influxdb.config.storage_directory }}/db/wal {{ .Values.influxdb.config.storage_directory }}; \ | ||
else \ | ||
echo 'Directory {{ .Values.influxdb.config.storage_directory }}/db/wal does not exist!'; \ | ||
fi); \ | ||
(if [ -d {{ .Values.influxdb.config.storage_directory }}/db/_internal ]; then \ | ||
echo 'Moving data from /db/*'; \ | ||
mv {{ .Values.influxdb.config.storage_directory }}/db/* {{ .Values.influxdb.config.storage_directory }}/data; \ | ||
else \ | ||
echo 'Directory {{ .Values.influxdb.config.storage_directory }}/db does not exist!'; \ | ||
fi); | ||
fi)"] | ||
volumeMounts: | ||
- name: data | ||
mountPath: {{ .Values.influxdb.config.storage_directory }} | ||
volumes: | ||
- name: data | ||
persistentVolumeClaim: | ||
claimName: deis-monitor-influxdb | ||
{{- end }} | ||
{{- end }} |
Oops, something went wrong.