This commit is contained in:
Philip Haupt
2025-05-06 00:36:01 +02:00
parent ff07812a4e
commit f60f6c4879
5 changed files with 529 additions and 0 deletions

5
wikijs/README.md Normal file
View File

@@ -0,0 +1,5 @@
# wiki.js
<https://docs.requarks.io/install/kubernetes>
Postgres Secret

View File

@@ -0,0 +1,6 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- main.yaml

298
wikijs/main.yaml Normal file
View File

@@ -0,0 +1,298 @@
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/instance: requarks
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: wiki
app.kubernetes.io/version: latest
helm.sh/chart: wiki-2.2.23
name: requarks-wiki
---
apiVersion: v1
kind: Service
metadata:
labels:
app: postgresql
chart: postgresql-6.5.0
heritage: Helm
release: requarks
name: requarks-postgresql
spec:
ports:
- name: postgresql
port: 5432
targetPort: postgresql
selector:
app: postgresql
release: requarks
role: master
type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
labels:
app: postgresql
chart: postgresql-6.5.0
heritage: Helm
release: requarks
name: requarks-postgresql-headless
spec:
clusterIP: None
ports:
- name: postgresql
port: 5432
targetPort: postgresql
selector:
app: postgresql
release: requarks
type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/instance: requarks
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: wiki
app.kubernetes.io/version: latest
helm.sh/chart: wiki-2.2.23
name: requarks-wiki
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: http
- name: https
port: 443
protocol: TCP
targetPort: http
selector:
app.kubernetes.io/instance: requarks
app.kubernetes.io/name: wiki
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/instance: requarks
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: wiki
app.kubernetes.io/version: latest
helm.sh/chart: wiki-2.2.23
name: requarks-wiki
spec:
replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/instance: requarks
app.kubernetes.io/name: wiki
template:
metadata:
annotations: {}
labels:
app.kubernetes.io/instance: requarks
app.kubernetes.io/name: wiki
spec:
containers:
- env:
- name: DB_TYPE
value: postgres
- name: DB_HOST
value: requarks-postgresql
- name: DB_PORT
value: "5432"
- name: DB_NAME
value: wiki
- name: DB_USER
value: postgres
- name: DB_SSL
value: "false"
- name: DB_SSL_CA
value: ""
- name: DB_PASS
valueFrom:
secretKeyRef:
key: postgresql-password
name: requarks-postgresql
- name: HA_ACTIVE
value: "false"
image: requarks/wiki:latest
imagePullPolicy: IfNotPresent
livenessProbe:
httpGet:
path: /healthz
port: http
name: wiki
ports:
- containerPort: 3000
name: http
protocol: TCP
readinessProbe:
httpGet:
path: /healthz
port: http
resources: {}
securityContext: {}
startupProbe:
failureThreshold: 60
httpGet:
path: /healthz
port: http
initialDelaySeconds: 15
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 5
securityContext: {}
serviceAccountName: requarks-wiki
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: postgresql
chart: postgresql-6.5.0
heritage: Helm
release: requarks
name: requarks-postgresql
spec:
replicas: 1
selector:
matchLabels:
app: postgresql
release: requarks
role: master
serviceName: requarks-postgresql-headless
template:
metadata:
labels:
app: postgresql
chart: postgresql-6.5.0
heritage: Helm
release: requarks
role: master
name: requarks-postgresql
spec:
containers:
- env:
- name: BITNAMI_DEBUG
value: "false"
- name: POSTGRESQL_PORT_NUMBER
value: "5432"
- name: POSTGRESQL_VOLUME_DIR
value: /bitnami/postgresql
- name: PGDATA
value: /bitnami/postgresql/data
- name: POSTGRES_USER
value: postgres
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
key: postgresql-password
name: requarks-postgresql
- name: POSTGRES_DB
value: wiki
image: docker.io/bitnami/postgresql:11.5.0-debian-9-r60
imagePullPolicy: IfNotPresent
livenessProbe:
exec:
command:
- sh
- -c
- exec pg_isready -U "postgres" -d "wiki" -h 127.0.0.1 -p 5432
failureThreshold: 6
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
name: requarks-postgresql
ports:
- containerPort: 5432
name: postgresql
readinessProbe:
exec:
command:
- sh
- -c
- -e
- |
pg_isready -U "postgres" -d "wiki" -h 127.0.0.1 -p 5432
[ -f /opt/bitnami/postgresql/tmp/.initialized ]
failureThreshold: 6
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
resources:
requests:
cpu: 250m
memory: 256Mi
securityContext:
runAsUser: 1001
volumeMounts:
- mountPath: /bitnami/postgresql
name: data
subPath: null
initContainers:
- command:
- sh
- -c
- |
mkdir -p /bitnami/postgresql/data
chmod 700 /bitnami/postgresql/data
find /bitnami/postgresql -mindepth 0 -maxdepth 1 -not -name ".snapshot" -not -name "lost+found" | \
xargs chown -R 1001:1001
image: docker.io/bitnami/minideb:stretch
imagePullPolicy: Always
name: init-chmod-data
resources:
requests:
cpu: 250m
memory: 256Mi
securityContext:
runAsUser: 0
volumeMounts:
- mountPath: /bitnami/postgresql
name: data
subPath: null
securityContext:
fsGroup: 1001
volumes: null
updateStrategy:
type: RollingUpdate
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
storageClassName: openebs-3-replicas
---
apiVersion: v1
kind: Pod
metadata:
annotations:
helm.sh/hook: test-success
labels:
app.kubernetes.io/instance: requarks
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: wiki
app.kubernetes.io/version: latest
helm.sh/chart: wiki-2.2.23
name: requarks-wiki-test-connection
spec:
containers:
- args:
- requarks-wiki:80
command:
- wget
image: busybox
name: wget
restartPolicy: Never

