-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ADD mediawiki support for simplesamlphp extension
This involves 3 main changes: - Add simplesamlphp deployment - Route paths starting with /_saml2/ to the simplesamlphp container - Mount simplesamlphp code in both the simplesamlphp container and the main wiki container The simplesamlphp deployment is basically running simplesamlphp in SP mode. The SP certs are provided in a configmap and mounted into the SP. The certs had to be mounted individually as they were being mounted on top of a pvc volume, don't know why mounting as a dir doesn't work in such cases. The simplesamlphp SP needs to be hosted on the same domain as wiki to avoid cookie issues, so ingress was configured to serve all traffics with paths starting with /_saml2/ to the SP. On the wiki side, the simplesamlphp extension needs to import classes from the SP codebase. This is why the code for the simplesamlphp app lives on a shared volume. When the SP starts up, its entrypoint copies the code into the shared volume, and apache runs the SP off of the shared volume code. The wiki mount is set to readonly. Incremented the minor version in Chart.yaml as this is a larger change than usual.
- Loading branch information
1 parent
c5b7c22
commit 7f008fa
Showing
8 changed files
with
243 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
{{- if .Values.simplesamlphp.enabled -}} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "mediawiki.fullname" . }}-simplesamlphp | ||
labels: | ||
{{- include "common_labels" . | indent 4 }} | ||
tier: app | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: {{ template "mediawiki.fullname" . }}-simplesamlphp | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ template "mediawiki.fullname" . }}-simplesamlphp | ||
spec: | ||
containers: | ||
- name: {{ template "mediawiki.fullname" . }}-simplesamlphp | ||
image: "{{ .Values.simplesamlphp.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
env: | ||
{{- include "simplesamlphp.app.spec.env" . | indent 10 }} | ||
resources: | ||
{{ toYaml .Values.simplesamlphp.resources | indent 10 }} | ||
ports: | ||
- containerPort: 8080 | ||
startupProbe: | ||
tcpSocket: | ||
port: 8080 | ||
failureThreshold: 60 | ||
periodSeconds: 5 | ||
livenessProbe: | ||
httpGet: | ||
path: /_saml2/module.php/saml/sp/metadata/wiki-sp | ||
port: 8080 | ||
initialDelaySeconds: 10 | ||
timeoutSeconds: 10 | ||
periodSeconds: 60 | ||
readinessProbe: | ||
httpGet: | ||
path: /_saml2/module.php/core/welcome | ||
port: 8080 | ||
initialDelaySeconds: 10 | ||
timeoutSeconds: 10 | ||
periodSeconds: 60 | ||
volumeMounts: | ||
- name: simplesamlphp-code | ||
mountPath: /var/www/simplesamlphp | ||
- name: simplesamlphp-crt | ||
mountPath: /var/www/simplesamlphp/cert/wiki-sp.crt | ||
# subPath cause we're mounting into a pvc, and that didn't work as | ||
# a dir but worked as a single file | ||
subPath: wiki-sp.crt | ||
- name: simplesamlphp-pem | ||
mountPath: /var/www/simplesamlphp/cert/wiki-sp.pem | ||
subPath: wiki-sp.pem | ||
volumes: | ||
- name: simplesamlphp-code | ||
persistentVolumeClaim: | ||
claimName: {{ template "mediawiki.fullname" . }}-simplesamlphp-pvc | ||
- name: simplesamlphp-crt | ||
configMap: | ||
name: {{ template "mediawiki.fullname" . }}-simplesamlphp | ||
items: | ||
- key: crt | ||
path: wiki-sp.crt | ||
- name: simplesamlphp-pem | ||
configMap: | ||
name: {{ template "mediawiki.fullname" . }}-simplesamlphp | ||
items: | ||
- key: pem | ||
path: wiki-sp.pem | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{{- if .Values.simplesamlphp.enabled -}} | ||
|
||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ template "mediawiki.fullname" . }}-simplesamlphp | ||
labels: | ||
{{- include "common_labels" . | indent 4 }} | ||
data: | ||
crt: | ||
{{ toYaml .Values.simplesamlphp.sp.certs.crt | indent 2 }} | ||
pem: | ||
{{ toYaml .Values.simplesamlphp.sp.certs.pem | indent 2 }} | ||
|
||
{{- end -}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{{- if .Values.simplesamlphp.enabled -}} | ||
kind: PersistentVolume | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ template "mediawiki.fullname" . }}-simplesamlphp-pv | ||
labels: | ||
{{- include "common_labels" . | indent 4 }} | ||
tier: filestore | ||
spec: | ||
accessModes: | ||
- {{ .Values.simplesamlphp.persistence.accessMode | quote }} | ||
capacity: | ||
storage: {{ .Values.simplesamlphp.persistence.size | quote }} | ||
storageClassName: {{ .Values.simplesamlphp.persistence.storageClass }} | ||
{{ toYaml .Values.simplesamlphp.persistence.resources | indent 2 }} | ||
|
||
--- | ||
|
||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: {{ template "mediawiki.fullname" . }}-simplesamlphp-pvc | ||
labels: | ||
{{- include "common_labels" . | indent 4 }} | ||
tier: filestore | ||
spec: | ||
accessModes: | ||
- {{ .Values.simplesamlphp.persistence.accessMode | quote }} | ||
resources: | ||
requests: | ||
storage: {{ .Values.simplesamlphp.persistence.size | quote }} | ||
storageClassName: {{ .Values.simplesamlphp.persistence.storageClass | quote }} | ||
selector: | ||
matchLabels: | ||
app: {{ template "mediawiki.fullname" . }} | ||
stage: {{ .Values.stage }} | ||
tier: filestore | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters