Skip to content

Commit

Permalink
Support HTTP (#10)
Browse files Browse the repository at this point in the history
* Allow services to be exposed via HTTP.

The use of the `default` function had the unintended side-effect of
never allowing the value to be `false`.

See the following for more details:
- [helm/helm#3308](helm/helm#3308)
- [Masterminds/sprig#111](Masterminds/sprig#111)
- [Default Functions](http://masterminds.github.io/sprig/defaults.html)

* Release info: v1.0.2-r6
  • Loading branch information
jbeard6 committed Sep 25, 2023
1 parent 4d79137 commit 03550da
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ name: tonic
description: A Helm chart for Tonic and EKS
type: application

version: "1.0.2-r4"
version: "1.0.2-r6"

appVersion: "130"
2 changes: 1 addition & 1 deletion templates/tonic-web-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{- end }}
{{- end }}
{{- $ports := ((.Values.tonicai).web_server).ports | default dict }}
{{- $httpsOnly := $ports.httpsOnly | default true }}
{{- $httpsOnly := hasKey $ports "httpsOnly" | ternary $ports.httpsOnly true }}
{{- $httpPort := $ports.http | default 6580 }}
{{- $httpsPort := $ports.https | default 6543 }}
apiVersion: apps/v1
Expand Down
7 changes: 7 additions & 0 deletions templates/tonic-web-server-service.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{{- $ports := ((.Values.tonicai).web_server).ports | default dict }}
{{- $httpsOnly := hasKey $ports "httpsOnly" | ternary $ports.httpsOnly true }}
{{- $httpPort := $ports.http | default 6580 }}
{{- $httpsPort := $ports.https | default 6543 }}
apiVersion: v1
kind: Service
Expand All @@ -21,6 +23,11 @@ metadata:
app: tonic-web-server
spec:
ports:
{{- if not $httpsOnly }}
- name: "http"
port: 80
targetPort: {{ $httpPort }}
{{- end }}
- name: "https"
port: 443
targetPort: {{ $httpsPort }}
Expand Down
2 changes: 1 addition & 1 deletion templates/tonic-worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
{{- end }}
{{- end }}
{{- $ports := ((.Values.tonicai).worker).ports | default dict }}
{{- $httpsOnly := $ports.httpsOnly | default true }}
{{- $httpsOnly := hasKey $ports "httpsOnly" | ternary $ports.httpsOnly true }}
{{- $httpPort := $ports.http | default 2480 }}
{{- $httpsPort := $ports.https | default 2467 }}
apiVersion: apps/v1
Expand Down
2 changes: 1 addition & 1 deletion templates/tonic-worker-service.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- $workerPorts := ((.Values.tonicai).worker).ports | default dict }}
{{- $httpsOnly := $workerPorts.httpsOnly | default true }}
{{- $httpsOnly := hasKey $workerPorts "httpsOnly" | ternary $workerPorts.httpsOnly true }}
{{- $httpPort := $workerPorts.http | default 2480 }}
{{- $httpsPort := $workerPorts.https | default 2467 }}
apiVersion: v1
Expand Down

0 comments on commit 03550da

Please sign in to comment.