Skip to content

Commit

Permalink
refactor(api): improve doc
Browse files Browse the repository at this point in the history
  • Loading branch information
leroyguillaume committed Jul 27, 2024
1 parent 801a6f3 commit 8e04fd9
Show file tree
Hide file tree
Showing 8 changed files with 219 additions and 47 deletions.
9 changes: 1 addition & 8 deletions .config/orbstack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ smtp:
key: password

swaggerUi:
enabled: true

extraEnv:
- name: SWAGGER_JSON_URL
value: https://simpaas.k8s.orb.local/api/_doc
apiUrl: https://simpaas.k8s.orb.local/api/_doc

grafana:
grafana.ini:
Expand All @@ -33,6 +29,3 @@ simpaas:

ingress:
domain: *domain
additionalRules:
swagger-ui:
enabled: true
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ uuid = {version = "1", features = ["serde", "v4"]}
validator = {version = "0", features = ["derive"]}

[package]
description = "Platform as a Service (PaaS) based on Kubernetes and Helm."
edition = "2021"
name = "simpaas"
version = "0.1.0"
7 changes: 3 additions & 4 deletions charts/simpaas-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ helm install simpaas simpaas/simpaas-stack
## Minimal configuration

```yaml
swaggerUi:
apiUrl: https://simpaas.k8s.orb.local/api/_doc

grafana:
grafana.ini:
server:
Expand All @@ -21,7 +24,3 @@ simpaas:
ingress:
domain: *domain
```
## SwaggerUI
If you enable feature `swaggerUi`, you need to set environment variable `SWAGGER_JSON_URL` to OpenAPI endpoint (`/_doc`).
6 changes: 5 additions & 1 deletion charts/simpaas-stack/templates/swagger-ui/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,12 @@ spec:
readinessProbe:
{{ toYaml . | nindent 10 }}
{{- end }}
{{- with $env }}
env:
- name: BASE_URL
value: {{ .Values.swaggerUi.baseUrl }}
- name: SWAGGER_JSON_URL
value: {{ .Values.swaggerUi.apiUrl }}
{{- with $env }}
{{- toYaml . | nindent 8 }}
{{- end }}
resources:
Expand Down
9 changes: 5 additions & 4 deletions charts/simpaas-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ smtp:
readinessProbe: {}

swaggerUi:
enabled: &swaggerUiEnabled false
enabled: &swaggerUiEnabled true

replicas: 1

Expand All @@ -68,9 +68,7 @@ swaggerUi:
podSecurityContext: {}
securityContext: {}

env:
- name: BASE_URL
value: &swaggerUiPath /swagger-ui
env: []
extraEnv: []

resoures: {}
Expand All @@ -89,6 +87,9 @@ swaggerUi:
livenessProbe: {}
readinessProbe: {}

baseUrl: &swaggerUiPath /swagger-ui
apiUrl: ""

grafana:
enabled: &grafanaEnabled true

Expand Down
1 change: 1 addition & 0 deletions get-simpaas
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ spec:
EOF

install_chart $ns_simpaas simpaas $repo_simpaas/simpaas-stack \
--set "swaggerUi.baseUrl=https://$SIMPAAS_DOMAIN/api/_doc" \
--set-json "grafana={\"grafana.ini\":{\"server\":{\"domain\":\"$SIMPAAS_DOMAIN\"}}}" \
--set "simpaas.common.image.tag=$SIMPAAS_VERSION" \
--set-json "simpaas.ingress.annotations={\"cert-manager.io/cluster-issuer\":\"$issuer\"}" \
Expand Down
Loading

0 comments on commit 8e04fd9

Please sign in to comment.