Skip to content

Commit

Permalink
Added cdr helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
olimpiurob committed Jul 17, 2024
1 parent 1681fb2 commit 64d11fd
Show file tree
Hide file tree
Showing 30 changed files with 1,297 additions and 209 deletions.
Binary file added docs/cdr-0.1.0.tgz
Binary file not shown.
446 changes: 237 additions & 209 deletions docs/index.yaml

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions sources/cdr/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
15 changes: 15 additions & 0 deletions sources/cdr/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
dependencies:
- name: rn-zeoserver
repository: https://eea.github.io/helm-charts
version: 0.1.0
- name: rn-varnish
repository: https://eea.github.io/helm-charts
version: 0.1.1
- name: rn-local-converters
repository: https://eea.github.io/helm-charts
version: 0.1.1
- name: rn-clamav
repository: https://eea.github.io/helm-charts
version: 0.1.1
digest: sha256:cb63167b2e4222634023938c194a26053ae3493c733e71583d850f3c8798ff82
generated: "2024-07-17T16:55:38.140393+03:00"
27 changes: 27 additions & 0 deletions sources/cdr/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: v2
name: cdr
description: A CDR Helm chart for Kubernetes
icon: https://raw.githubusercontent.com/eea/helm-charts/main/sources/cdr/logo_eionet.png

type: application

version: 0.1.0

appVersion: "6.7.3-193"

dependencies:
- name: rn-zeoserver
version: 0.1.0
repository: https://eea.github.io/helm-charts
- name: rn-varnish
version: 0.1.1
repository: https://eea.github.io/helm-charts
condition: rn-varnish.enabled
- name: rn-local-converters
version: 0.1.1
repository: https://eea.github.io/helm-charts
condition: rn-local-converters.enabled
- name: rn-clamav
version: 0.1.1
repository: https://eea.github.io/helm-charts
condition: rn-clamav.enabled
25 changes: 25 additions & 0 deletions sources/cdr/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Reportnet CDR

The Central Data Repository is part of the Reportnet architecture. The Central Data Repository is like a bookshelf, with data reports on the environment as submitted to international clients.

This chart is almost configured for production use.

## Values

<dl>
<dt>deployment</dt>
<dd>This should be set based on deployment. The deployment value is used for the various used pvc names as a prefix.</dd>

<dt>rabbitmq</dt>
<dd>This can be used to set the rabbitmq host to be used.</dd>.</dd>

</dl>

## Releases

<dl>

<dt>Version 0.1.0</dt>
<dd>Initial release.</dd>

</dl>
Binary file added sources/cdr/charts/rn-clamav-0.1.1.tgz
Binary file not shown.
Binary file added sources/cdr/charts/rn-local-converters-0.1.1.tgz
Binary file not shown.
Binary file added sources/cdr/charts/rn-varnish-0.1.1.tgz
Binary file not shown.
Binary file added sources/cdr/charts/rn-zeoserver-0.1.0.tgz
Binary file not shown.
Binary file added sources/cdr/logo_eionet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions sources/cdr/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "appl.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "appl.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "appl.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "appl.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
{{- end }}
62 changes: 62 additions & 0 deletions sources/cdr/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "appl.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "appl.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "appl.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "appl.labels" -}}
helm.sh/chart: {{ include "appl.chart" . }}
{{ include "appl.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "appl.selectorLabels" -}}
app.kubernetes.io/name: {{ include "appl.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "appl.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "appl.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
47 changes: 47 additions & 0 deletions sources/cdr/templates/cron-auto-env-cleanup-cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{{- if and .Values.cron.enabled .Values.cronautoenvcleanup.enabled }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: cron-auto-env-cleanup
labels:
{{- include "appl.labels" . | nindent 4 }}
component: cron-auto-env-cleanup

spec:
schedule: "{{ .Values.cronautoenvcleanup.schedule }}"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "appl.serviceAccountName" . }}

containers:
- name: cron-auto-env-cleanup
image: "{{ .Values.instance.repository }}:{{ .Values.instance.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.cronautoenvcleanup.resources | nindent 14 }}
command:
- /opt/zope/bin/instance
- run
- /opt/zope/bin/auto_env_cleanup
- --inactive_for
- "30"
- --limit
- "10"
env:
- name: SENTRY_DSN
value: "{{ .Values.instance.env.sentryDSN }}"
- name: DEPLOYMENT_HOST
value: "{{ .Values.instance.env.deploymentHost }}"
- name: TZ
value: {{ .Values.timezone }}
- name: ZEO_ADDRESS
value: "{{ .Values.instance.env.zeoAddress }}"
restartPolicy: Never
{{- end }}
110 changes: 110 additions & 0 deletions sources/cdr/templates/cron-auto-fallin-cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{{- if and .Values.cron.enabled .Values.cronautofallin.enabled }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: cron-auto-fallin
labels:
{{- include "appl.labels" . | nindent 4 }}
component: cron-auto-fallin

spec:
schedule: "{{ .Values.cronautofallin.schedule }}"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "appl.serviceAccountName" . }}

containers:
- name: cron-auto-fallin
image: "{{ .Values.instance.repository }}:{{ .Values.instance.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.cronautofallin.resources | nindent 14 }}
command:
- /opt/zope/bin/instance
- run
- /opt/zope/bin/auto_fallin
- --obligations
- "673"
- --act_from
- FinalFeedback
- --act_to
- ReleaseAllFeedbacks
- --workflow
- AQ_eReporting_E1a
- --env_year_offset
- "-1"
env:
- name: BEAKER_PATH
value: "{{ .Values.instance.env.beakerPath }}"
- name: BEAKER_SECRET
value: "{{ .Values.instance.env.beakerSecret }}"
- name: CACHE_PURGING_DOMAIN
value: "{{ .Values.instance.env.cachePurgingDomain }}"
- name: CACHE_PURGING_ENABLED
value: "{{ .Values.instance.env.cachePurgingEnabled }}"
- name: CACHE_PURGING_PROXY
value: "{{ .Values.instance.env.cachePurgingProxy }}"
- name: CACHE_PURGING_PROXY_PORT
value: "{{ .Values.instance.env.cachePurgingProxyPort }}"
- name: CACHE_PURGING_VHOST
value: "{{ .Values.instance.env.cachePurgingVhost }}"
- name: CACHE_SETTINGS_ENABLED
value: "{{ .Values.instance.env.cacheSettingsEnabled }}"
- name: CLAMAV_HOST
value: "{{ .Values.instance.env.clamavHost }}"
- name: GRAYLOG
value: "{{ .Values.instance.env.graylog }}"
- name: GRAYLOG_FACILITY
value: "{{ .Values.instance.env.graylogFacility }}"
- name: RABBITMQ_ENABLED
value: "{{ .Values.instance.env.rabbitmqEnabled }}"
- name: RABBITMQ_HOST
value: "{{ .Values.instance.env.rabbitmqHost }}"
- name: RABBITMQ_PASS
value: "{{ .Values.instance.env.rabbitmqPass }}"
- name: RABBITMQ_PORT
value: "{{ .Values.instance.env.rabbitmqPort }}"
- name: RABBITMQ_USER
value: "{{ .Values.instance.env.rabbitmqUser }}"
- name: SENTRY_DSN
value: "{{ .Values.instance.env.sentryDSN }}"
- name: TZ
value: {{ .Values.timezone }}
- name: ZEO_ADDRESS
value: "{{ .Values.instance.env.zeoAddress }}"
- name: ZIP_CACHE_ENABLED
value: "{{ .Values.instance.env.zipCacheEnabled }}"
- name: ZIP_CACHE_PATH
value: "{{ .Values.instance.env.zipCachePath }}"
- name: ZIP_CACHE_THRESHOLD
value: "{{ .Values.instance.env.zipCacheThreshold }}"
- name: ZOPE_THREADS
value: "{{ .Values.instance.env.zopeThreads }}"

volumeMounts:
- mountPath: /opt/zope/var/zip_cache
name: {{ .Values.deployment }}-zipcache-storage
- mountPath: /sessions
name: {{ .Values.deployment }}-sessions-storage
- mountPath: /tmp
name: {{ .Values.deployment }}-tmpdir-storage

restartPolicy: Never
volumes:
- name: {{ .Values.deployment }}-zipcache-storage
persistentVolumeClaim:
claimName: {{ .Values.deployment }}-zipcache-storage
- name: {{ .Values.deployment }}-sessions-storage
persistentVolumeClaim:
claimName: {{ .Values.deployment }}-sessions-storage
- name: {{ .Values.deployment }}-tmpdir-storage
persistentVolumeClaim:
claimName: {{ .Values.deployment }}-tmpdir-storage
{{- end }}
45 changes: 45 additions & 0 deletions sources/cdr/templates/cron-sessions-cleanup-cronjob.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{{- if and .Values.cron.enabled .Values.cronsessionscleanup.enabled }}
apiVersion: batch/v1
kind: CronJob
metadata:
name: cron-sessions-cleanup
labels:
{{- include "appl.labels" . | nindent 4 }}
component: cron-sessions-cleanup

spec:
schedule: "{{ .Values.cronsessionscleanup.schedule }}"
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "appl.serviceAccountName" . }}

containers:
- name: cron-sessions-cleanup
image: busybox
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.cronsessionscleanup.resources | nindent 14 }}
command:
- '/bin/sh'
args: ["-c", "$(SESSIONS_CLEANUP)"]
env:
- name: TZ
value: {{ .Values.timezone }}
- name: SESSIONS_CLEANUP
value: 'find /sessions -type f -mtime +3 -print -exec rm {} \; || echo "Sessions cleanup completed"'
volumeMounts:
- mountPath: /sessions
name: {{ .Values.deployment }}-sessions-storage
restartPolicy: Never
volumes:
- name: {{ .Values.deployment }}-sessions-storage
persistentVolumeClaim:
claimName: {{ .Values.deployment }}-sessions-storage
{{- end }}
Loading

0 comments on commit 64d11fd

Please sign in to comment.