Skip to content

Commit

Permalink
Refactor config
Browse files Browse the repository at this point in the history
  • Loading branch information
thongdk8 committed Jan 10, 2025
1 parent cd2476b commit 78607d9
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 56 deletions.
8 changes: 4 additions & 4 deletions charts/scalar-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Current chart version is `3.0.0-SNAPSHOT`
| api.image.repository | string | `"ghcr.io/scalar-labs/scalar-manager-api"` | |
| api.image.tag | string | `""` | |
| api.resources | object | `{}` | |
| api.service.port | int | `8080` | |
| api.service.type | string | `"ClusterIP"` | |
| fullnameOverride | string | `""` | |
| imagePullSecrets[0].name | string | `"reg-docker-secrets"` | |
| nameOverride | string | `""` | |
Expand All @@ -27,10 +29,6 @@ Current chart version is `3.0.0-SNAPSHOT`
| securityContext.allowPrivilegeEscalation | bool | `false` | |
| securityContext.capabilities.drop[0] | string | `"ALL"` | |
| securityContext.runAsNonRoot | bool | `true` | |
| service.api.port | int | `8080` | |
| service.api.type | string | `"ClusterIP"` | |
| service.web.port | int | `80` | |
| service.web.type | string | `"ClusterIP"` | |
| serviceAccount.automountServiceAccountToken | bool | `true` | |
| serviceAccount.serviceAccountName | string | `""` | |
| tolerations | list | `[]` | |
Expand All @@ -41,3 +39,5 @@ Current chart version is `3.0.0-SNAPSHOT`
| web.image.tag | string | `""` | |
| web.operation.baseUrl | string | `"http://localhost:8080"` | |
| web.resources | object | `{}` | |
| web.service.port | int | `80` | |
| web.service.type | string | `"ClusterIP"` | |
8 changes: 4 additions & 4 deletions charts/scalar-manager/templates/scalar-manager/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ metadata:
labels:
{{- include "scalar-manager.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.web.type }}
type: {{ .Values.web.service.type }}
ports:
- protocol: TCP
name: web
port: {{ .Values.service.web.port }}
port: {{ .Values.web.service.port }}
targetPort: 3000
selector:
{{- include "scalar-manager.selectorLabels" . | nindent 4 }}
Expand All @@ -23,11 +23,11 @@ metadata:
labels:
{{- include "scalar-manager.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.api.type }}
type: {{ .Values.api.service.type }}
ports:
- protocol: TCP
name: api
port: {{ .Values.service.api.port }}
port: {{ .Values.api.service.port }}
targetPort: 8080
selector:
{{- include "scalar-manager.selectorLabels" . | nindent 4 }}
49 changes: 22 additions & 27 deletions charts/scalar-manager/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@
},
"resources": {
"type": "object"
},
"service": {
"type": "object",
"properties": {
"port": {
"type": "integer"
},
"type": {
"type": "string"
}
}
}
}
},
Expand Down Expand Up @@ -91,33 +102,6 @@
}
}
},
"service": {
"type": "object",
"properties": {
"api": {
"type": "object",
"properties": {
"port": {
"type": "integer"
},
"type": {
"type": "string"
}
}
},
"web": {
"type": "object",
"properties": {
"port": {
"type": "integer"
},
"type": {
"type": "string"
}
}
}
}
},
"serviceAccount": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -170,6 +154,17 @@
},
"resources": {
"type": "object"
},
"service": {
"type": "object",
"properties": {
"port": {
"type": "integer"
},
"type": {
"type": "string"
}
}
}
}
}
Expand Down
42 changes: 21 additions & 21 deletions charts/scalar-manager/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ nodeSelector: {}

tolerations: []

service:
web:
type: ClusterIP
port: 80
api:
type: ClusterIP
port: 8080

serviceAccount:
serviceAccountName: ""
automountServiceAccountToken: true
Expand All @@ -44,6 +36,10 @@ api:
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""

Check failure on line 39 in charts/scalar-manager/values.yaml

View workflow job for this annotation

GitHub Actions / lint-chart

39:1 [trailing-spaces] trailing spaces
service:
type: ClusterIP
port: 8080

resources:
{}
Expand Down Expand Up @@ -84,29 +80,29 @@ 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}
# 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:*}
# 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:*}
# 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}
# # Initial admin configuration, only need these configurations if persistence endpoints is enabled
# app.initial-admin-user.enabled=${APP_INITIAL_ADMIN_USER_ENABLED:false}
Expand All @@ -133,6 +129,10 @@ web:
# Overrides the image tag whose default is the chart appVersion.
tag: ""

service:
type: ClusterIP
port: 80

authorization:
# Whether to enable authorization or not for the web application, if enabled the login, user management page will be available
enabled: false
Expand Down

0 comments on commit 78607d9

Please sign in to comment.