Skip to content

mbp-1128: Add Network Observability with NooBaa-backed Loki - #165

Open
pmatouse wants to merge 5 commits into
validatedpatterns:mainfrom
pmatouse:mbp-1128-network-observability
Open

mbp-1128: Add Network Observability with NooBaa-backed Loki#165
pmatouse wants to merge 5 commits into
validatedpatterns:mainfrom
pmatouse:mbp-1128-network-observability

Conversation

@pmatouse

Copy link
Copy Markdown

feat: add Network Observability with NooBaa-backed Loki

Install Loki and Network Observability operators via a storage-dependent
feature fragment, and deploy LokiStack plus FlowCollector using NooBaa
storage.

Signed-off-by: Petr Matousek pmatouse@redhat.com

Install Loki and Network Observability operators via a storage-dependent
feature fragment, and deploy LokiStack plus FlowCollector using NooBaa
storage.

Signed-off-by: Petr Matousek <pmatouse@redhat.com>
@pmatouse
pmatouse marked this pull request as draft July 23, 2026 09:51

@mlorenzofr mlorenzofr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

overall it's very good, but some small changes need to be made

Comment thread charts/netobserv/values.yaml Outdated
namespace: netobserv-loki
name: loki
size: 1x.extra-small
storageClassName: gp3-csi

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is AWS platform-specific. We should leave it empty and use the default StorageClass

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

addressed

secret:
name: {{ .Values.loki.storageSecretName }}
type: s3
storageClassName: {{ .Values.loki.storageClassName }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should look for a way to automatically detect the default storageClass, or fail if the storageClass is null, thus forcing the user to define it manually

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

addressed

Comment thread charts/netobserv/templates/loki-s3-credentials-job.yaml
- |
# NooBaa OBC creates a Secret (keys) + ConfigMap (bucket/host/port)
# with the same name as the claim — not all keys live in the Secret.
set -e

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we already run bash with the -e argument, we don't need set it again within the script

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

addressed

Comment thread values-hub.yaml

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You've committed the changes to enable the netobserv functionality
The original file from the main branch should be restored, and the configuration added within comments

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

that was an error from e2e testing facepalm

@pmatouse
pmatouse force-pushed the mbp-1128-network-observability branch from abcf24c to 091415e Compare July 23, 2026 16:45
{{- $sc -}}
{{- else -}}
{{- $default := "" -}}
{{- range (lookup "storage.k8s.io/v1" "StorageClass" "" "").items | default list -}}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've tested this in OCP 4.22 and using Helm lookup to find the default StorageClass works with helm install but fails in ArgoCD because ArgoCD's Helm renderer doesn't support lookup. I had to set loki.storageClassName explicitly via an ArgoCD helm parameter override.

If I'm not wrong, when storageClassName is omitted from the LokiStack CR, the Loki Operator uses the cluster's default StorageClass automatically (https://docs.redhat.com/en/documentation/red_hat_openshift_logging/6.5/html/installing_logging/verifying-cluster-prerequisites).

You can update the lokistack.yaml to make storageClassName conditional (see my next comment).

@pmatouse pmatouse Jul 29, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I am getting (Argo sync)

LokiStack.loki.grafana.com "loki" is invalid: spec.storageClassName: Required value

OCP 4.21/Loki Operator 6.6 omitting it is rejected

may be true for some Logging/Loki versions or for helm install paths, but under Argo it looks like the API requires the field

secret:
name: {{ .Values.loki.storageSecretName }}
type: s3
storageClassName: {{ include "netobserv.lokiStorageClassName" . }}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You can make it conditional to address my earlier comment:

    {{- with (include "netobserv.lokiStorageClassName" .) }}
    storageClassName: {{ . }}
    {{- end }}

@p-rog p-rog left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall LGTM

I left one suggestion which I found when I was testing it at OCP 4.22.
Additionally, it would be great to add network policies to the Network Observability feature, to follow ZT methodology. You can test my network policy architect skill :)

@pmatouse

Copy link
Copy Markdown
Author

Additionally, it would be great to add network policies to the Network Observability feature, to follow ZT methodology. You can test my network policy architect skill :)

I've added the the network policies

pmatouse added 4 commits July 30, 2026 12:34
Use Helm lookup for the default StorageClass when possible; require an
explicit value under Argo CD. LokiStack CRD rejects an omitted field.
Enable FlowCollector operator NPs for netobserv/privileged, and add
least-privilege policies for netobserv-loki.
@pmatouse
pmatouse force-pushed the mbp-1128-network-observability branch from 89a748b to 04a245d Compare July 30, 2026 10:35

@mlorenzofr mlorenzofr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall okay, it's almost ready for LGTM in my opinion, just a couple of minor things.

Additionally:

  • Change its status from draft to ready for review.
  • Do a rebase to get the latest changes from the main branch and avoid conflicts.

project: hub
path: charts/netobserv
annotations:
argocd.argoproj.io/sync-wave: "42"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The override of loki.storageClassName is mandatory, let's add it here even if it's just with an example:

Suggested change
argocd.argoproj.io/sync-wave: "42"
argocd.argoproj.io/sync-wave: "42"
overrides:
- name: loki.storageClassName
value: "<YOUR-STORAGE-CLASS>"

Comment thread values-hub.yaml
# project: hub
# path: charts/netobserv
# annotations:
# argocd.argoproj.io/sync-wave: "42" # Deploy after NooBaa storage backend

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
# argocd.argoproj.io/sync-wave: "42" # Deploy after NooBaa storage backend
# argocd.argoproj.io/sync-wave: "42" # Deploy after NooBaa storage backend
# overrides:
# - name: loki.storageClassName
# value: "" # Add your own storageClassName here

imagePullPolicy: IfNotPresent
securityContext:
allowPrivilegeEscalation: false
runAsNonRoot: true

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Already set at pod-level

capabilities:
drop:
- ALL
seccompProfile:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Already set at pod-level

@pmatouse
pmatouse marked this pull request as ready for review August 3, 2026 14:27
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