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

Fdi branch 2024 11 14 to update the some fdi-charts including ckan and fdi-dotstatsuite #473

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
15 changes: 0 additions & 15 deletions stable/ckan/Chart.lock

This file was deleted.

55 changes: 28 additions & 27 deletions stable/ckan/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
name: ckan
apiVersion: v2
type: application
version: 0.0.31
appVersion: 2.9.5
appVersion: 2.10.3
dependencies:
- condition: redis.enabled
name: redis
repository: https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami
version: 12.10.1
- condition: postgresql.enabled
name: postgresql
repository: https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami
version: 10.2.0
- condition: solr.enabled
name: solr
repository: https://statcan.github.io/charts
version: 1.5.8
- condition: datapusher.enabled
name: datapusher
repository: https://statcan.github.io/charts
version: 1.0.0
description: CKAN Helm Chart for Kubernetes.
home: https://ckan.org/
icon: https://ckan.org/static/img/logo.svg
keywords:
- ckan
- http
- web
- application
- python
home: https://ckan.org/
icon: https://ckan.org/static/img/logo.svg
maintainers:
- email: [email protected]
name: sylus
- email: [email protected]
name: zachomedia
name: ckan
sources:
- https://github.com/drupalwxt/wxt
maintainers:
- name: Jianlong
email: [email protected]
engine: gotpl
dependencies:
- name: redis
version: 12.10.1
repository: https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami
condition: redis.enabled
- name: postgresql
version: 10.2.0
repository: https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami
condition: postgresql.enabled
- name: solr
version: 1.5.10
repository: https://statcan.github.io/charts
condition: solr.enabled
- name: datapusher
version: 1.0.0
repository: https://statcan.github.io/charts
condition: datapusher.enabled
type: application
version: 0.0.32
9 changes: 8 additions & 1 deletion stable/ckan/conf/ckan/overlay-production.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@
#

