Skip to content

Commit

Permalink
Auto tornjak url (#89)
Browse files Browse the repository at this point in the history
* Autogen jwtIssuer

Unset a default for jwtIssuer and global.spire.jwtIssuer. When unset,
generate it to the default of oidc-discovery.$trustDomain so in many
cases the user doesn't need to set it at all.

Signed-off-by: Kevin Fox <[email protected]>

* Autogen tornjak's apiServerURL

Unset the default tornjak apiServerURL. When unset, default to
https://tornjak-backend.$trustDomain so in many cases users don't
have to set it.

Signed-off-by: Kevin Fox <[email protected]>

* Do more autodetection

Signed-off-by: Kevin Fox <[email protected]>

* Apply suggestions from code review

Co-authored-by: Faisal Memon <[email protected]>
Signed-off-by: kfox1111 <[email protected]>

* Fix docs

Signed-off-by: Kevin Fox <[email protected]>

---------

Signed-off-by: Kevin Fox <[email protected]>
Signed-off-by: kfox1111 <[email protected]>
Co-authored-by: Mariusz Sabath <[email protected]>
Co-authored-by: Faisal Memon <[email protected]>
  • Loading branch information
3 people authored Nov 9, 2023
1 parent f2758a8 commit 6c0a4fb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/spire/charts/tornjak-frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ port forwarding. See the chart NOTES output for more details.
| `affinity` | Affinity rules | `{}` |
| `tolerations` | List of tolerations | `[]` |
| `topologySpreadConstraints` | List of topology spread constraints for resilience | `[]` |
| `apiServerURL` | URL of the Tornjak APIs (backend). Since Tornjak Frontend runs in the browser, this URL must be accessible from the machine running a browser. | `http://localhost:10000/` |
| `apiServerURL` | URL of the Tornjak APIs (backend). Since Tornjak Frontend runs in the browser, this URL must be accessible from the machine running a browser. If unset, autodetection is atempted. | `""` |
| `spireHealthCheck.enabled` | Enables the SPIRE Healthchecker indicator | `true` |
| `startupProbe.enabled` | Enable startupProbe on Tornjak frontend container | `true` |
| `startupProbe.initialDelaySeconds` | Initial delay seconds for startupProbe | `5` |
Expand Down
5 changes: 3 additions & 2 deletions charts/spire/charts/tornjak-frontend/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ Create URL for accessing Tornjak APIs
{{- define "tornjak-frontend.apiURL" -}}
{{- if .Values.apiServerURL -}}
{{- .Values.apiServerURL -}}
{{- else if .Values.ingress.enabled }}
{{- printf "https://tornjak-backend.%s" (include "spire-lib.trust-domain" .) }}
{{- else }}
{{- $feurl := print "http://localhost:" .Values.service.port }}
{{- $feurl }}
{{- print "http://localhost:" .Values.service.port }}
{{- end }}
{{- end }}
4 changes: 2 additions & 2 deletions charts/spire/charts/tornjak-frontend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ topologySpreadConstraints: []
# cpu: 100m
# memory: 512Mi

## @param apiServerURL URL of the Tornjak APIs (backend). Since Tornjak Frontend runs in the browser, this URL must be accessible from the machine running a browser.
apiServerURL: "http://localhost:10000/" # 👈 Use it for minikube or kind
## @param apiServerURL URL of the Tornjak APIs (backend). Since Tornjak Frontend runs in the browser, this URL must be accessible from the machine running a browser. If unset, autodetection is atempted.
apiServerURL: ""

# SPIRE Healthchecker indicator
spireHealthCheck:
Expand Down
4 changes: 0 additions & 4 deletions examples/production/example-your-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,3 @@ spire-server:
# ingress:
# host: oidc-discovery
# tlsSecret: tls-cert

tornjak-frontend:
apiServerURL: https://tornjak-backend.production.other/

1 change: 0 additions & 1 deletion examples/tornjak/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ tornjak-frontend:
service:
type: ClusterIP
port: 3000
apiServerURL: "http://localhost:10000/"
resources:
requests:
cpu: 50m
Expand Down

0 comments on commit 6c0a4fb

Please sign in to comment.