mbp-1128: Add Network Observability with NooBaa-backed Loki - #165
mbp-1128: Add Network Observability with NooBaa-backed Loki#165pmatouse wants to merge 5 commits into
Conversation
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>
mlorenzofr
left a comment
There was a problem hiding this comment.
overall it's very good, but some small changes need to be made
| namespace: netobserv-loki | ||
| name: loki | ||
| size: 1x.extra-small | ||
| storageClassName: gp3-csi |
There was a problem hiding this comment.
This is AWS platform-specific. We should leave it empty and use the default StorageClass
| secret: | ||
| name: {{ .Values.loki.storageSecretName }} | ||
| type: s3 | ||
| storageClassName: {{ .Values.loki.storageClassName }} |
There was a problem hiding this comment.
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
| - | | ||
| # 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 |
There was a problem hiding this comment.
we already run bash with the -e argument, we don't need set it again within the script
There was a problem hiding this comment.
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
There was a problem hiding this comment.
that was an error from e2e testing facepalm
abcf24c to
091415e
Compare
| {{- $sc -}} | ||
| {{- else -}} | ||
| {{- $default := "" -}} | ||
| {{- range (lookup "storage.k8s.io/v1" "StorageClass" "" "").items | default list -}} |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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" . }} |
There was a problem hiding this comment.
You can make it conditional to address my earlier comment:
{{- with (include "netobserv.lokiStorageClassName" .) }}
storageClassName: {{ . }}
{{- end }}
p-rog
left a comment
There was a problem hiding this comment.
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 :)
I've added the the network policies |
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.
89a748b to
04a245d
Compare
mlorenzofr
left a comment
There was a problem hiding this comment.
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
mainbranch and avoid conflicts.
| project: hub | ||
| path: charts/netobserv | ||
| annotations: | ||
| argocd.argoproj.io/sync-wave: "42" |
There was a problem hiding this comment.
The override of loki.storageClassName is mandatory, let's add it here even if it's just with an example:
| argocd.argoproj.io/sync-wave: "42" | |
| argocd.argoproj.io/sync-wave: "42" | |
| overrides: | |
| - name: loki.storageClassName | |
| value: "<YOUR-STORAGE-CLASS>" |
| # project: hub | ||
| # path: charts/netobserv | ||
| # annotations: | ||
| # argocd.argoproj.io/sync-wave: "42" # Deploy after NooBaa storage backend |
There was a problem hiding this comment.
| # 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 |
There was a problem hiding this comment.
Already set at pod-level
| capabilities: | ||
| drop: | ||
| - ALL | ||
| seccompProfile: |
There was a problem hiding this comment.
Already set at pod-level
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