View File

@@ -0,0 +1,12 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
helmCharts:
- name: wiki
repo: https://charts.js.wiki
version: 2.2.23
releaseName: requarks
includeCRDs: true
namespace: wikijs
valuesFile: values.yaml

208
wikijs/src/values.yaml Normal file
View File

@@ -0,0 +1,208 @@
# Default values for wiki.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
revisionHistoryLimit: 10
image:
repository: requarks/wiki
imagePullPolicy: IfNotPresent
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name:
livenessProbe:
httpGet:
path: /healthz
port: http
readinessProbe:
httpGet:
path: /healthz
port: http
startupProbe:
initialDelaySeconds: 15
periodSeconds: 5
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 60
httpGet:
path: /healthz
port: http
podAnnotations: {}
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 80
# Annotations applied for services such as externalDNS or
# service type LoadBalancer
# type: LoadBalancer
# httpsPort: 443
# annotations: {}
# loadBalancerIP: 172.16.0.1
ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: wiki.minikube.local
paths:
- path: "/"
pathType: Prefix
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}
volumeMounts: []
volumes: []
# This will allow us to install locales even without internet access using a initContainer & Wiki.js "sideloading"
sideload:
enabled: false
# Git-Repo containing all locales.json-files you need:
repoURL: https://github.com/Requarks/wiki-localization
## This can be helpfull if you have internet access over a http proxy:
env: []
# - name: HTTPS_PROXY
# value: http://my.proxy.com:3128
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
## Append extra trusted certificates for node process from extra volume via NODE_EXTRA_CA_CERTS variable
# nodeExtraCaCerts: "/path/to/certs.pem"
## This will override the postgresql chart values
# externalPostgresql:
# # note: ?sslmode=require => ?ssl=true
# databaseURL: postgresql://postgres:postgres@postgres:5432/wiki?ssl=true
# # For self signed CAs, like DigitalOcean
# NODE_TLS_REJECT_UNAUTHORIZED: "0"
## Configuration values for the postgresql dependency.
## ref: https://github.com/kubernetes/charts/blob/master/stable/postgresql/README.md
##
postgresql:
## Use the PostgreSQL chart dependency.
## Set to false if bringing your own PostgreSQL, and set secret value postgresql-uri.
##
enabled: true
## ssl enforce SSL communication with PostgresSQL
## Default to false
##
# ssl: false
## ca Certificate of Authority
## Default to empty, point to location of CA
##
# ca: "path to ca"
## postgresqlHost override postgres database host
## Default to postgres
##
# postgresqlHost: postgres
## postgresqlPort port for postgres
## Default to 5432
##
# postgresqlPort: 5432
## PostgreSQL fullname Override
## Default to wiki-postgresql unless fullname override is set for Chart
##
fullnameOverride: ""
## PostgreSQL User to create.
##
postgresqlUser: postgres
## PostgreSQL Database to create.
##
postgresqlDatabase: wiki
## Persistent Volume Storage configuration.
## ref: https://kubernetes.io/docs/user-guide/persistent-volumes
##
replication:
## Enable PostgreSQL replication (primary/secondary)
##
enabled: false
persistence:
## Enable PostgreSQL persistence using Persistent Volume Claims.
##
enabled: true
## concourse data Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
storageClass: openebs-3-replicas
## Persistent Volume Access Mode.
##
accessMode: ReadWriteOnce
## Persistent Volume Storage Size.
##
size: 8Gi
existingSecret: requarks-postgresql