diff --git a/charts/spire/README.md b/charts/spire/README.md index ae7b0f69f..8a0e83a5f 100644 --- a/charts/spire/README.md +++ b/charts/spire/README.md @@ -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 | diff --git a/charts/spire/charts/spire-server/README.md b/charts/spire/charts/spire-server/README.md index 3bd7f571d..f0208c3b8 100644 --- a/charts/spire/charts/spire-server/README.md +++ b/charts/spire/charts/spire-server/README.md @@ -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 | diff --git a/charts/spire/charts/spire-server/templates/NOTES.txt b/charts/spire/charts/spire-server/templates/NOTES.txt index 894053d42..8de0ce2b0 100644 --- a/charts/spire/charts/spire-server/templates/NOTES.txt +++ b/charts/spire/charts/spire-server/templates/NOTES.txt @@ -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" diff --git a/charts/spire/charts/spire-server/templates/tests/test-tornjak-connection.yaml b/charts/spire/charts/spire-server/templates/tests/test-tornjak-connection.yaml index 0cec8eebe..e35ab37e5 100644 --- a/charts/spire/charts/spire-server/templates/tests/test-tornjak-connection.yaml +++ b/charts/spire/charts/spire-server/templates/tests/test-tornjak-connection.yaml @@ -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 diff --git a/charts/spire/charts/spire-server/templates/tornjak-service.yaml b/charts/spire/charts/spire-server/templates/tornjak-service.yaml index d714a0c4d..6606861b2 100644 --- a/charts/spire/charts/spire-server/templates/tornjak-service.yaml +++ b/charts/spire/charts/spire-server/templates/tornjak-service.yaml @@ -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 }} diff --git a/charts/spire/charts/spire-server/values.yaml b/charts/spire/charts/spire-server/values.yaml index d54d21c5c..347202798 100644 --- a/charts/spire/charts/spire-server/values.yaml +++ b/charts/spire/charts/spire-server/values.yaml @@ -362,8 +362,10 @@ tornjak: service: type: ClusterIP - portHttp: 10080 - portHttps: 10443 + # -- Ports for tornjak + ports: + http: 10080 + https: 10443 annotations: {} startupProbe: