Skip to content

Commit

Permalink
Helm chart: Fix ingress setup (#1086)
Browse files Browse the repository at this point in the history
* Helm chart: Fix ingress setup

The ingress part of the Helm chart contained references to
not-existing templates and values. Additionally, the deployment used
some no longer available health-check URLs which prevented it from
being marked as ready.

* Make readiness and liveness paths depend on the image.tag
  • Loading branch information
zerok authored and Aaron Schlesinger committed Mar 4, 2019
1 parent 8caad2b commit dbea277
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
6 changes: 6 additions & 0 deletions charts/athens-proxy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,9 @@
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "livenessPath" -}}
{{- if eq .Values.image.tag "v0.2.0" -}}/{{- else -}}/healthz{{- end -}}
{{- end -}}
{{- define "readinessPath" -}}
{{- if eq .Values.image.tag "v0.2.0" -}}/{{- else -}}/readyz{{- end -}}
{{- end -}}
4 changes: 2 additions & 2 deletions charts/athens-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
livenessProbe:
httpGet:
path: /healthz
path: "{{ template "livenessPath" . }}"
port: 3000
readinessProbe:
httpGet:
path: /readyz
path: "{{ template "readinessPath" . }}"
port: 3000
env:
- name: ATHENS_STORAGE_TYPE
Expand Down
6 changes: 3 additions & 3 deletions charts/athens-proxy/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{{- if .Values.ingress.enabled -}}
{{- $serviceName := include "fullname" . -}}
{{- $servicePort := .Values.service.externalPort -}}
{{- $servicePort := .Values.service.servicePort -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "blahblah.fullname" . }}
name: {{ template "fullname" . }}
labels:
app: {{ template "blahblah.name" . }}
app: {{ template "fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
Expand Down
2 changes: 1 addition & 1 deletion charts/athens-proxy/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
app: {{ template "fullname" . }}
ports:
- name: http
port: 80
port: {{ .Values.service.servicePort }}
targetPort: 3000
protocol: TCP
{{- if eq .Values.service.type "NodePort" }}
Expand Down
2 changes: 2 additions & 0 deletions charts/athens-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ image:
pullPolicy: Always

service:
## Port as exposed by the service
servicePort: 80
## Type of service; valid values are "ClusterIP", "LoadBalancer", and
## "NodePort". "ClusterIP" is sufficient in the case when the Proxy will be used
## from within the cluster. To expose externally, consider a "NodePort" or "LoadBalancer" service.
Expand Down

0 comments on commit dbea277

Please sign in to comment.