Skip to content

OPS-2703: Leverage upstream chart for persistency#50

Open
enys wants to merge 16 commits intodevelopfrom
feature/upstream-chart
Open

OPS-2703: Leverage upstream chart for persistency#50
enys wants to merge 16 commits intodevelopfrom
feature/upstream-chart

Conversation

@enys
Copy link
Copy Markdown
Contributor

@enys enys commented Apr 8, 2026

  • Start using memgraph official chart
  • values

@enys enys self-assigned this Apr 8, 2026
@enys enys changed the title feature/upstream chart OPS-2703: Leverage upstream chart for persistency Apr 10, 2026
@enys enys added cd:preview deploy preview environment and removed cd:preview deploy preview environment labels Apr 17, 2026
@enys
Copy link
Copy Markdown
Contributor Author

enys commented Apr 17, 2026

Currently blocked by memgraph/helm-charts#226

@enys enys added the cd:preview deploy preview environment label Apr 27, 2026
@argocd-linkurious
Copy link
Copy Markdown

Application memgraph-pr-50 is now running new version of deployments manifests.
See more here: https://argo-cd.k8s.dev.linkurious.net/applications/memgraph-pr-50?operation=true
Url:https://memgraph-pr-50.preview.k8s.preprod.linkurious.net

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR converts the local Memgraph Helm chart into an umbrella chart that delegates the core workloads to the official upstream memgraph and memgraph-lab sub-charts, while keeping local templates for ingress/network-policy glue.

Changes:

  • Switched charts/memgraph to an umbrella chart with upstream memgraph + memgraph-lab dependencies and updated values accordingly.
  • Removed in-repo templates for StatefulSet/Service/ServiceAccount/HPA/tests/exporter in favor of upstream chart resources.
  • Updated umbrella templates (IngressRoute, NetworkPolicies, NOTES, helpers) and adjusted Tilt config for a preprod context.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
charts/memgraph/values.yaml Restructured values to pass through to upstream sub-charts and added umbrella-only settings.
charts/memgraph/templates/tests/test-connection.yaml Removed Helm test pod template.
charts/memgraph/templates/statefulset.yaml Removed local StatefulSet template (now provided by upstream sub-chart).
charts/memgraph/templates/serviceaccount.yaml Removed local ServiceAccount template (now provided by upstream sub-chart).
charts/memgraph/templates/service.yaml Removed local Service template (now provided by upstream sub-chart).
charts/memgraph/templates/namespace-netpol.yaml Reworked NetworkPolicies to target DB/Lab/exporter resources in the new umbrella setup.
charts/memgraph/templates/mg-exporter.yaml Removed local exporter resources (now expected from upstream configuration).
charts/memgraph/templates/init-file-configmap.yaml Moved init-file configmap to umbrella-level values.
charts/memgraph/templates/ingressroute.yaml Updated IngressRoute to target Memgraph Lab service.
charts/memgraph/templates/hpa.yaml Removed HPA template.
charts/memgraph/templates/_helpers.tpl Updated helpers to support DB/Lab service naming and selectors under umbrella chart.
charts/memgraph/templates/NOTES.txt Updated post-install notes for umbrella chart endpoints and access instructions.
charts/memgraph/Chart.yaml Updated chart metadata/version and added upstream dependencies.
Tiltfile Adjusted Tilt context gating and Helm release naming for preprod.
.version Bumped chart version.
.bumpversion.cfg Updated bumpversion current_version.
Comments suppressed due to low confidence (1)

Tiltfile:14

  • Tilt is now gated on a k8s-preprod context, but it still hard-fails unless the namespace ends with dev. This combination will likely prevent Tilt from running in the intended preprod namespaces; align the namespace guard (or the context guard) with the environments you actually want Tilt to support.
if ctx.endswith('k8s-preprod'):
  allow_k8s_contexts(ctx)

if not k8s_namespace().endswith("dev"):
  fail("You are not targeting a dev namespace")

Comment thread charts/memgraph/templates/init-file-configmap.yaml
Comment on lines 32 to +41
- from:
- podSelector:
matchLabels:
{{- include "memgraphExporter.selectorLabels" . | nindent 12 }}
app: mg-exporter
{{- $promNs := (index .Values "memgraph" "prometheus" "namespace") }}
{{- if and $promNs (ne ($promNs | toString) (.Release.Namespace | toString)) }}
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: {{ $promNs }}
{{- end }}
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

In the DB NetworkPolicy, the from peers for the Prometheus exporter are split into separate list items (podSelector and namespaceSelector). In NetworkPolicy semantics these peers are OR'ed, so when prometheus.namespace is set this will allow all pods from that namespace, not just the exporter pods. Combine namespaceSelector and podSelector in the same peer entry to restrict access to only the exporter pods in that namespace.

Copilot uses AI. Check for mistakes.
Comment on lines 99 to 108
- to:
- podSelector:
matchLabels:
{{- include "memgraph.selectorLabels" . | nindent 12 }}
{{- if ne (.Values.prometheus.namespace | default .Release.Namespace) .Release.Namespace }}
{{- include "memgraph.dbSelectorLabels" . | nindent 12 }}
{{- $promNs := (index .Values "memgraph" "prometheus" "namespace") }}
{{- if and $promNs (ne ($promNs | toString) (.Release.Namespace | toString)) }}
- namespaceSelector:
matchLabels:
name: {{ .Release.Namespace }}
kubernetes.io/metadata.name: {{ .Release.Namespace }}
{{- end }}
Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

In the exporter egress NetworkPolicy, to peers are also split into separate list items (podSelector and namespaceSelector). If the exporter runs in a different namespace than Memgraph, this ends up allowing egress to any pod in the Memgraph namespace on the monitoring port. Combine namespaceSelector + podSelector in a single to peer so egress is limited to the Memgraph pods only.

Copilot uses AI. Check for mistakes.
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.

@copilot apply changes based on this feedback

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fixed in d900039. Both the DB NetworkPolicy from peers and the exporter egress to peers now combine podSelector and namespaceSelector in a single list entry (AND semantics) when the exporter runs in a different namespace, preventing over-broad access.

Comment thread charts/memgraph/values.yaml Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI commented Apr 28, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • memgraph.github.io
    • Triggering command: /usr/local/bin/helm helm template test charts/memgraph --set networkPolicies.create=true --set memgraph.prometheus.enabled=true --set memgraph.prometheus.namespace=monitoring --dependency-update (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of enys April 28, 2026 08:57
@enys
Copy link
Copy Markdown
Contributor Author

enys commented Apr 28, 2026

The only thing remaining to do is to add the container init for the dataset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cd:preview deploy preview environment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants