Skip to content
This repository has been archived by the owner on Mar 22, 2024. It is now read-only.

Commit

Permalink
Improve tornjak service API to have object structure (#392)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofranssen committed Jul 19, 2023
1 parent 522066e commit 088b296
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
3 changes: 1 addition & 2 deletions charts/spire/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,7 @@ Now you can interact with the Spire agent socket from your own application. The
| spire-server.tornjak.image.version | string | `""` | This value is deprecated in favor of tag. (Will be removed in a future release) |
| spire-server.tornjak.resources | object | `{}` | |
| spire-server.tornjak.service.annotations | object | `{}` | |
| spire-server.tornjak.service.portHttp | int | `10080` | |
| spire-server.tornjak.service.portHttps | int | `10443` | |
| spire-server.tornjak.service.ports | object | `{"http":10080,"https":10443}` | Ports for tornjak |
| spire-server.tornjak.service.type | string | `"ClusterIP"` | |
| spire-server.tornjak.startupProbe.failureThreshold | int | `3` | |
| spire-server.tornjak.startupProbe.initialDelaySeconds | int | `5` | Initial delay seconds for |
Expand Down
3 changes: 1 addition & 2 deletions charts/spire/charts/spire-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,7 @@ In order to run Tornjak with simple HTTP Connection only, make sure you don't cr
| tornjak.image.version | string | `""` | This value is deprecated in favor of tag. (Will be removed in a future release) |
| tornjak.resources | object | `{}` | |
| tornjak.service.annotations | object | `{}` | |
| tornjak.service.portHttp | int | `10080` | |
| tornjak.service.portHttps | int | `10443` | |
| tornjak.service.ports | object | `{"http":10080,"https":10443}` | Ports for tornjak |
| tornjak.service.type | string | `"ClusterIP"` | |
| tornjak.startupProbe.failureThreshold | int | `3` | |
| tornjak.startupProbe.initialDelaySeconds | int | `5` | Initial delay seconds for |
Expand Down
10 changes: 5 additions & 5 deletions charts/spire/charts/spire-server/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ Tornjak runs without authentication and is therefore NOT suitable to run in prod
Only use in test environments!

Access Tornjak:
kubectl -n {{ include "spire-server.namespace" . }} port-forward service/{{ include "spire-tornjak.servicename" . }} {{ .Values.tornjak.service.portHttp }}:10080
kubectl -n {{ include "spire-server.namespace" . }} port-forward service/{{ include "spire-tornjak.servicename" . }} {{ .Values.tornjak.service.ports.http }}:10080
{{- if eq (include "spire-tornjak.connectionType" .) "http" }}
Open browser to: http://localhost:{{ .Values.tornjak.service.portHttp }}
Open browser to: http://localhost:{{ .Values.tornjak.service.ports.http }}
{{- else if eq (include "spire-tornjak.connectionType" .) "tls" }}
Open browser to: https://localhost:{{ .Values.tornjak.service.portHttps }}
Open browser to: https://localhost:{{ .Values.tornjak.service.ports.https }}

*** NOTE: You might get a security warning if using self-signed certificate
or use curl:

curl --cacert certs/ca.crt https://localhost:{{ .Values.tornjak.service.portHttps }}
curl --cacert certs/ca.crt https://localhost:{{ .Values.tornjak.service.ports.https }}
{{- if eq (include "spire-tornjak.connectionType" .) "mtls" }}

Or provide a client certificate and key to use mTLS authentication:

curl --cacert certs/ca.crt --key client.key --cert client.crt https://localhost:{{ .Values.tornjak.service.portHttps }}
curl --cacert certs/ca.crt --key client.key --cert client.crt https://localhost:{{ .Values.tornjak.service.ports.https }}
{{- end }}
{{- else }}
ERROR! Incorrect value selected for "Values.tornjak.config.connectionType"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ spec:
- name: curl-tornjak-backend
image: {{ template "spire-lib.image" (dict "image" .Values.tests.bash.image "global" .Values.global) }}
command: ['curl']
args: ['-k', '-s', '-f', 'http://{{ include "spire-tornjak.servicename" . }}.{{ include "spire-server.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.tornjak.service.portHttp }}/api/tornjak/serverinfo']
args: ['-k', '-s', '-f', 'http://{{ include "spire-tornjak.servicename" . }}.{{ include "spire-server.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.tornjak.service.ports.http }}/api/tornjak/serverinfo']
securityContext:
{{- toYaml .Values.securityContext | nindent 8 }}
- name: curl-tornjak-backend-and-spire
image: {{ template "spire-lib.image" (dict "image" .Values.tests.bash.image "global" .Values.global) }}
command: ['curl']
args: ['-k', '-s', '-f', 'http://{{ include "spire-tornjak.servicename" . }}.{{ include "spire-server.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.tornjak.service.portHttp }}/api/healthcheck']
args: ['-k', '-s', '-f', 'http://{{ include "spire-tornjak.servicename" . }}.{{ include "spire-server.namespace" . }}.svc.{{ include "spire-lib.cluster-domain" . }}:{{ .Values.tornjak.service.ports.http }}/api/healthcheck']
securityContext:
{{- toYaml .Values.securityContext | nindent 8 }}
restartPolicy: Never
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ spec:
{{- include "spire-server.selectorLabels" . | nindent 4 }}
ports:
- name: tornjak-srv-http
port: {{ .Values.tornjak.service.portHttp }}
port: {{ .Values.tornjak.service.ports.http }}
targetPort: tornjak-http
protocol: TCP
- name: tornjak-srv-https
port: {{ .Values.tornjak.service.portHttps }}
port: {{ .Values.tornjak.service.ports.https }}
targetPort: tornjak-https
protocol: TCP
{{- end }}
6 changes: 4 additions & 2 deletions charts/spire/charts/spire-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,10 @@ tornjak:

service:
type: ClusterIP
portHttp: 10080
portHttps: 10443
# -- Ports for tornjak
ports:
http: 10080
https: 10443
annotations: {}

startupProbe:
Expand Down

0 comments on commit 088b296

Please sign in to comment.