Skip to content

Commit

Permalink
Update the README for relate chart
Browse files Browse the repository at this point in the history
Add nginx to relate deployment
templated velero schedule's includenamespaces field
  • Loading branch information
mdasif authored and ashish1099 committed Jan 9, 2025
1 parent 452c1ed commit f2deec6
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 58 deletions.
5 changes: 3 additions & 2 deletions argocd-helm-charts/relate/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Flow for giving user an exam
# Flow for giving user a course and exam

1. create user under admin->users - be sure to set user to "active" (under continue editing).
The password you give the user is irrelevant as they will never know it.
Do NOT enter the users email! (only set active and confirm name)
**OR** if you have social auth like keycloak etc configured it will create a user for you when they login.
2. browse to the course you want enroll the new user in, and select "staff->impersonsate" - and impersonate the user. i
Then click "Enroll" on the course page.
Then click "Enroll" on the course page. **OR** you can configure course to be auto enrolled by users in course settings.
3. provided you already HAVE an exam setup for the course - go to "staff->issue exam tickets"
and issue ticket - and share a text like this:

Expand Down
6 changes: 5 additions & 1 deletion argocd-helm-charts/relate/charts/relate/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@

This Helm chart expects you to have the following Helm charts installed:

- https://opensource.zalando.com/postgres-operator/charts/postgres-operator/
- https://cloudnative-pg.github.io/charts
- https://github.com/bitnami/charts/tree/master/bitnami/rabbitmq-cluster-operator

AND you need to have a working mail server to point it to.
- IF you do not have one - you can use this chart to setup a mailrelay service in your Kubernetes cluster: https://github.com/bokysan/docker-postfix/blob/master/helm/mail

and currently no image is pushed to any dockerhub - so you need to do that - and point to it.

For additional configuration options for social authentication using Python, refer to these docs. These changes should be made in the ``local_settings_template.py`` file present in ``docker`` folder. currently it is configured to use keycloak authentication.
- https://python-social-auth.readthedocs.io/en/latest/backends/keycloak.html
- https://python-social-auth.readthedocs.io/en/latest/configuration/settings.html#urls-options

# After installing

After spinning up relate - you need to open a shell in the relate pod and run this to create your initial admin user:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ metadata:
spec:
immediate: true # Backup starts immediately after ScheduledBackup has been created
backupOwnerReference: self
schedule: "0 0 0 * * *"
schedule: "0 0 3 * * *"
cluster:
name: relate-pgsql # Cluster name
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ data:
worker_connections 10;}
http{
server {
listen 80;
listen 8001;
server_name {{ .Values.nginx.serverName }};
location /static/ {
root {{ .Values.nginx.rootDirectory }};
autoindex on;
include mime.types;
try_files $uri $uri.html =404;
}
}
Expand Down
44 changes: 12 additions & 32 deletions argocd-helm-charts/relate/charts/relate/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ spec:
priorityClassName: {{ .Values.priorityClassName | quote }}
{{- end }}
containers:
- name: nginx
image: {{ .Values.nginx.image | default "nginx:latest" }}
imagePullPolicy: {{ .Values.nginx.pullPolicy | default "IfNotPresent"}} # Default pull policy if not provided
volumeMounts:
- name: nginx-config-volume
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
- name: shared-static-data
mountPath: /var/www/relate/static
ports:
- containerPort: 8001
- name: relate
command:
- /run-relate.sh
Expand Down Expand Up @@ -91,38 +102,7 @@ spec:
- name: shared-static-data
persistentVolumeClaim:
claimName: {{ .Release.Name }}-staticdata
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-nginx-deployment
spec:
replicas: {{ default 1 .Values.nginx.replicas }} # Default to 1 replica if not provided
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: {{ .Values.nginx.image | default "nginx:latest" }}
imagePullPolicy: {{ .Values.nginx.pullPolicy | default "IfNotPresent"}} # Default pull policy if not provided
volumeMounts:
- name: nginx-config-volume
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
- name: shared-static-data
mountPath: /var/www/relate/static
ports:
- containerPort: 80

volumes:
- name: nginx-config-volume
configMap:
name: {{ .Release.Name }}-nginx-config
- name: shared-static-data
persistentVolumeClaim:
claimName: {{ .Release.Name }}-staticdata # Default PVC name if not provided

Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ spec:
pathType: Prefix
backend:
service:
name: nginx-service # The service you created to serve static files
name: relate
port:
number: 80
number: 8001
- path: {{ .Values.ingress.path }}
{{- if eq "true" (include "relate.supportsPathType" .) }}
pathType: {{ .Values.ingress.pathType }}
Expand Down
4 changes: 3 additions & 1 deletion argocd-helm-charts/relate/charts/relate/templates/pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,6 @@ spec:
resources:
requests:
storage: {{ default "300Mi" .Values.nginx.pvcStorage }}

{{- if .Values.nginx.storageClass }}
storageClassName: {{ .Values.nginx.storageClass }}
{{- end }}
17 changes: 5 additions & 12 deletions argocd-helm-charts/relate/charts/relate/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,11 @@ spec:
{{- else if eq .Values.service.type "ClusterIP" }}
nodePort: null
{{- end }}
- name: nginx
port: {{ .Values.service.port }}
targetPort: 8001
port: 8001
selector: {{- include "relate.matchLabels" . | nindent 4 }}

---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
selector:
app: nginx
ports:
- port: 80
targetPort: 80
type: ClusterIP


24 changes: 18 additions & 6 deletions argocd-helm-charts/velero/templates/velero-schedules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ spec:
hooks: {}
csiSnapshotTimeout: 40m
itemOperationTimeout: 300m
includedNamespaces:
- '*'
includedNamespaces:
{{- if .Values.schedule.includedNamespaces }}
{{- toYaml .Values.schedule.includedNamespaces | nindent 6 }}
{{- else }}
- "*"
{{- end }}
ttl: 720h0m0s
metadata:
labels:
Expand All @@ -31,8 +35,12 @@ spec:
hooks: {}
csiSnapshotTimeout: 40m
itemOperationTimeout: 300m
includedNamespaces:
- '*'
includedNamespaces:
{{- if .Values.schedule.includedNamespaces }}
{{- toYaml .Values.schedule.includedNamespaces | nindent 6 }}
{{- else }}
- "*"
{{- end }}
ttl: 2160h0m0s
metadata:
labels:
Expand All @@ -52,8 +60,12 @@ spec:
hooks: {}
csiSnapshotTimeout: 40m
itemOperationTimeout: 300m
includedNamespaces:
- '*'
includedNamespaces:
{{- if .Values.schedule.includedNamespaces }}
{{- toYaml .Values.schedule.includedNamespaces | nindent 6 }}
{{- else }}
- "*"
{{- end }}
ttl: 336h0m0s
metadata:
labels:
Expand Down

0 comments on commit f2deec6

Please sign in to comment.