From 7a3f974b1d580a1a4d1e55b2ef0a69bd964c897d Mon Sep 17 00:00:00 2001 From: Philippe Bonneville <61838768+GoodTown@users.noreply.github.com> Date: Tue, 4 Apr 2023 14:09:25 -0400 Subject: [PATCH] Patch: ckan 0.0.24 (#421) * removed fdi-metadata-search-searchapi * -parameterized project name -added email notification parameters * removed linting error --- stable/ckan/Chart.lock | 15 ----- stable/ckan/Chart.yaml | 2 +- stable/ckan/conf/ckan/overlay-production.ini | 2 +- stable/ckan/templates/cm/ckan-overlay.yaml | 2 +- stable/ckan/templates/cm/ckan-prerun.yaml | 2 +- stable/ckan/templates/cm/psql-init.yaml | 2 +- stable/ckan/templates/cm/solr-configset.yaml | 2 +- stable/ckan/templates/cm/solr-init.yaml | 2 +- stable/ckan/templates/cronjob/ckan.yaml | 12 ++-- stable/ckan/templates/deploy/ckan.yaml | 65 ++++++++++++-------- stable/ckan/templates/ing/ckan.yaml | 4 +- stable/ckan/templates/pvc/pvc.yaml | 4 +- stable/ckan/templates/sa/ckan.yaml | 4 +- stable/ckan/templates/secret/pgbouncer.yaml | 4 +- stable/ckan/templates/svc/ckan.yaml | 8 +-- stable/ckan/values.yaml | 36 +++++------ 16 files changed, 80 insertions(+), 86 deletions(-) delete mode 100644 stable/ckan/Chart.lock diff --git a/stable/ckan/Chart.lock b/stable/ckan/Chart.lock deleted file mode 100644 index 157f493b..00000000 --- a/stable/ckan/Chart.lock +++ /dev/null @@ -1,15 +0,0 @@ -dependencies: -- name: redis - repository: https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami - version: 12.10.1 -- name: postgresql - repository: https://raw.githubusercontent.com/bitnami/charts/eb5f9a9513d987b519f0ecd732e7031241c50328/bitnami - version: 10.2.0 -- name: solr - repository: https://statcan.github.io/charts - version: 1.5.8 -- name: datapusher - repository: https://statcan.github.io/charts - version: 1.0.0 -digest: sha256:ffa9e3ca223d194d4d0514872a338a0caa8e40447b5c7d9ca17ba04f97634338 -generated: "2022-06-13T14:21:55.5637318-04:00" diff --git a/stable/ckan/Chart.yaml b/stable/ckan/Chart.yaml index 81a86063..ea3864f4 100644 --- a/stable/ckan/Chart.yaml +++ b/stable/ckan/Chart.yaml @@ -1,7 +1,7 @@ name: ckan apiVersion: v2 type: application -version: 0.0.23 +version: 0.0.24 appVersion: 2.9.5 description: CKAN Helm Chart for Kubernetes. keywords: diff --git a/stable/ckan/conf/ckan/overlay-production.ini b/stable/ckan/conf/ckan/overlay-production.ini index c0305522..46cb2575 100644 --- a/stable/ckan/conf/ckan/overlay-production.ini +++ b/stable/ckan/conf/ckan/overlay-production.ini @@ -18,7 +18,7 @@ # [app:main] -ckan.site_title = CKAN-FDI +#ckan.site_title = CKAN-QOL-FDI ckan.site_logo = /base/images/ckan-logo.png ckan.site_description = ckan.favicon = /base/images/ckan.ico diff --git a/stable/ckan/templates/cm/ckan-overlay.yaml b/stable/ckan/templates/cm/ckan-overlay.yaml index 869e3a4e..e83cb2d8 100644 --- a/stable/ckan/templates/cm/ckan-overlay.yaml +++ b/stable/ckan/templates/cm/ckan-overlay.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: ckan-ini-overlay-configmap + name: ckan-{{ include "ckan.fullname" . }}-ini-overlay-configmap data: production.ini: | {{ .Files.Get "conf/ckan/overlay-production.ini" | indent 4 }} diff --git a/stable/ckan/templates/cm/ckan-prerun.yaml b/stable/ckan/templates/cm/ckan-prerun.yaml index 085fafb7..22276012 100644 --- a/stable/ckan/templates/cm/ckan-prerun.yaml +++ b/stable/ckan/templates/cm/ckan-prerun.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: ckan-prerun-configmap + name: ckan-{{ include "ckan.fullname" . }}-prerun-configmap data: prerun.py: | {{ .Files.Get "conf/ckan/prerun.py" | indent 4 }} diff --git a/stable/ckan/templates/cm/psql-init.yaml b/stable/ckan/templates/cm/psql-init.yaml index 77f908b8..77aa249c 100644 --- a/stable/ckan/templates/cm/psql-init.yaml +++ b/stable/ckan/templates/cm/psql-init.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: psql-init-configmap + name: psql-{{ include "ckan.fullname" . }}-init-configmap data: psql-init.py: | {{ .Files.Get "conf/psql-init/psql-init.py" | indent 4 }} diff --git a/stable/ckan/templates/cm/solr-configset.yaml b/stable/ckan/templates/cm/solr-configset.yaml index 22211265..4667bba8 100644 --- a/stable/ckan/templates/cm/solr-configset.yaml +++ b/stable/ckan/templates/cm/solr-configset.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: solr-configset-configmap + name: solr-{{ include "ckan.fullname" . }}-configset-configmap data: {{ (.Files.Glob "conf/solr-init/solr-configset/*").AsConfig | indent 2 }} {{- end }} diff --git a/stable/ckan/templates/cm/solr-init.yaml b/stable/ckan/templates/cm/solr-init.yaml index 9fe06a7e..d3ba4bd1 100644 --- a/stable/ckan/templates/cm/solr-init.yaml +++ b/stable/ckan/templates/cm/solr-init.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: solr-init-configmap + name: solr-{{ include "ckan.fullname" . }}-init-configmap data: solr-init.py: | {{ .Files.Get "conf/solr-init/solr-init.py" | indent 4 }} diff --git a/stable/ckan/templates/cronjob/ckan.yaml b/stable/ckan/templates/cronjob/ckan.yaml index 73f452cd..3e9aea9d 100644 --- a/stable/ckan/templates/cronjob/ckan.yaml +++ b/stable/ckan/templates/cronjob/ckan.yaml @@ -2,11 +2,11 @@ apiVersion: batch/v1beta1 kind: CronJob metadata: - name: ckan-email-notifications + name: {{ include "ckan.fullname" . }}-email-notifications labels: - app.kubernetes.io/name: {{ include "ckan.name" . }} + app.kubernetes.io/name: {{ include "ckan.fullname" . }} helm.sh/chart: {{ include "ckan.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/instance: {{ include "ckan.fullname" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} spec: schedule: "*/15 * * * *" @@ -16,7 +16,7 @@ spec: template: spec: containers: - - name: ckan-email-notifications + - name: {{ include "ckan.fullname" . }}-email-notifications securityContext: {{- toYaml .Values.ckan.securityContext | nindent 14 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" @@ -65,11 +65,11 @@ spec: key: ckanDatastoreReadUrl {{- if .Values.solr.enabled }} - name: CKAN_SOLR_URL - value: http://{{ .Release.Name }}-solr-headless:8983/solr/ckancollection + value: http://{{ include "ckan.fullname" . }}-solr-headless:8983/solr/ckancollection {{- end }} {{- if .Values.redis.enabled }} - name: CKAN_REDIS_URL - value: redis://{{ .Release.Name }}-redis-headless:6379/0 + value: redis://ckan-redis-headless:6379/0 {{- end }} - name: CKAN__DATAPUSHER__URL value: {{ .Values.ckan.datapusherUrl }} diff --git a/stable/ckan/templates/deploy/ckan.yaml b/stable/ckan/templates/deploy/ckan.yaml index d75f7b0c..b534704d 100644 --- a/stable/ckan/templates/deploy/ckan.yaml +++ b/stable/ckan/templates/deploy/ckan.yaml @@ -3,22 +3,22 @@ kind: Deployment metadata: name: {{ include "ckan.fullname" . }} labels: - app.kubernetes.io/name: {{ include "ckan.name" . }} + app.kubernetes.io/name: {{ include "ckan.fullname" . }} helm.sh/chart: {{ include "ckan.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/instance: {{ include "ckan.fullname" . }} 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/name: {{ include "ckan.fullname" . }} + app.kubernetes.io/instance: {{ include "ckan.fullname" . }} tier: ckan template: metadata: labels: - app.kubernetes.io/name: {{ include "ckan.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: {{ include "ckan.fullname" . }} + app.kubernetes.io/instance: {{ include "ckan.fullname" . }} tier: ckan spec: {{- with .Values.imagePullSecrets }} @@ -29,24 +29,24 @@ spec: securityContext: {{- toYaml .Values.ckan.podSecurityContext | nindent 8 }} volumes: - - name: ckan-ini-overlay-configmap + - name: ckan-{{ include "ckan.fullname" . }}-ini-overlay-configmap configMap: - name: ckan-ini-overlay-configmap - - name: ckan-prerun-configmap + name: ckan-{{ include "ckan.fullname" . }}-ini-overlay-configmap + - name: ckan-{{ include "ckan.fullname" . }}-prerun-configmap configMap: - name: ckan-prerun-configmap + name: ckan-{{ include "ckan.fullname" . }}-prerun-configmap {{ if .Values.solr.initialize.enabled }} - - name: solr-init-configmap + - name: solr-{{ include "ckan.fullname" . }}-init-configmap configMap: - name: solr-init-configmap - - name: solr-configset-configmap + name: solr-{{ include "ckan.fullname" . }}-init-configmap + - name: solr-{{ include "ckan.fullname" . }}-configset-configmap configMap: - name: solr-configset-configmap + name: solr-{{ include "ckan.fullname" . }}-configset-configmap {{ end }} {{ if .Values.ckan.psql.initialize }} - - name: psql-init-configmap + - name: psql-{{ include "ckan.fullname" . }}-init-configmap configMap: - name: psql-init-configmap + name: psql-{{ include "ckan.fullname" . }}-init-configmap {{ end }} {{ if .Values.pgbouncer.enabled }} - name: configfiles @@ -121,7 +121,7 @@ spec: env: {{- if .Values.solr.enabled }} - name: CKAN_SOLR_URL - value: http://{{ .Release.Name }}-solr-headless:8983/solr/ckancollection + value: http://{{ include "ckan.fullname" . }}-solr-headless:8983/solr/ckancollection {{- end }} - name: CKAN_SOLR_INIT_NUMSHARDS value: "{{ .Values.solr.initialize.numShards }}" @@ -131,6 +131,7 @@ spec: value: "{{ .Values.solr.initialize.maxShardsPerNode }}" - name: CKAN_SOLR_INIT_CONFIGSETNAME value: "{{ .Values.solr.initialize.configsetName }}" + command: - /bin/bash - -c @@ -143,10 +144,10 @@ spec: echo "Solr Initialized" sleep infinity volumeMounts: - - name: solr-init-configmap + - name: solr-{{ include "ckan.fullname" . }}-init-configmap mountPath: /srv/solr-init readOnly: false - - name: solr-configset-configmap + - name: solr-{{ include "ckan.fullname" . }}-configset-configmap mountPath: /srv/solr-configset readOnly: false - name: ckan-config @@ -181,7 +182,7 @@ spec: key: psqlMasterPassword {{- if .Values.solr.enabled }} - name: CKAN_SOLR_URL - value: http://{{ .Release.Name }}-solr-headless:8983/solr/ckancollection + value: http://{{ include "ckan.fullname" . }}-solr-headless:8983/solr/ckancollection {{- end }} - name: CKAN_SQLALCHEMY_URL valueFrom: @@ -222,7 +223,7 @@ spec: - name: ckan-config mountPath: /srv/app readOnly: false - - name: psql-init-configmap + - name: psql-{{ include "ckan.fullname" . }}-init-configmap mountPath: /tmp/psql-init {{ end }} - name: {{ .Chart.Name }} @@ -245,7 +246,7 @@ spec: if getenv(v): print(f"{k} = {getenv(v)}") EOF - ckan config-tool /srv/app/production.ini "ckan.plugins = ${CKAN_PLUGINS}" + ckan config-tool /srv/app/production.ini "ckan.site_title = ${CKAN_SITE_TITLE}" echo "Applying the production.ini overlay..." ckan config-tool /srv/app/production.ini -f /config/production.ini ckan -c /srv/app/production.ini db init @@ -310,6 +311,18 @@ spec: value: {{ .Values.ckan.siteUrl }} - name: CKAN_PLUGINS value: {{ .Values.ckan.ckanPlugins }} + - name: CKAN_SCHEMING_DATASETS_SCHEMAS + value: {{ .Values.ckan.scheming.dataset_schemas }} + - name: CKAN_SCHEMING_PRESETS + value: {{ .Values.ckan.scheming.presets }} + - name: CKAN_SCHEMING_GROUP_SCHEMAS + value: {{ .Values.ckan.scheming.group_schemas }} + - name: CKAN_SCHEMING_ORGANIZATION_SCHEMAS + value: {{ .Values.ckan.scheming.organization_schemas }} + - name: CKAN_SCHEMING_DATASET_FALLBACK + value: "{{ .Values.ckan.scheming.dataset_fallback }}" + - name: ACTIVITY_STREAM_EMAIL_NOTIFICAYIONS + value: "{{ .Values.ckan.activityStreamsEmailNotifications }}" - name: CKAN_STORAGE_PATH value: {{ .Values.ckan.storagePath }} {{- if .Values.external.enabled }} @@ -345,11 +358,11 @@ spec: key: ckanDatastoreReadUrl {{- if .Values.solr.enabled }} - name: CKAN_SOLR_URL - value: http://{{ .Release.Name }}-solr-headless:8983/solr/ckancollection + value: http://{{ include "ckan.fullname" . }}-solr-headless:8983/solr/ckancollection {{- end }} {{- if .Values.redis.enabled }} - name: CKAN_REDIS_URL - value: redis://{{ .Release.Name }}-redis-headless:6379/0 + value: redis://ckan-redis-headless:6379/0 {{- end }} - name: CKANEXT_SPATIAL_SEARCH_BACKEND value: {{ .Values.ckan.spatialBackend }} @@ -395,9 +408,9 @@ spec: failureThreshold: {{ .Values.ckan.liveness.failureThreshold }} timeoutSeconds: {{ .Values.ckan.liveness.timeoutSeconds }} volumeMounts: - - name: ckan-prerun-configmap + - name: ckan-{{ include "ckan.fullname" . }}-prerun-configmap mountPath: /srv/prerun - - name: ckan-ini-overlay-configmap + - name: ckan-{{ include "ckan.fullname" . }}-ini-overlay-configmap mountPath: /config/ - name: ckan-config mountPath: /srv/app diff --git a/stable/ckan/templates/ing/ckan.yaml b/stable/ckan/templates/ing/ckan.yaml index eced5e40..704e882f 100644 --- a/stable/ckan/templates/ing/ckan.yaml +++ b/stable/ckan/templates/ing/ckan.yaml @@ -12,9 +12,9 @@ kind: Ingress metadata: name: {{ $fullName }} labels: - app.kubernetes.io/name: {{ include "ckan.name" . }} + app.kubernetes.io/name: {{ include "ckan.fullname" . }} helm.sh/chart: {{ include "ckan.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/instance: {{ include "ckan.fullname" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- with .Values.ingress.annotations }} annotations: diff --git a/stable/ckan/templates/pvc/pvc.yaml b/stable/ckan/templates/pvc/pvc.yaml index 6e394ee1..c266fbd3 100644 --- a/stable/ckan/templates/pvc/pvc.yaml +++ b/stable/ckan/templates/pvc/pvc.yaml @@ -8,9 +8,9 @@ metadata: {{- end }} name: {{ include "ckan.fullname" . }} labels: - app.kubernetes.io/name: {{ include "ckan.name" . }} + app.kubernetes.io/name: {{ include "ckan.fullname" . }} helm.sh/chart: {{ include "ckan.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/instance: {{ include "ckan.fullname" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} spec: accessModes: diff --git a/stable/ckan/templates/sa/ckan.yaml b/stable/ckan/templates/sa/ckan.yaml index 25afdcdb..ff7de0e2 100644 --- a/stable/ckan/templates/sa/ckan.yaml +++ b/stable/ckan/templates/sa/ckan.yaml @@ -4,9 +4,9 @@ kind: ServiceAccount metadata: name: {{ include "ckan.serviceAccountName" . }} labels: - app.kubernetes.io/name: {{ include "ckan.name" . }} + app.kubernetes.io/name: {{ include "ckan.fullname" . }} helm.sh/chart: {{ include "ckan.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/instance: {{ include "ckan.fullname" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- with .Values.ckan.serviceAccount.annotations }} annotations: diff --git a/stable/ckan/templates/secret/pgbouncer.yaml b/stable/ckan/templates/secret/pgbouncer.yaml index 0c74165a..3c40b7b5 100644 --- a/stable/ckan/templates/secret/pgbouncer.yaml +++ b/stable/ckan/templates/secret/pgbouncer.yaml @@ -4,9 +4,9 @@ kind: Secret metadata: name: {{ include "ckan.fullname" . }}-pgbouncer labels: - app.kubernetes.io/name: {{ include "ckan.name" . }} + app.kubernetes.io/name: {{ include "ckan.fullname" . }} helm.sh/chart: {{ include "ckan.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/instance: {{ include "ckan.fullname" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} data: pgbouncer.ini: {{ tpl (.Files.Get "conf/pgbouncer/pgbouncer.ini") . | b64enc }} diff --git a/stable/ckan/templates/svc/ckan.yaml b/stable/ckan/templates/svc/ckan.yaml index 52bd09a4..48780604 100644 --- a/stable/ckan/templates/svc/ckan.yaml +++ b/stable/ckan/templates/svc/ckan.yaml @@ -3,9 +3,9 @@ kind: Service metadata: name: {{ include "ckan.fullname" . }} labels: - app.kubernetes.io/name: {{ include "ckan.name" . }} + app.kubernetes.io/name: {{ include "ckan.fullname" . }} helm.sh/chart: {{ include "ckan.chart" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/instance: {{ include "ckan.fullname" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} spec: type: {{ .Values.ckan.service.type }} @@ -15,6 +15,6 @@ spec: protocol: TCP name: http selector: - app.kubernetes.io/name: {{ include "ckan.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/name: {{ include "ckan.fullname" . }} + app.kubernetes.io/instance: {{ include "ckan.fullname" . }} tier: ckan diff --git a/stable/ckan/values.yaml b/stable/ckan/values.yaml index c6540313..8e95f138 100644 --- a/stable/ckan/values.yaml +++ b/stable/ckan/values.yaml @@ -11,7 +11,7 @@ image: imagePullSecrets: [] nameOverride: "" -fullnameOverride: "ckan" +fullnameOverride: "" ## Configure Ingress resource that allow you to access the Drupal installation ## Set up the URL @@ -51,7 +51,14 @@ ckan: siteTitle: "Site Title here" siteId: "site-id-here" siteUrl: "http://localhost:5000" - ckanPlugins: "stats text_view image_view recline_view harvest ckan_harvester ccei" + ckanPlugins: "" + scheming: + organization_schemas: + group_schemas: + dataset_schemas: + presets: + dataset_fallback: false + resource_proxy_timeouts: 5 storagePath: "/var/lib/ckan/default" activityStreamsEmailNotifications: "true" debug: "false" @@ -59,22 +66,22 @@ ckan: psql: initialize: true db: - ckanDbName: ckan_default - ckanDbUser: ckan_default - ckanDbPassword: pass + ckanDbName: ckan + ckanDbUser: ckan + ckanDbPassword: "" datastore: RwDbName: datastore_default RwDbUser: datastorerw - RwDbPassword: pass + RwDbPassword: "" RoDbName: datastore_default RoDbUser: datastorero - RoDbPassword: pass + RoDbPassword: "" spatialBackend: "solr" locale: offered: "en" default: "en" datapusherUrl: "http://datapusher-headless:8000" - datapusherCallbackUrlBase: http://ckan + datapusherCallbackUrlBase: http://ckan-qol smtp: server: "smtpServerURLorIP:port" user: "smtpUser" @@ -141,17 +148,6 @@ ckan: name: ## Configuration values for DataPusher -datapusher: - enabled: true - fullnameOverride: datapusher - datapusher: - maxContentLength: "102400000" - chunkSize: "10240000" - insertRows: "50000" - downloadTimeout: "300" - datapusherSslVerify: "False" - datapusherRewriteResources: "True" - datapusherRewriteUrl: http://ckan ## Configuration values for Solr ## ToDo: Switch to Solr Operator sub-chart @@ -240,7 +236,7 @@ postgresql: ## Configuration values for PGBouncer pgbouncer: enabled: false - host: pgserver.postgres.database.azure.com + host: postgres user: username@hostname password: password poolSize: 50