-
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.
Move cron to a CronJob, queue to a DaemonSet, and add a volume for co…
…ntainer nginx files (#16)
- Loading branch information
Showing
18 changed files
with
321 additions
and
111 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,32 @@ | ||
# Contributing | ||
|
||
## Testing | ||
|
||
Install prerequisites: | ||
- [helm](https://helm.sh/) | ||
- [helm chart testing](https://github.com/helm/chart-testing) | ||
- [minikube](https://minikube.sigs.k8s.io/docs/start/) | ||
|
||
Start minikube: | ||
|
||
```sh | ||
minikube start | ||
``` | ||
|
||
Start chart-testing: | ||
|
||
```sh | ||
ct install --config ct.yaml --helm-extra-args '--timeout 200s' | ||
``` | ||
|
||
You can also add a yaml file in the `charts/monica/ci` directory to test the chart with different values. | ||
|
||
## Pre-commit | ||
|
||
This repository uses [pre-commit](https://pre-commit.com/) to run checks before each commit. | ||
|
||
To install pre-commit, run: | ||
|
||
```sh | ||
pre-commit install | ||
``` |
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
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,3 @@ | ||
ln -sf ../storage /var/www/html/public/storage | ||
rm -rf /public/* | ||
cp -ra /var/www/html/public /public |
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,43 @@ | ||
{{- if .Values.monica.cronjob.enabled }} | ||
--- | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: {{ template "monica.fullname" . }}-cron | ||
labels: | ||
{{- include "monica.labels" . | nindent 4 }} | ||
app.kubernetes.io/component: cronjob | ||
annotations: | ||
helm.sh/hook: post-install,post-upgrade,post-rollback | ||
helm.sh/hook-weight: "15" | ||
spec: | ||
schedule: "*/1 * * * *" | ||
concurrencyPolicy: Forbid | ||
jobTemplate: | ||
spec: | ||
{{- with .Values.image.pullSecrets }} | ||
imagePullSecrets: | ||
{{- range . }} | ||
- name: {{ . }} | ||
{{- end }} | ||
{{- end }} | ||
template: | ||
spec: | ||
containers: | ||
- name: {{ .Chart.Name }}-cronjob | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
command: | ||
- /bin/sh | ||
- -c | ||
- php /var/www/html/artisan schedule:run -v | ||
env: | ||
{{- include "monica.env" . | indent 16 }} | ||
resources: | ||
{{ toYaml .Values.resources | indent 16 }} | ||
volumeMounts: | ||
{{- include "monica.volumeMounts" . | trim | nindent 16 }} | ||
restartPolicy: Never | ||
volumes: | ||
{{- include "monica.volumes" . | trim | nindent 12 }} | ||
{{- end }} |
Oops, something went wrong.