Commit 504217d5 authored by David McKay's avatar David McKay

feat(enterprise): clean up startup and discovery

parent bafe7447
...@@ -48,23 +48,30 @@ data: ...@@ -48,23 +48,30 @@ data:
$SIG{KILL} = sub { kill 'KILL', $pid }; $SIG{KILL} = sub { kill 'KILL', $pid };
# Register data node with meta leader # Register data node with meta leader
my $meta_leader = $ENV{INFLUXDB_HOSTNAME}; my $protocol = $ENV{HTTP_PROTOCOL};
$meta_leader =~ s/-[0-9]+./-0./; my $meta_service = $ENV{RELEASE_NAME} . "-meta";
$meta_leader =~ s/data/meta/g;
# 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 "Attempting to register with meta service ...\n"; print "\n\n\nREGISTER WITH META SERVICE\n\n\n";
system('echo', 'curl', '-XPOST', "-Faddr=$ENV{INFLUXDB_HOSTNAME}:8088", "http://idb-meta:8091/add-data"); $exit_code = system('curl', '-H', 'Expect:', '-XPOST', '-v', '--silent', '--fail', "-Faddr=$ENV{INFLUXDB_HOSTNAME}:8088", "$protocol://$meta_service:8091/add-data");
system('curl', '-XPOST', "-Faddr=$ENV{INFLUXDB_HOSTNAME}:8088", "http://idb-meta:8091/add-data");
if ($? == 0) { if ($exit_code == 0) {
print "Success\n"; $| = 1;
last; last;
} }
print "Failed: $!\n"; print "\n\n\nFailed: $!\n\n\n";
$| = 1;
# Wait a few seconds and try again # Wait a few seconds and try again
# Maybe we should implement some rudamentary backoff # Maybe we should implement some rudamentary backoff
......
...@@ -42,6 +42,11 @@ spec: ...@@ -42,6 +42,11 @@ spec:
{{- toYaml .Values.data.securityContext | nindent 12 }} {{- toYaml .Values.data.securityContext | nindent 12 }}
image: "{{ .Values.data.image.repository | default "influxdb" }}:{{ .Values.data.image.tag | default (printf "%s-%s" .Chart.AppVersion "data") }}" image: "{{ .Values.data.image.repository | default "influxdb" }}:{{ .Values.data.image.tag | default (printf "%s-%s" .Chart.AppVersion "data") }}"
imagePullPolicy: {{ .Values.data.image.pullPolicy }} imagePullPolicy: {{ .Values.data.image.pullPolicy }}
env:
- name: HTTP_PROTOCOL
value: http
- name: RELEASE_NAME
value: {{ include "influxdb-enterprise.fullname" . }}
ports: ports:
- name: http - name: http
containerPort: 8088 containerPort: 8088
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
# This is a YAML-formatted file. # This is a YAML-formatted file.
# Declare variables to be passed into your templates. # Declare variables to be passed into your templates.
nameOverride: "idb" nameOverride: ""
fullnameOverride: "idb" fullnameOverride: ""
imagePullSecrets: [] imagePullSecrets: []
license: license:
......
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