Skip to content

helm!: create unified chart - #122

Open
shimoncohen wants to merge 12 commits into
masterfrom
create-unified-helm-chart
Open

helm!: create unified chart#122
shimoncohen wants to merge 12 commits into
masterfrom
create-unified-helm-chart

Conversation

@shimoncohen

Copy link
Copy Markdown
Contributor

No description provided.

@CL-SHLOMIKONCHA CL-SHLOMIKONCHA left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we need it to publish the new "common" pycsw to dedicated common/pycsw docker and helm/common/pycsw helm path by the existing workflows

Comment thread helm/pycsw/config/pycsw-location.conf Outdated
@@ -0,0 +1,6 @@

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete empty line

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

# pycsw custom uwsgi settings injected into root location
uwsgi_pass {{ include "pycsw.service.fullname" . }}:{{ .Values.servicePort }};
include uwsgi_params;
uwsgi_hide_header Set-Cookie;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need it
current nginx (2.2.1) includes "blacklist headers"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These strip the Set-Cookie response header and blank the inbound Cookie sent to the uwsgi upstream. Does nginx 2.2.1's blacklist-headers cover both the response Set-Cookie and the request Cookie? If it covers both I'll drop lines 5-6; if it's response-headers only I'll keep uwsgi_param HTTP_Cookie "".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked auth.js. Its DENYLIST (incl. cookie) is applied by filterHeaders, which only builds the OPA authz subrequest body (input.headers) — and only on the OPA path. It doesn't strip Cookie from the request forwarded to the pycsw upstream, and touches no response headers at all.

So neither line here is covered by it:

  • uwsgi_hide_header Set-Cookie; — strips the response header from the upstream; auth.js never touches responses.
  • uwsgi_param HTTP_Cookie ""; — blanks Cookie to the uwsgi upstream; the denylist only filters what's sent to OPA, not upstream.

Keeping both.

Create service name as used by the service name label.
*/}}
{{- define "pycsw.service.fullname" -}}
{{- printf "%s-%s-%s" .Release.Name (include "pycsw.name" .) "service" }}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we just replace the "(include "pycsw.name" .) to .Chart.Name for each of those resources?

example:

Suggested change
{{- printf "%s-%s-%s" .Release.Name (include "pycsw.name" .) "service" }}
{{- printf "%s-%s-%s" .Release.Name .Chart.Name "service" }}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping pycsw.name here. This PR adds nameOverride support (see _helpers.tpl:6-8 and the values comment) so multiple aliased instances can deploy in one release without resource-name collisions. .Chart.Name is fixed to pycsw, which would break that. pycsw.name returns .Chart.Name by default and only differs when nameOverride is set.

{{ end }}
uwsgi.ini: {{ tpl (.Files.Get "config/pycswWsgi.ini") . | quote }}
CORS_ENABLED: {{ .Values.env.cors.enabled | quote }}
CORS_ALLOWED_HEADERS: {{ include "pycsw.cors.allowedHeaders" . | default (quote "") }}

@CL-SHLOMIKONCHA CL-SHLOMIKONCHA Jul 19, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does includes works as template? currently were using template for this allowHeaders render

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include returns the rendered string, so it can be piped — here into | default (quote ""). template is an action that writes directly to output and can't be piped, so it wouldn't work in this expression. Keeping include.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need to usetemplate? It should be * by default, today nginx handles the cors.

Comment thread helm/pycsw/values.yaml
nameOverride: ""

# REQUIRED: name of a ConfigMap provided by the consuming chart, containing the keys:
# pycsw.cfg - the pycsw configuration file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where will these files be found? (pycsw.cfg + mapping.py)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the ConfigMap named by existingConfigmap, provided by the consuming chart (documented at values.yaml:41-45). The deployment mounts its pycsw.cfg and mappings.py keys as files (see the volumes in deployment.yaml).

Comment thread helm/pycsw/templates/_helpers.tpl Outdated
the pycsw.cfg and mappings.py keys. The value may itself be a template.
Fails rendering when not provided.
*/}}
{{- define "pycsw.teamConfigmapName" -}}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to change this teamConfigmapName same on existingConfigmap

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed pycsw.teamConfigmapNamepycsw.existingConfigmapName (helper + the $existingConfigmapName var in deployment.yaml).

Comment thread helm/pycsw/values.yaml
repository: common/nginx
# defaults to the nginx chart appVersion when empty
tag: ""
mclabels:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing logScraping key - default to true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added logScraping: true under both mclabels and nginx.mclabels.

Comment thread helm/pycsw/values.yaml
tracing:
enabled: false
url: http://localhost:55681/v1/trace
metrics:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing prometheus key under metrics scope:

Image

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that relevant ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently, its defined within dem and raster helms

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mclabels.prometheus.{enabled,port} (values.yaml:33) already drives the prometheus scrape annotations via mclabels.annotations. The env.metrics.prometheus.{scrape,port} block in raster/dem looks legacy — no pycsw template reads it. Do you want it added for parity, or is the mclabels one sufficient? I lean toward mclabels-only to avoid duplication.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above — likely redundant with mclabels.prometheus, which already drives the scrape annotations here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, but there it's env.metrics.prometheus, which no pycsw template consumes. mclabels.prometheus covers the same purpose in this chart.

Comment thread helm/pycsw/values.yaml Outdated
enabled: true
# routesMapping must be set by the consuming chart, e.g.
# routesMapping:
# - path: /api/raster/v1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid mention raster here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the example to /api/<domain>/v1.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the path that mentioned a team chart path are irrelevant, actually, i guess you would like to get rid of raster/dem/3d etc.. helm directories in this PR

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to seperate this:
#125
We can approve it and merge to this branch first if you want.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Handled in #125 (helm: remove individual charts), which deletes the 3d/dem/raster dirs and their release-please paths. Merge #125 into this branch first, as noted above.

- remove leading empty line in pycsw-location.conf
- rename pycsw.teamConfigmapName helper to pycsw.existingConfigmapName
  to align with the existingConfigmap value
- add logScraping: true to mclabels and nginx.mclabels
- genericize routesMapping example (raster -> <domain>)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread helm/pycsw/config/server.conf
Comment thread helm/pycsw/Chart.yaml Outdated
Comment thread helm/pycsw/values.yaml Outdated
Comment thread helm/pycsw/values.yaml Outdated
The nginx config files were renamed config/pycsw-{location,server}.conf ->
config/{location,server}.conf but references still pointed at the old names,
breaking .Files.Get at render. Update values.yaml (fileName, extraVolumeMounts),
nginx-configmap keys/Files.Get, and README.

Verified: helm template renders clean; configmap emits location.conf/server.conf.
Comment thread helm/pycsw/values.yaml Outdated
Comment thread helm/pycsw/values.yaml Outdated
Comment thread helm/pycsw/values.yaml Outdated
Comment thread helm/pycsw/README.md
shimoncohen and others added 2 commits July 29, 2026 17:06
…b schema example

- env.cors.allowedHeaders "x-api-key" -> "*"
- comment out nginx.image.tag (falls back to nginx chart appVersion)
- genericize env.db.schema example (drop raster-specific name)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1.1.0 requires the new mclabels `criticality` field; set it to
`customer` on both the pycsw and nginx mclabels blocks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants