Skip to content

Commit

Permalink
[sophora-schema-docs]: update chart (#48)
Browse files Browse the repository at this point in the history
* remove support for static mode; add liveness and readiness probes; some cleanup in a few places

* remove unnecessary whitespace

* restore test values

* add missing extraEnv
  • Loading branch information
blizzy78 authored Oct 10, 2023
1 parent 8051136 commit b93784b
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 76 deletions.
22 changes: 2 additions & 20 deletions charts/sophora-schema-docs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
apiVersion: v2
name: sophora-schema-docs
description: A Helm chart for sophora schema docs

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
description: Sophora Schema Docs
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
version: 2.0.0
appVersion: 4.0.0

6 changes: 5 additions & 1 deletion charts/sophora-schema-docs/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Sophora Schema Docs

The Sophora Schema Docs module generates documentation of the document model of your Sophora repository.
The module [Sophora Schema Docs] generates a documentation of the document model of your Sophora Repository.



[Sophora Schema Docs]: https://subshell.com/sophora/modules/sophora-schema-docs100.html
2 changes: 1 addition & 1 deletion charts/sophora-schema-docs/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ metadata:
labels:
{{- include "sophora-schema-docs.labels" . | nindent 4 }}
data:
application.yaml: |- {{ toYaml (required "A valid application.yml config is required" .Values.sophora.configuration) | nindent 4 }}
application.yaml: |- {{ toYaml (required "A valid application.yaml config is required" .Values.sophora.configuration) | nindent 4 }}
53 changes: 30 additions & 23 deletions charts/sophora-schema-docs/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,54 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: schemadoc
- name: schema-docs
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
args:
{{if eq .Values.schemadocs.mode "static"}}
[ "--static", "--out", "/out/schemadocs" ]
{{else}}
[ "--dynamic" ]
{{end}}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["--dynamic"]
volumeMounts:
{{if eq (.Values.image.tag | default .Chart.AppVersion) "4.0.0" }}
- mountPath: /data
{{else}}
- mountPath: /config
{{end}}
name: config
- mountPath: /out
name: output-folder
- name: config
# 4.0.0 is the only version that uses WORKDIR /data
{{- if eq (.Values.image.tag | default .Chart.AppVersion) "4.0.0" }}
mountPath: /data/config
{{ else }}
mountPath: /config
{{ end -}}
readOnly: true
ports:
- name: http
containerPort: 8080
protocol: TCP
containerPort: 8080
env:
- name: JDK_JAVA_OPTIONS
value: {{ .Values.javaOptions }}
- name: SOPHORA_CLIENT_SERVERCONNECTION_USERNAME
valueFrom:
secretKeyRef:
key: {{ .Values.sophora.authentication.secret.usernameKey | quote }}
name: {{ required "A valid secret name must be provided in .Values.sophora.authentication.secret.name" .Values.sophora.authentication.secret.name | quote }}
key: {{ .Values.sophora.authentication.secret.usernameKey | quote }}
- name: SOPHORA_CLIENT_SERVERCONNECTION_PASSWORD
valueFrom:
secretKeyRef:
key: {{ .Values.sophora.authentication.secret.passwordKey | quote }}
name: {{ required "A valid secret name must be provided in .Values.sophora.authentication.secret.name" .Values.sophora.authentication.secret.name | quote }}
{{- if .Values.schemadocs.extraEnv }}
{{- toYaml .Values.schemadocs.extraEnv | nindent 12 }}
key: {{ .Values.sophora.authentication.secret.passwordKey | quote }}
{{- if .Values.schemaDocs.extraEnv }}
{{- toYaml .Values.schemaDocs.extraEnv | nindent 12 }}
{{- end }}
startupProbe:
httpGet:
port: http
path: /actuator/health/liveness
periodSeconds: 1
failureThreshold: 30
livenessProbe:
httpGet:
port: http
path: /actuator/health/liveness
readinessProbe:
httpGet:
port: http
path: /actuator/health/readiness
volumes:
- name: config
configMap:
name: {{ include "sophora-schema-docs.name" . }}
- name: output-folder
emptyDir: { }
name: {{ include "sophora-schema-docs.fullname" . }}
2 changes: 1 addition & 1 deletion charts/sophora-schema-docs/templates/extra-list.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- range .Values.extraDeploy }}
---
{{ include "common.tplvalues.render" (dict "value" . "context" $) }}
{{- end }}
{{- end }}
10 changes: 5 additions & 5 deletions charts/sophora-schema-docs/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
{{- include "sophora-schema-docs.selectorLabels" . | nindent 4 }}
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
- protocol: TCP
targetPort: http
protocol: TCP
name: http
selector:
{{- include "sophora-schema-docs.selectorLabels" . | nindent 4 }}
port: {{ .Values.service.clusterPort }}
nodePort: {{ .Values.service.nodePort }}
17 changes: 6 additions & 11 deletions charts/sophora-schema-docs/test-values.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
nameOverride: schemadoc
nameOverride: schema-docs

