Commit b849d424 authored by David McKay's avatar David McKay

feat: support license key file

parent ba3ef201
......@@ -16,7 +16,7 @@ data:
license-key = "{{ .Values.license.key }}" #✨ mutually exclusive with license-path
{{ else }}
# license-key and license-path are mutually exclusive, use only one and leave the other blank
license-path = "/etc/influxdb/license.json"
license-path = "/var/run/secrets/influxdb/license.json"
{{ end }}
[meta]
......@@ -51,19 +51,12 @@ data:
my $protocol = $ENV{HTTP_PROTOCOL};
my $meta_service = $ENV{RELEASE_NAME} . "-meta";
# First time preparing to register with a meta node.
# There's a delay waiting on this pods DNS to be resolvable, and
# it looks like the /add-data endpoint returns a 200 even when that
# lookup fails.
# So slipping in this sleep for the time being
# sleep(15);
# We're not going to define an exit strategy for failure here.
# This should be handled by the probes on the pods
while (true) {
# There's no LWP/Simple available in our images, so forking out to curl 😥
print "\n\n\nREGISTER WITH META SERVICE\n\n\n";
$exit_code = system('curl', '-H', 'Expect:', '-XPOST', '-v', '--silent', '--fail', "-Faddr=$ENV{INFLUXDB_HOSTNAME}:8088", "$protocol://$meta_service:8091/add-data");
$exit_code = system('curl', '-XPOST', '-v', '--silent', '--fail', '--retry', '5', '--retry-delay', '0', "-Faddr=$ENV{INFLUXDB_HOSTNAME}:8088", "$protocol://$meta_service:8091/add-data");
if ($exit_code == 0) {
......@@ -73,9 +66,7 @@ data:
print "\n\n\nFailed: $!\n\n\n";
$| = 1;
# Wait a few seconds and try again
# Maybe we should implement some rudamentary backoff
sleep(2);
exit 255
}
waitpid($pid, 0);
......
......@@ -32,6 +32,11 @@ spec:
- name: config
configMap:
name: {{ include "influxdb-enterprise.fullname" . }}-data
{{- if .Values.license.secret }}
- name: license
secret:
secretName: {{ .Values.license.secret.name }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
command:
......@@ -68,6 +73,11 @@ spec:
mountPath: /etc/influxdb
- name: {{ include "influxdb-enterprise.fullname" . }}-data-data
mountPath: /var/lib/influxdb
{{- if .Values.license.secret }}
- name: license
mountPath: /var/run/secrets/influxdb/license.json
subPath: json
{{- end }}
resources:
{{- toYaml .Values.data.resources | nindent 12 }}
{{- with .Values.data.nodeSelector }}
......
......@@ -16,7 +16,7 @@ data:
license-key = "{{ .Values.license.key }}" #✨ mutually exclusive with license-path
{{ else }}
# license-key and license-path are mutually exclusive, use only one and leave the other blank
license-path = "/etc/influxdb/license.json"
license-path = "/var/run/secrets/influxdb/license.json"
{{ end }}
[meta]
......
......@@ -34,6 +34,11 @@ spec:
- name: config
configMap:
name: {{ include "influxdb-enterprise.fullname" . }}-meta
{{- if .Values.license.secret }}
- name: license
secret:
secretName: {{ .Values.license.secret.name }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
command:
......@@ -64,6 +69,11 @@ spec:
mountPath: /etc/influxdb
- name: {{ include "influxdb-enterprise.fullname" . }}-meta-data
mountPath: /var/lib/influxdb
{{- if .Values.license.secret }}
- name: license
mountPath: /var/run/secrets/influxdb/license.json
subPath: json
{{- end }}
resources:
{{- toYaml .Values.meta.resources | nindent 12 }}
{{- with .Values.meta.nodeSelector }}
......
......@@ -6,14 +6,14 @@ nameOverride: ""
fullnameOverride: ""
imagePullSecrets: []
license:
license: {}
# You can put your license key here for testing this chart out,
# but we STRONGLY recommend using a license file stored in a secret
# when you ship to production.
key: ""
#key: "your license key"
#secret:
#name: secretName
#key: fieldKey
# name: license
# key: json
meta:
replicas: 3
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment