Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
"charts/nodejs": "0.3.2",
"charts/pachyderm": "0.3.0",
"charts/postgrest": "0.7.0",
"charts/openldap": "1.3.0"
"charts/openldap": "1.3.0",
"charts/xapi-lrs": "0.1.0"
}
23 changes: 23 additions & 0 deletions charts/xapi-lrs/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
23 changes: 23 additions & 0 deletions charts/xapi-lrs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: v2
name: xapi-lrs
description: xapi-lrs Learning Record Store helm chart
type: application
home: https://github.com/pelotech/xapi-lrs
sources:
- https://github.com/pelotech/xapi-lrs
keywords:
- xapi
- lrs
- learning-record-store
- tin-can

# 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: 0.1.0

# 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.
# It is recommended to use it with quotes.
appVersion: "0.7.1"
131 changes: 131 additions & 0 deletions charts/xapi-lrs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# xapi-lrs

### version: 0.1.0<!-- x-release-please-version -->

![AppVersion: 0.7.1](https://img.shields.io/badge/AppVersion-0.7.1-informational?style=flat-square)

xapi-lrs Learning Record Store helm chart

**Homepage:** <https://github.com/pelotech/xapi-lrs>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| auth.adminPassword | string | `""` | |
| auth.adminUser | string | `"admin"` | |
| auth.apiKey | string | `""` | |
| auth.apiSecret | string | `""` | |
| auth.existingSecret | string | `""` | |
| auth.existingSecretKeys.adminPassword | string | `"admin-password"` | |
| auth.existingSecretKeys.apiSecret | string | `"api-secret"` | |
| auth.existingSecretKeys.migrationPostgresqlPassword | string | `"migration-postgresql-password"` | |
| auth.existingSecretKeys.postgresqlPassword | string | `"postgresql-password"` | |
| auth.existingSecretKeys.sessionSecret | string | `"session-secret"` | |
| auth.sessionSecret | string | `""` | |
| automountServiceAccountToken | bool | `false` | |
| commonAnnotations | object | `{}` | |
| containerPorts.admin | int | `8091` | |
| containerPorts.http | int | `8081` | |
| cors.enabled | bool | `false` | |
| cors.origin | string | `""` | |
| database.driver | string | `"pg"` | |
| database.postgresql.database | string | `"xapi_lrs"` | |
| database.postgresql.host | string | `"postgres"` | |
| database.postgresql.password | string | `""` | |
| database.postgresql.port | int | `5432` | |
| database.postgresql.url | string | `""` | |
| database.postgresql.user | string | `"xapi_lrs"` | |
| enableServiceLinks | bool | `false` | |
| extraEnvVars | list | `[]` | |
| extraEnvVarsCM | string | `""` | |
| extraEnvVarsSecret | string | `""` | |
| fullnameOverride | string | `""` | |
| gateway.enabled | bool | `false` | |
| gateway.hostname | string | `""` | |
| gateway.httpRoute.annotations | object | `{}` | |
| gateway.httpRoute.extraHostnames | list | `[]` | |
| gateway.httpRoute.gatewayName | string | `""` | |
| gateway.httpRoute.gatewayNamespace | string | `""` | |
| gateway.httpRoute.path | string | `"/"` | |
| gateway.httpRoute.pathType | string | `"PathPrefix"` | |
| gateway.httpRoute.port | string | `""` | |
| gateway.httpRoute.rules | list | `[]` | |
| gateway.httpRoute.sectionName | string | `""` | |
| gateway.listenerSet.annotations | object | `{}` | |
| gateway.listenerSet.enabled | bool | `false` | |
| gateway.listenerSet.gatewayName | string | `""` | |
| gateway.listenerSet.gatewayNamespace | string | `""` | |
| gateway.listenerSet.https.enabled | bool | `true` | |
| gateway.listenerSet.https.secretName | string | `""` | |
| gateway.listenerSet.listeners | list | `[]` | |
| image.digest | string | `"sha256:5edc504b19375c5b19e7e3289308d227fb6b219f6226488d1360ff0c8e5d87ac"` | |
| image.pullPolicy | string | `"IfNotPresent"` | |
| image.pullSecrets | list | `[]` | |
| image.registry | string | `"ghcr.io"` | |
| image.repository | string | `"pelotech/xapi-lrs"` | |
| image.tag | string | `"0.7.1"` | |
| ingress.annotations | object | `{}` | |
| ingress.enabled | bool | `false` | |
| ingress.extraHosts | list | `[]` | |
| ingress.extraPaths | list | `[]` | |
| ingress.extraTls | list | `[]` | |
| ingress.hostname | string | `"xapi-lrs.local"` | |
| ingress.ingressClassName | string | `""` | |
| ingress.path | string | `"/"` | |
| ingress.pathType | string | `"ImplementationSpecific"` | |
| ingress.tls | bool | `false` | |
| livenessProbe.httpGet.path | string | `"/healthz"` | |
| livenessProbe.httpGet.port | string | `"admin"` | |
| livenessProbe.initialDelaySeconds | int | `10` | |
| livenessProbe.periodSeconds | int | `10` | |
| logLevel | string | `"info"` | |
| metrics.serviceMonitor.enabled | bool | `false` | |
| metrics.serviceMonitor.honorLabels | bool | `false` | |
| metrics.serviceMonitor.interval | string | `"30s"` | |
| metrics.serviceMonitor.labels | object | `{}` | |
| metrics.serviceMonitor.metricRelabelings | list | `[]` | |
| metrics.serviceMonitor.namespace | string | `""` | |
| metrics.serviceMonitor.path | string | `"/metrics"` | |
| metrics.serviceMonitor.relabelings | list | `[]` | |
| metrics.serviceMonitor.scrapeTimeout | string | `""` | |
| migration.enabled | bool | `true` | |
| migration.postgresql.password | string | `""` | |
| migration.postgresql.url | string | `""` | |
| migration.postgresql.user | string | `""` | |
| nameOverride | string | `""` | |
| nodeEnv | string | `"production"` | |
| nodeSelector | object | `{}` | |
| persistence.accessModes[0] | string | `"ReadWriteOnce"` | |
| persistence.annotations | object | `{}` | |
| persistence.enabled | bool | `false` | |
| persistence.existingClaim | string | `""` | |
| persistence.mountPath | string | `"/data/pglite"` | |
| persistence.size | string | `"8Gi"` | |
| persistence.storageClass | string | `""` | |
| podAnnotations | object | `{}` | |
| podLabels | object | `{}` | |
| podSecurityContext | object | `{}` | |
| readinessProbe.httpGet.path | string | `"/readyz"` | |
| readinessProbe.httpGet.port | string | `"admin"` | |
| readinessProbe.initialDelaySeconds | int | `5` | |
| readinessProbe.periodSeconds | int | `10` | |
| replicaCount | int | `1` | |
| resources | object | `{}` | |
| securityContext | object | `{}` | |
| service.nodePorts.admin | string | `""` | |
| service.nodePorts.http | string | `""` | |
| service.ports.admin | int | `8091` | |
| service.ports.http | int | `80` | |
| service.targetPort.admin | string | `"admin"` | |
| service.targetPort.http | string | `"http"` | |
| service.type | string | `"ClusterIP"` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.create | bool | `true` | |
| serviceAccount.name | string | `""` | |
| tolerations | list | `[]` | |
| updateStrategy | object | `{}` | |
| volumeMounts | list | `[]` | |
| volumes | list | `[]` | |

15 changes: 15 additions & 0 deletions charts/xapi-lrs/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{ template "chart.header" . }}

### version: {{ template "chart.version" . }}<!-- x-release-please-version -->

{{ template "chart.appVersionBadge" . }}

{{ template "chart.description" . }}

{{ template "chart.homepageLine" . }}

{{ template "chart.requirementsSection" . }}

{{ template "chart.valuesSection" . }}

{{ template "helm-docs.versionFooter" . }}
42 changes: 42 additions & 0 deletions charts/xapi-lrs/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
1. Get the xAPI endpoint:
{{- if .Values.ingress.enabled }}
http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.ingress.hostname }}{{ .Values.ingress.path }}
{{- else if and .Values.gateway.enabled .Values.gateway.hostname }}
http{{ if .Values.gateway.listenerSet.enabled }}s{{ end }}://{{ .Values.gateway.hostname }}{{ .Values.gateway.httpRoute.path }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[?(@.name==\"http\")].nodePort}" services {{ include "xapi-lrs.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo "http://$NODE_IP:$NODE_PORT"
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "xapi-lrs.fullname" . }} -o jsonpath="{.status.loadBalancer.ingress[0].ip}")
echo "http://$SERVICE_IP:{{ .Values.service.ports.http }}"
{{- else }}
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "xapi-lrs.fullname" . }} 8081:{{ .Values.service.ports.http }}
# http://127.0.0.1:8081
{{- end }}

The admin UI is served under /admin on that same endpoint.

2. The admin port serves unauthenticated /healthz, /readyz, and /metrics, and is
not routed externally. Reach it with a port-forward:

kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ include "xapi-lrs.fullname" . }} 8091:{{ .Values.service.ports.admin }}
# http://127.0.0.1:8091/metrics

{{- if eq .Values.database.driver "pglite" }}

Running in PGlite mode (embedded, single-connection); not recommended for production.
{{- if not .Values.persistence.enabled }}
Data is in an emptyDir and will not survive a pod restart; set persistence.enabled=true
to keep it on a PVC.
{{- end }}
{{- end }}

{{- if and (not .Values.auth.sessionSecret) (not .Values.auth.existingSecret) }}

The admin session secret was generated automatically. It stays stable across
`helm upgrade`, but not under GitOps tools that render with `helm template`
(Argo CD, Flux), where it is regenerated on every sync. For those, set
auth.sessionSecret or auth.existingSecret.
{{- end }}
103 changes: 103 additions & 0 deletions charts/xapi-lrs/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
{{/* vim: set filetype=mustache: */}}

{{/*
Expand the name of the chart.
*/}}
{{- define "xapi-lrs.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "xapi-lrs.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "xapi-lrs.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "xapi-lrs.labels" -}}
helm.sh/chart: {{ include "xapi-lrs.chart" . }}
{{ include "xapi-lrs.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/component: lrs
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "xapi-lrs.selectorLabels" -}}
app.kubernetes.io/name: {{ include "xapi-lrs.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "xapi-lrs.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "xapi-lrs.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Return the proper xapi-lrs image name
*/}}
{{- define "xapi-lrs.image" -}}
{{- $registry := .Values.image.registry -}}
{{- $repository := .Values.image.repository -}}
{{- $ref := ternary (printf "@%s" .Values.image.digest) (printf ":%s" .Values.image.tag) (not (empty .Values.image.digest)) -}}
{{- if $registry -}}
{{- printf "%s/%s%s" $registry $repository $ref -}}
{{- else -}}
{{- printf "%s%s" $repository $ref -}}
{{- end -}}
{{- end -}}

{{/*
Return the name of the Secret holding the sensitive values
*/}}
{{- define "xapi-lrs.secretName" -}}
{{- default (include "xapi-lrs.fullname" .) .Values.auth.existingSecret -}}
{{- end -}}

{{/*
Return auth.sessionSecret if set, else the value already in the chart Secret
(so upgrades don't rotate it), else a new random value.
*/}}
{{- define "xapi-lrs.sessionSecret" -}}
{{- if .Values.auth.sessionSecret -}}
{{- .Values.auth.sessionSecret -}}
{{- else -}}
{{- $existing := lookup "v1" "Secret" .Release.Namespace (include "xapi-lrs.fullname" .) -}}
{{- if and $existing $existing.data (index $existing.data "session-secret") -}}
{{- index $existing.data "session-secret" | b64dec -}}
{{- else -}}
{{- randAlphaNum 64 -}}
{{- end -}}
{{- end -}}
{{- end -}}
Loading
Loading