-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add auth config for scalar manager #280
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,33 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "scalar-manager.fullname" . }} | ||
name: {{ include "scalar-manager.fullname" . }}-web | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "scalar-manager.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
type: {{ .Values.service.web.type }} | ||
ports: | ||
- protocol: TCP | ||
name: web | ||
port: {{ .Values.service.port }} | ||
port: {{ .Values.service.web.port }} | ||
targetPort: 3000 | ||
selector: | ||
{{- include "scalar-manager.selectorLabels" . | nindent 4 }} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
Comment on lines
+18
to
+19
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a service for API in case we want to expose the API for cross Scalar Manager authentication There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I don't know the details of So, could you please elaborate on the details of I am not able to judge whether this service resource is necessary or not and configuration is proper or not without the detailed information of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, let me explain it a bit more based on the current spec we have. |
||
metadata: | ||
name: {{ include "scalar-manager.fullname" . }}-api | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
{{- include "scalar-manager.labels" . | nindent 4 }} | ||
spec: | ||
type: {{ .Values.service.api.type }} | ||
ports: | ||
- protocol: TCP | ||
name: api | ||
port: {{ .Values.service.api.port }} | ||
targetPort: 8080 | ||
selector: | ||
{{- include "scalar-manager.selectorLabels" . | nindent 4 }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,8 +27,12 @@ nodeSelector: {} | |
tolerations: [] | ||
|
||
service: | ||
type: ClusterIP | ||
port: 80 | ||
Comment on lines
-30
to
-31
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this update breaks backward compatibility. This is because the existing configuration Is my understanding correct? Also, if this backward incompatible update is intended, do you expect to release this new update as a new major version release? I want to confirm it, just in case. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, it will break the backward compatibility as the config will be moved under the |
||
web: | ||
type: ClusterIP | ||
port: 80 | ||
api: | ||
type: ClusterIP | ||
port: 8080 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it might be more understandable for users to use This is because Scalar Manager Web and Scalar Manager API are deployed as different containers respectively. (I know they are deployed in one pod, but the components are separated in the pod.) Also, I think it would be better to combine Scalar Manager Web configurations under the What do you think? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the suggestion, that makes sense. Let me refactor them. |
||
|
||
serviceAccount: | ||
serviceAccountName: "" | ||
|
@@ -80,12 +84,65 @@ api: | |
paused-state-retention.storage=${PAUSED_STATE_RETENTION_STORAGE:configmap} | ||
paused-state-retention.max-number=${PAUSED_STATE_RETENTION_MAX_NUMBER:100} | ||
|
||
# JWT configuration | ||
# P-256 (secp256k1) private key in PKCS8 format, using for signing JWT tokens, required when persistence endpoints are enabled | ||
authentication.providers.static-jwt.private-key=${AUTHENTICATION_PROVIDERS_STATIC_JWT_PRIVATE_KEY:} | ||
# Public key in X.509/SPKI format using for verifying JWT tokens, when authentication is enabled, this key is used for verifying JWT tokens | ||
authentication.providers.static-jwt.public-key=${AUTHENTICATION_PROVIDERS_STATIC_JWT_PUBLIC_KEY:} | ||
authentication.providers.static-jwt.issuer-uri=${AUTHENTICATION_PROVIDERS_STATIC_JWT_ISSUER_URI:https://scalar-manager.scalar-labs.com} | ||
authentication.providers.static-jwt.access-token-expiration-time=${AUTHENTICATION_PROVIDERS_STATIC_JWT_ACCESS_TOKEN_EXPIRATION_TIME:15m} | ||
authentication.providers.static-jwt.refresh-token-expiration-time=${AUTHENTICATION_PROVIDERS_STATIC_JWT_REFRESH_TOKEN_EXPIRATION_TIME:3d} | ||
|
||
# OpenAPI configuration | ||
springdoc.swagger-ui.enabled=${SPRINGDOC_SWAGGER_UI_ENABLED:false} | ||
springdoc.swagger-ui.path=${SPRINGDOC_SWAGGER_UI_PATH:/swagger-ui.html} | ||
|
||
# Whether to enable persistence endpoints or not (auth, user management) | ||
app.persistence-endpoints.enabled=${APP_PERSISTENCE_ENDPOINTS_ENABLED:false} | ||
|
||
# Whether to enable authorization or not for the operational endpoints | ||
app.authorization.enabled=${APP_AUTHORIZATION_ENABLED:false} | ||
|
||
# CORS configuration | ||
app.cors.allowed-origins=${APP_CORS_ALLOWED_ORIGINS:*} | ||
app.cors.allowed-methods=${APP_CORS_ALLOWED_METHODS:*} | ||
app.cors.allowed-headers=${APP_CORS_ALLOWED_HEADERS:*} | ||
|
||
# # Initial admin configuration, only need these configurations if persistence endpoints is enabled | ||
# app.initial-admin-user.enabled=${APP_INITIAL_ADMIN_USER_ENABLED:false} | ||
# app.initial-admin-user.email=${APP_INITIAL_ADMIN_USER_EMAIL:[email protected]} | ||
# app.initial-admin-user.name=${APP_INITIAL_ADMIN_USER_NAME:Administrator} | ||
# app.initial-admin-user.password=${APP_INITIAL_ADMIN_USER_PASSWORD:Password@123!} | ||
|
||
# # JPA configuration, only need these configurations if persistence endpoints is enabled | ||
# spring.jpa.hibernate.ddl-auto=${SPRING_JPA_HIBERNATE_DDL_AUTO:update} | ||
# spring.jpa.show-sql=${SPRING_JPA_SHOW_SQL:false} | ||
# spring.jpa.properties.hibernate.format_sql=${SPRING_JPA_PROPERTIES_HIBERNATE_FORMAT_SQL:false} | ||
|
||
# # Database configuration, only need these configurations if persistence endpoints is enabled | ||
# spring.datasource.url=jdbc:postgresql://${DATABASE_HOST:scalar-manager-postgres-postgresql}:${DATABASE_PORT:5432}/${DATABASE_NAME:scalar-manager} | ||
# spring.datasource.username=${DATABASE_USERNAME:scalar-manager} | ||
# spring.datasource.password=${DATABASE_PASSWORD:scalar-manager} | ||
# spring.datasource.driver-class-name=org.postgresql.Driver | ||
|
||
|
||
web: | ||
image: | ||
repository: ghcr.io/scalar-labs/scalar-manager-web | ||
pullPolicy: IfNotPresent | ||
# Overrides the image tag whose default is the chart appVersion. | ||
tag: "" | ||
|
||
authorization: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the Is there any reason why you use the term Sorry if I missed something, but I think it would be better to use the same term There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually in the |
||
# Whether to enable authorization or not for the web application, if enabled the login, user management page will be available | ||
enabled: false | ||
# The base URL of the authorization service, default is same as the scalar-manager-api service | ||
baseUrl: http://localhost:8080 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the case of the API service running in the same pod with Scalar Manager web doesn't have the persistent endpoints enabled then we can config this |
||
|
||
operation: | ||
# The base URL of the operation service, default is same as the scalar-manager-api service | ||
baseUrl: http://localhost:8080 | ||
|
||
resources: | ||
{} | ||
# We usually recommend not to specify default resources and to leave this as a conscious | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are these environment variables mandatory?
Listing a lot of environment variables here might cause increasing maintenance costs for Helm Chart. This is my concern.
So, I think it would be better to set configurations via
application.properties
instead of environment variables. In such a case, we might not need to update the Helm Chart even if you add/change some configurations on the Scalar Manager side. It can reduce the maintenance costs in the future.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These environment variables are mandatory, but they are for the
web
container. For theapi
container we still keep the config in theapplication.properties
as it was.The config for the web container would not be many I think, for now we will have these new three vars.