[app:main]
ckan.site_title = CKAN-SCHEMING-FDI
ckan.locales_offered = en fr
ckan.site_logo = /base/images/ckan-logo.png
ckan.site_description =
ckan.auth.user_create_organizations = False
ckan.auth.user_create_groups = False
ckan.auth.user_delete_groups = false
ckan.auth.user_delete_organizations = false
ckan.auth.create_dataset_if_not_in_organization = False
ckan.auth.create_unowned_dataset = False
ckan.auth.public_activity_stream_detail = true
ckan.favicon = /base/images/ckan.ico
ckan.gravatar_default = identicon
ckan.preview.direct = png jpg gif
Expand Down
4 changes: 2 additions & 2 deletions stable/ckan/conf/pgbouncer/pgbouncer.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
listen_addr = 0.0.0.0
auth_file = /etc/pgbouncer/userlist.txt
auth_type = trust
server_tls_sslmode = {{ .Values.pgbouncer.sslmode }}
server_tls_ca_file = /etc/root.crt.pem
server_tls_sslmode = prefer
#server_tls_ca_file = /etc/root.crt.pem
# These are defaults and can be configured
# please leave them as defaults if you are
# uncertain.
Expand Down
2 changes: 1 addition & 1 deletion stable/ckan/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Expand the name of the chart.
*/}}
{{- define "ckan.name" -}}
{{- default .Values.nameOverride .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- default .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Expand Down
14 changes: 14 additions & 0 deletions stable/ckan/templates/cm/ckan-crontab.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{{- if .Values.ckan.backup.enabled }}
{{- $fullName := include "ckan.fullname" . -}}
{{- $adminuser := .Values.ckan.backup.adminuser -}}
kind: ConfigMap
apiVersion: v1
metadata:
name: {{ include "ckan.name" . }}-crontabs
data:
{{- range $key, $value := .Values.ckan.cronjobs }}
{{ $key }}.sh: |
{{ $value.command }} -c /srv/app/production.ini -O /app/backup/{{ $fullName }}-{{ $key }}-$(date +%Y-%m-%d).json1.gz -z -u {{ $adminuser }} >> /app/backup/{{ $fullName }}-{{ $key }}-$(date +%Y-%m-%d)-log.txt ;
{{- end }}
{{- end }}

2 changes: 1 addition & 1 deletion stable/ckan/templates/cm/ckan-overlay.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "ckan.fullname" . }}-ini-overlay-configmap
name: {{ include "ckan.name" . }}-ini-overlay-configmap
data:
production.ini: |
{{ .Files.Get "conf/ckan/overlay-production.ini" | indent 4 }}
2 changes: 1 addition & 1 deletion stable/ckan/templates/cm/ckan-prerun.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "ckan.fullname" . }}-prerun-configmap
name: {{ include "ckan.name" . }}-prerun-configmap
data:
prerun.py: |
{{ .Files.Get "conf/ckan/prerun.py" | indent 4 }}
2 changes: 1 addition & 1 deletion stable/ckan/templates/cm/psql-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: psql-{{ include "ckan.fullname" . }}-init-configmap
name: psql-{{ include "ckan.name" . }}-init-configmap
data:
psql-init.py: |
{{ .Files.Get "conf/psql-init/psql-init.py" | indent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion stable/ckan/templates/cm/solr-configset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: solr-{{ include "ckan.fullname" . }}-configset-configmap
name: solr-{{ include "ckan.name" . }}-configset-configmap
data:
{{ (.Files.Glob "conf/solr-init/solr-configset/*").AsConfig | indent 2 }}
{{- end }}
2 changes: 1 addition & 1 deletion stable/ckan/templates/cm/solr-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: solr-{{ include "ckan.fullname" . }}-init-configmap
name: solr-{{ include "ckan.name" . }}-init-configmap
data:
solr-init.py: |
{{ .Files.Get "conf/solr-init/solr-init.py" | indent 4 }}
Expand Down
6 changes: 1 addition & 5 deletions stable/ckan/templates/cronjob/ckan.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{{- if eq .Values.ckan.activityStreamsEmailNotifications_jobs "true" -}}
{{- if semverCompare "<1.21" .Capabilities.KubeVersion.GitVersion }}
{{- if .Values.ckan.activityStreamsEmailNotifications_jobs -}}
apiVersion: batch/v1beta1
{{- else }}
apiVersion: batch/v1
{{- end }}
kind: CronJob
metadata:
name: {{ include "ckan.name" . }}-email-notifications
Expand Down
43 changes: 36 additions & 7 deletions stable/ckan/templates/deploy/ckan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ metadata:
labels:
app.kubernetes.io/name: {{ include "ckan.name" . }}
helm.sh/chart: {{ include "ckan.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/instance: {{ include "ckan.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "ckan.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/instance: {{ include "ckan.name" . }}
tier: ckan
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "ckan.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/instance: {{ include "ckan.name" . }}
tier: ckan
annotations:
{{- with .Values.ckan.podAnnotations }}
Expand All @@ -33,6 +33,17 @@ spec:
securityContext:
{{- toYaml .Values.ckan.podSecurityContext | nindent 8 }}
volumes:
{{- if .Values.ckan.backup.enabled }}
- name: "ckan-backup"
azureFile:
secretName: {{ .Values.fullnameOverride }}-ckan-backup-secret
shareName: {{ .Values.ckan.backup.shareName }}

- name: {{ include "ckan.fullname" . }}-crontabs
configMap:
name: {{ include "ckan.fullname" . }}-crontabs
defaultMode: 0755
{{- end }}
- name: {{ include "ckan.fullname" . }}-ini-overlay-configmap
configMap:
name: {{ include "ckan.fullname" . }}-ini-overlay-configmap
Expand Down Expand Up @@ -66,7 +77,7 @@ spec:
{{ end }}
initContainers:
- name: create-production-ini
image: "{{ .Values.initContainer.image.repository }}:{{ .Values.initContainer.image.tag }}"
image: busybox
command:
- "sh"
- "-c"
Expand All @@ -82,7 +93,7 @@ spec:
readOnly: false
{{- if .Values.ckan.persistence.enabled }}
- name: set-volume-ownership
image: "{{ .Values.initContainer.image.repository }}:{{ .Values.initContainer.image.tag }}"
image: busybox
command:
- "sh"
- "-c"
Expand All @@ -97,7 +108,7 @@ spec:
containers:
{{ if .Values.pgbouncer.enabled }}
- name: pgbouncer
image: "{{ .Values.pgbouncer.image.repository }}:{{ .Values.pgbouncer.image.tag }}"
image: mcr.microsoft.com/azure-oss-db-tools/pgbouncer-sidecar:latest
imagePullPolicy: Always
ports:
- containerPort: 5432
Expand Down Expand Up @@ -135,7 +146,7 @@ spec:
value: "{{ .Values.solr.initialize.maxShardsPerNode }}"
- name: CKAN_SOLR_INIT_CONFIGSETNAME
value: "{{ .Values.solr.initialize.configsetName }}"

command:
- /bin/bash
- -c
Expand Down Expand Up @@ -241,6 +252,14 @@ spec:
- |
set -e
source $CKAN_VENV/bin/activate
sudo service cron start
{{- if .Values.ckan.backup.enabled }}
echo "#!/usr/bin/bash" | crontab -
(crontab -l ; echo "PATH=/usr/lib/ckan/venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin") | crontab -
{{- range $key, $value := .Values.ckan.cronjobs }}
(crontab -l ; echo {{ $value.crontab | quote }}) | crontab -
{{- end }}
{{- end }}
ckan generate config /srv/app/production.ini
python3 <<EOF | xargs -I{} ckan config-tool /srv/app/production.ini "{}"
from ckan.config.environment import CONFIG_FROM_ENV_VARS
Expand All @@ -255,6 +274,8 @@ spec:
ckan config-tool /srv/app/production.ini -f /config/production.ini
ckan -c /srv/app/production.ini db init
python3 /srv/prerun/prerun.py
printenv > /tmp/enviroment
sudo bash -c "cat /tmp/enviroment > /etc/environment"
ckan -c /srv/app/production.ini run --host 0.0.0.0
ports:
- name: http
Expand Down Expand Up @@ -305,6 +326,8 @@ spec:
secretKeyRef:
name: {{ include "ckan.fullname" . }}
key: sysadminPassword
- name: BEAKER_SESSION_SECRET
value: {{ .Values.ckan.beaker_session_secret }}
- name: CKAN_SYSADMIN_EMAIL
value: {{ .Values.ckan.sysadminEmail }}
- name: CKAN_SITE_TITLE
Expand Down Expand Up @@ -410,6 +433,12 @@ spec:
failureThreshold: {{ .Values.ckan.liveness.failureThreshold }}
timeoutSeconds: {{ .Values.ckan.liveness.timeoutSeconds }}
volumeMounts:
{{- if .Values.ckan.backup.enabled}}
- mountPath: "/app/backup"
name: "ckan-backup"
- name: {{ include "ckan.fullname" . }}-crontabs
mountPath: /app/
{{- end }}
- name: {{ include "ckan.fullname" . }}-prerun-configmap
mountPath: /srv/prerun
- name: {{ include "ckan.fullname" . }}-ini-overlay-configmap
Expand Down
10 changes: 10 additions & 0 deletions stable/ckan/templates/secret/ckan-backup-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{{- if .Values.ckan.backup.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .Values.fullnameOverride }}-ckan-backup-secret
type: Opaque
data:
azurestorageaccountname: {{ .Values.ckan.backup.azurestorageaccountname | b64enc }}
azurestorageaccountkey: {{ .Values.ckan.backup.azurestorageaccountkey | b64enc }}
{{- end }}
Loading
Loading