Skip to content

Commit

Permalink
Rework server host logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Eckert committed Nov 10, 2022
1 parent b5730b3 commit d4c0da2
Showing 1 changed file with 22 additions and 7 deletions.
29 changes: 22 additions & 7 deletions charts/consul/templates/api-gateway-controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,34 @@ spec:
value: "/consul/login/acl-token"
{{- end }}
- name: CONSUL_HTTP_ADDR
{{- if and .Values.externalServers.enabled (not .Values.client.enabled) }}
{{- if .Values.client.enabled }}
{{/*
We use client agent nodes if we have them to support backwards compatibility in <=0.4 releases which
require connectivity between the registered Consul agent node and a deployment for health checking
(originating from the Consul node). Always leveraging the agents in the case that they're explicitly
opted into allows us to support users with agent node + "externalServers" configuration upgrading a
helm chart without upgrading api gateways. Otherwise, using "externalServers" when provided
without local agents will break gateways <=0.4.
*/}}
{{- if .Values.global.tls.enabled }}
value: {{ first .Values.externalServers.hosts }}:{{ .Values.externalServers.httpsPort }}
value: $(HOST_IP):8501
{{- else }}
value: {{ first .Values.externalServers.hosts }}:{{ .Values.externalServers.httpPort }}
value: $(HOST_IP):8500
{{- end }}
{{- else if and (not .Values.externalServers.enabled) .Values.client.enabled }}
{{- else if .Values.externalServers.enabled }}
{{/*
"externalServers" specified and running in "agentless" mode, this will only work 0.5+
*/}}
{{- if .Values.global.tls.enabled }}
value: $(HOST_IP):8501
value: {{ first .Values.externalServers.hosts }}:{{ .Values.externalServers.httpsPort }}
{{- else }}
value: $(HOST_IP):8500
value: {{ first .Values.externalServers.hosts }}:{{ .Values.externalServers.httpPort }}
{{- end }}
{{- else }} # Internal servers, no clients
{{- else }}
{{/*
We have local network connectivity between deployments and the internal cluster, this
should be supported in all versions of api-gateway
*/}}
{{- if .Values.global.tls.enabled }}
value: {{ template "consul.fullname" . }}-server:8501
{{- else }}
Expand Down

0 comments on commit d4c0da2

Please sign in to comment.