Commit b849d424 authored by David McKay's avatar David McKay

feat: support license key file

parent ba3ef201
...@@ -16,7 +16,7 @@ data: ...@@ -16,7 +16,7 @@ data:
license-key = "{{ .Values.license.key }}" #✨ mutually exclusive with license-path license-key = "{{ .Values.license.key }}" #✨ mutually exclusive with license-path
{{ else }} {{ else }}
# license-key and license-path are mutually exclusive, use only one and leave the other blank # 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 }} {{ end }}
[meta] [meta]
...@@ -51,19 +51,12 @@ data: ...@@ -51,19 +51,12 @@ data:
my $protocol = $ENV{HTTP_PROTOCOL}; my $protocol = $ENV{HTTP_PROTOCOL};
my $meta_service = $ENV{RELEASE_NAME} . "-meta"; 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. # We're not going to define an exit strategy for failure here.
# This should be handled by the probes on the pods # This should be handled by the probes on the pods
while (true) { while (true) {
# There's no LWP/Simple available in our images, so forking out to curl 😥 # There's no LWP/Simple available in our images, so forking out to curl 😥
print "\n\n\nREGISTER WITH META SERVICE\n\n\n"; 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) { if ($exit_code == 0) {
...@@ -73,9 +66,7 @@ data: ...@@ -73,9 +66,7 @@ data:
print "\n\n\nFailed: $!\n\n\n"; print "\n\n\nFailed: $!\n\n\n";
$| = 1; $| = 1;
# Wait a few seconds and try again exit 255
# Maybe we should implement some rudamentary backoff
sleep(2);
} }
waitpid($pid, 0); waitpid($pid, 0);
......
...@@ -32,6 +32,11 @@ spec: ...@@ -32,6 +32,11 @@ spec:
- name: config - name: config
configMap: configMap:
name: {{ include "influxdb-enterprise.fullname" . }}-data name: {{ include "influxdb-enterprise.fullname" . }}-data
{{- if .Values.license.secret }}
- name: license
secret:
secretName: {{ .Values.license.secret.name }}
{{- end }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
command: command:
...@@ -68,6 +73,11 @@ spec: ...@@ -68,6 +73,11 @@ spec:
mountPath: /etc/influxdb mountPath: /etc/influxdb
- name: {{ include "influxdb-enterprise.fullname" . }}-data-data - name: {{ include "influxdb-enterprise.fullname" . }}-data-data
mountPath: /var/lib/influxdb mountPath: /var/lib/influxdb
{{- if .Values.license.secret }}
- name: license
mountPath: /var/run/secrets/influxdb/license.json
subPath: json
{{- end }}
resources: resources:
{{- toYaml .Values.data.resources | nindent 12 }} {{- toYaml .Values.data.resources | nindent 12 }}
{{- with .Values.data.nodeSelector }} {{- with .Values.data.nodeSelector }}
......
...@@ -16,7 +16,7 @@ data: ...@@ -16,7 +16,7 @@ data:
license-key = "{{ .Values.license.key }}" #✨ mutually exclusive with license-path license-key = "{{ .Values.license.key }}" #✨ mutually exclusive with license-path
{{ else }} {{ else }}
# license-key and license-path are mutually exclusive, use only one and leave the other blank # 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 }} {{ end }}
[meta] [meta]
......
...@@ -34,6 +34,11 @@ spec: ...@@ -34,6 +34,11 @@ spec:
- name: config - name: config
configMap: configMap:
name: {{ include "influxdb-enterprise.fullname" . }}-meta name: {{ include "influxdb-enterprise.fullname" . }}-meta
{{- if .Values.license.secret }}
- name: license
secret:
secretName: {{ .Values.license.secret.name }}
{{- end }}
containers: containers:
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
command: command:
...@@ -64,6 +69,11 @@ spec: ...@@ -64,6 +69,11 @@ spec:
mountPath: /etc/influxdb mountPath: /etc/influxdb
- name: {{ include "influxdb-enterprise.fullname" . }}-meta-data - name: {{ include "influxdb-enterprise.fullname" . }}-meta-data
mountPath: /var/lib/influxdb mountPath: /var/lib/influxdb
{{- if .Values.license.secret }}
- name: license
mountPath: /var/run/secrets/influxdb/license.json
subPath: json
{{- end }}
resources: resources:
{{- toYaml .Values.meta.resources | nindent 12 }} {{- toYaml .Values.meta.resources | nindent 12 }}
{{- with .Values.meta.nodeSelector }} {{- with .Values.meta.nodeSelector }}
......
...@@ -6,14 +6,14 @@ nameOverride: "" ...@@ -6,14 +6,14 @@ nameOverride: ""
fullnameOverride: "" fullnameOverride: ""
imagePullSecrets: [] imagePullSecrets: []
license: license: {}
# You can put your license key here for testing this chart out, # You can put your license key here for testing this chart out,
# but we STRONGLY recommend using a license file stored in a secret # but we STRONGLY recommend using a license file stored in a secret
# when you ship to production. # when you ship to production.
key: "" #key: "your license key"
#secret: #secret:
#name: secretName # name: license
#key: fieldKey # key: json
meta: meta:
replicas: 3 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