Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enhance chart #12

Merged
merged 13 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from 8 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
6 changes: 0 additions & 6 deletions .github/workflows/test-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,3 @@ jobs:
- name: Run chart-testing (lint)
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}
- name: Create kind cluster
if: steps.list-changed.outputs.changed == 'true'
uses: helm/[email protected]
- name: Run chart-testing (install)
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}
6 changes: 5 additions & 1 deletion charts/portals/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ apiVersion: v2
name: portals
description: Portals is a group allocation tool for the first week of the Department of Electrical Engineering and Information Technology at the FH Aachen - University of Applied Sciences.
type: application
version: 0.0.2
version: 0.0.3
appVersion: "2.1.0"
home: github.com/fsr5-fhaachen/portals
maintainers:
- name: fsr5-fhaachen
email: [email protected]
url: https://fsr5.de/
8 changes: 8 additions & 0 deletions charts/portals/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ helm repo add portals https://fsr5-fhaachen.github.io/portals/
helm upgrade --install portals portals/portals --namespace portals --create-namespace -f values.yaml
```

## Database and Redis

The chart does not install a database or redis. You have to install them yourself.

You could use the [postgresql operator](https://cloudnative-pg.io/) and [redis operator](https://ot-container-kit.github.io/redis-operator/) for kubernetes.

If you want a deployment example, view [our deployment guide](https://github.com/fsr5-fhaachen/portals/blob/main/deploy/README.md) inside the portals repo.

## Values

You can find the default values in the [values.yaml](values.yaml) file.
Expand Down
13 changes: 13 additions & 0 deletions charts/portals/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Thank you for installing {{ .Chart.Name }}.

Your release is named {{ .Release.Name }}.

{{- if .Values.ingress.enabled }}
You can access your site on your configured domain by visiting {{ index .Values.ingress.hosts 0 }}.
{{- else }}
You can access your site by port-forwarding to the service: "kubectl port-forward -n {{ .Release.Namespace }} svc/{{ include "portals.fullname" . }} 8000:8000"
{{- end }}



Learn more about portals at https://github.com/fsr5-fhaachen/portals.
12 changes: 9 additions & 3 deletions charts/portals/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,25 @@ spec:
- name: http
containerPort: 8000
protocol: TCP
{{- if not .Values.disableLivenessProbe }}
livenessProbe:
httpGet:
path: /
port: http
{{- end }}
{{- if not .Values.disableReadinessProbe }}
readinessProbe:
httpGet:
path: /
port: http
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
envFrom:
- secretRef:
name: {{ include "portals.fullname" . }}
env:
{{- range $key, $value := .Values.environment }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
10 changes: 0 additions & 10 deletions charts/portals/templates/secret.yaml

This file was deleted.

59 changes: 59 additions & 0 deletions charts/portals/templates/seed-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{{- if or .Values.migrateJob.onInstall .Values.migrateJob.onUpgrade -}}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ include "portals.fullname" . }}-migrate-job
labels:
{{- include "portals.labels" . | nindent 4 }}
annotations:
helm.sh/hook: {{ if .Values.migrateJob.onInstall }}pre-install{{ end }}{{ if and .Values.migrateJob.onInstall .Values.migrateJob.onUpgrade }},{{ end }}{{ if .Values.migrateJob.onUpgrade }}pre-upgrade{{ end }}
helm.sh/hook-weight: "1"
helm.sh/hook-delete-policy: hook-succeeded
spec:
template:
spec:
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
{{- range $key, $value := .Values.environment }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- if .Values.migrateJob.seed }}
command: ["php", "artisan", "migrate", "--seed", "--no-interaction", "--force"]
{{- else }}
command: ["php", "artisan", "migrate", "--no-interaction", "--force"]
{{- end }}
{{- if or (ne .Values.migrateJob.tutorsCsvConfigMapName "") (ne .Values.migrateJob.studentsCsvConfigMapName "") }}
volumeMounts:
{{- if ne .Values.migrateJob.tutorsCsvConfigMapName "" }}
- name: tutors-csv
mountPath: /var/www/html/database/seeders/tutors.csv
subPath: tutors.csv
{{- end }}
{{- if ne .Values.migrateJob.studentsCsvConfigMapName "" }}
- name: students-csv
mountPath: /var/www/html/database/seeders/students.csv
subPath: students.csv
{{- end }}
{{- end }}
{{- if or (ne .Values.migrateJob.tutorsCsvConfigMapName "") (ne .Values.migrateJob.studentsCsvConfigMapName "") }}
volumes:
{{- if ne .Values.migrateJob.tutorsCsvConfigMapName "" }}
- name: tutors-csv
configMap:
name: {{ .Values.migrateJob.tutorsCsvConfigMapName }}
{{- end }}
{{- if ne .Values.migrateJob.studentsCsvConfigMapName "" }}
- name: students-csv
configMap:
name: {{ .Values.migrateJob.studentsCsvConfigMapName }}
{{- end }}
{{- end }}
restartPolicy: Never
backoffLimit: 1
{{- end }}
33 changes: 22 additions & 11 deletions charts/portals/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,21 @@ image:
# Overrides the image tag whose default is the chart appVersion.
tag: ""

environment:
environment:
APP_NAME: Erstiwoche FB5
APP_ENV: local
APP_KEY: # insert app key here
APP_ENV: production
APP_KEY: # insert app key here
APP_DEBUG: "false"
APP_FORCE_HTTPS: "true"
APP_URL: https://portals.fsr5.de
TUTOR_PASSWORD: password # insert secret password here
ADMIN_PASSWORD: admin # insert secret password here
TUTOR_PASSWORD: password # insert secret password here
ADMIN_PASSWORD: admin # insert secret password here
DB_CONNECTION: pgsql
DB_HOST: # insert db host here
DB_HOST: # insert db host here
DB_PORT: "5432"
DB_DATABASE: postgres
DB_USERNAME: postgres
DB_PASSWORD: # insert db password here
DB_PASSWORD: # insert db password here
OCTANE_HTTPS: "true"
OCTANE_WORKERS: "4"
OCTANE_MAX_REQUESTS: "512"
Expand All @@ -33,15 +34,15 @@ environment:
CACHE_DRIVER: redis
SESSION_DRIVER: redis
SESSION_LIFETIME: "120"
REDIS_HOST: # insert redis host here
REDIS_PASSWORD: # insert redis password here
REDIS_HOST: # insert redis host here
REDIS_PASSWORD: # insert redis password here
REDIS_PORT: "6379"

ingress:
enabled: true
className: "nginx"
annotations:
cert-manager.io/issuer: "letsencrypt-prod"
annotations: {}
# cert-manager.io/cluster-issuer: "letsencrypt-prod"
hosts:
- portals.fsr5.de
tls: true
Expand All @@ -59,3 +60,13 @@ nodeSelector: {}
tolerations: []

affinity: {}

migrateJob:
onInstall: false
onUpgrade: false
seed: false
tutorsCsvConfigMapName: ""
studentsCsvConfigMapName: ""

disableReadinessProbe: false
disableLivenessProbe: false
Loading