image:
repository: docker.subshell.com/sophora/schemadoc
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "latest"
tag: latest

imagePullSecrets:
- name: docker-subshell

sophora:
authentication:
secret:
name: "sophora-secret"
name: sophora-secret

configuration:
sophora:
client:
server-connection:
urls:
- 'http://sophora-server.example.com:1196'
- https://sophora-server.example.com:1196
username: # in secret
password: # in secret

schemadocs:
schemaDocs:
extraEnv:
- name: AAA
value: a-value
- name: BBB
value: b-value
mode: static

podAnnotations: {}

Expand All @@ -38,4 +33,4 @@ ingress:
ingressClassName: nginx
annotations: {}
hosts:
tls: []
tls: []
61 changes: 47 additions & 14 deletions charts/sophora-schema-docs/values.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,75 @@
# Settings for the Sophora server connection.
nameOverride: ""
fullnameOverride: ""

image:
repository: docker.subshell.com/sophora/schemadoc
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "latest"
tag: "4.0.0"

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""

javaOptions: "-XX:InitialRAMPercentage=50.0 -XX:MaxRAMPercentage=80.0 -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem"
javaOptions: -XX:+ExitOnOutOfMemoryError -XX:+PerfDisableSharedMem

sophora:

authentication:
secret:
name: ""
passwordKey: "password"
usernameKey: "username"
usernameKey: username
passwordKey: password

# Represents the application.yml of sophora schema docs:
# Represents the application.yaml of Sophora Schema Docs
configuration:
# Settings for the Sophora server connection.
sophora:
client:
server-connection:
urls: []
username: # in secret
password: # in secret

schemadocs:
# Settings for Sophora Schema Docs.
schema-doc:
# Settings for the repository.
repository:
# A descriptive label for the repository.
label: Example Repository

# (optional) Whether to include detailed information for scripts in the documentation.
# (default: false)
detailed-scripts: true

# (optional) Settings for nodetypes.
nodetypes:
# Settings for the 'example-nt:article' nodetype.
# Note: Nodetype names must be enclosed in square brackets.
'[example-nt:article]':
# (optional) Path to a SVG icon file for this nodetype.
# Note: The path must begin with 'icons/'
icon-path: icons/article.svg

# (optional) The Sophora ID of an example document for this nodetype.
# This document will be displayed in the documentation.
example-document: article-100

# (optional) Settings for field types.
field-types:
# Settings for the 'com.example.ExampleInputField' field type.
# Note: Field type names must be enclosed in square brackets.
'[com.example.ExampleInputField]':
# (optional) A descriptive label for this field type in German.
label.de: Beispielfeld

# (optional) A descriptive label for this field type in English.
label.en: Example Field

schemaDocs:
extraEnv:
mode:

service:
type: ClusterIP
port: 8080
type: NodePort
clusterPort: 8080
nodePort: 8080
annotations: {}

ingress:
Expand All @@ -48,4 +82,3 @@ ingress:
extraDeploy: []

podAnnotations: {}

0 comments on commit b93784b

Please sign in to comment.