From b93784b0bb00e564df68f5e37a6d46fe4a360357 Mon Sep 17 00:00:00 2001 From: Maik Schreiber Date: Tue, 10 Oct 2023 16:53:12 +0200 Subject: [PATCH] [sophora-schema-docs]: update chart (#48) * 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 --- charts/sophora-schema-docs/Chart.yaml | 22 +------ charts/sophora-schema-docs/README.md | 6 +- .../templates/configmap.yaml | 2 +- .../templates/deployment.yaml | 53 +++++++++------- .../templates/extra-list.yaml | 2 +- .../templates/service.yaml | 10 +-- charts/sophora-schema-docs/test-values.yaml | 17 ++---- charts/sophora-schema-docs/values.yaml | 61 ++++++++++++++----- 8 files changed, 97 insertions(+), 76 deletions(-) diff --git a/charts/sophora-schema-docs/Chart.yaml b/charts/sophora-schema-docs/Chart.yaml index 14627bc..cca374e 100644 --- a/charts/sophora-schema-docs/Chart.yaml +++ b/charts/sophora-schema-docs/Chart.yaml @@ -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 - diff --git a/charts/sophora-schema-docs/README.md b/charts/sophora-schema-docs/README.md index e487318..dcbdfa4 100644 --- a/charts/sophora-schema-docs/README.md +++ b/charts/sophora-schema-docs/README.md @@ -1,3 +1,7 @@ # Sophora Schema Docs -The Sophora Schema Docs module generates documentation of the document model of your Sophora repository. \ No newline at end of file +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 diff --git a/charts/sophora-schema-docs/templates/configmap.yaml b/charts/sophora-schema-docs/templates/configmap.yaml index b4beda5..c7d440d 100644 --- a/charts/sophora-schema-docs/templates/configmap.yaml +++ b/charts/sophora-schema-docs/templates/configmap.yaml @@ -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 }} \ No newline at end of file + application.yaml: |- {{ toYaml (required "A valid application.yaml config is required" .Values.sophora.configuration) | nindent 4 }} diff --git a/charts/sophora-schema-docs/templates/deployment.yaml b/charts/sophora-schema-docs/templates/deployment.yaml index 70f1c2c..de0c283 100644 --- a/charts/sophora-schema-docs/templates/deployment.yaml +++ b/charts/sophora-schema-docs/templates/deployment.yaml @@ -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: { } \ No newline at end of file + name: {{ include "sophora-schema-docs.fullname" . }} diff --git a/charts/sophora-schema-docs/templates/extra-list.yaml b/charts/sophora-schema-docs/templates/extra-list.yaml index 6edc87b..9ac65f9 100644 --- a/charts/sophora-schema-docs/templates/extra-list.yaml +++ b/charts/sophora-schema-docs/templates/extra-list.yaml @@ -1,4 +1,4 @@ {{- range .Values.extraDeploy }} --- {{ include "common.tplvalues.render" (dict "value" . "context" $) }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/sophora-schema-docs/templates/service.yaml b/charts/sophora-schema-docs/templates/service.yaml index b28c5d6..eb76df6 100644 --- a/charts/sophora-schema-docs/templates/service.yaml +++ b/charts/sophora-schema-docs/templates/service.yaml @@ -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 }} diff --git a/charts/sophora-schema-docs/test-values.yaml b/charts/sophora-schema-docs/test-values.yaml index d3e8ebe..1a6036b 100644 --- a/charts/sophora-schema-docs/test-values.yaml +++ b/charts/sophora-schema-docs/test-values.yaml @@ -1,10 +1,10 @@ -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 @@ -12,24 +12,19 @@ imagePullSecrets: 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: {} @@ -38,4 +33,4 @@ ingress: ingressClassName: nginx annotations: {} hosts: - tls: [] \ No newline at end of file + tls: [] diff --git a/charts/sophora-schema-docs/values.yaml b/charts/sophora-schema-docs/values.yaml index 20a3f47..5232c7f 100644 --- a/charts/sophora-schema-docs/values.yaml +++ b/charts/sophora-schema-docs/values.yaml @@ -1,27 +1,26 @@ -# 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: @@ -29,13 +28,48 @@ sophora: 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: @@ -48,4 +82,3 @@ ingress: extraDeploy: [] podAnnotations: {} -