Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NETOBSERV-101 R&D: Kube enricher write path for downstream operator #22

Merged
merged 3 commits into from
Oct 20, 2022

Conversation

jpinsonneau
Copy link
Contributor

@jpinsonneau jpinsonneau commented Jul 20, 2022

This PR adds a configuration to allow flowlogs-pipeline service account to write to loki gateway

The hack_loki.md will need to be updated if we automatically deploy loki-operator from netobserv-operator

Related PRs:
netobserv/network-observability-operator#120
netobserv/network-observability-operator#135
netobserv/loki-client-go#1
netobserv/flowlogs-pipeline#260
netobserv/network-observability-console-plugin#183

Copy link

@mariomac mariomac left a comment

Choose a reason for hiding this comment

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

LGTM but didn't work because I don't have enough resources to run the Loki operator:

$ oc get pods -n openshift-logging
NAME                                        READY   STATUS    RESTARTS   AGE
lokistack-compactor-0                       0/1     Pending   0          15m
lokistack-distributor-778cfd5765-6mm6w      0/1     Pending   0          15m
lokistack-distributor-778cfd5765-9xj4x      0/1     Pending   0          15m
lokistack-gateway-b4bcc8d88-wbrlq           0/2     Pending   0          15m
lokistack-index-gateway-0                   1/1     Running   0          15m
lokistack-index-gateway-1                   0/1     Pending   0          14m
lokistack-ingester-0                        0/1     Pending   0          15m
lokistack-querier-5b48fc868d-sgw9h          0/1     Pending   0          15m
lokistack-querier-5b48fc868d-zsjqt          0/1     Pending   0          15m
lokistack-query-frontend-7b9b7c77b4-4z8c7   0/1     Pending   0          15m
lokistack-query-frontend-7b9b7c77b4-p46lw   0/1     Pending   0          15m

Describing one of the pending pods:

  Warning  FailedScheduling  6m51s (x10 over 15m)  default-scheduler  0/4 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 3 Insufficient cpu, 3 Insufficient memory.

Maybe could we document a minimum size for the cluster?

```
`issuerCAPath` can be left empty if you want to use server default API CA file. Else use relative path in gateway pod.
Then create a `LokiStack` in `openshift-logging` namespace from:
Administrator view -> Operators -> Installed Operators -> Loki Operator -> LokiStack -> Create LokiStack

Choose a reason for hiding this comment

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

Is there any way to do it from CLI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can put a yaml in our examples but we will need to maintain it on their api changes

Then create a `LokiStack` in `openshift-logging` namespace from:
Administrator view -> Operators -> Installed Operators -> Loki Operator -> LokiStack -> Create LokiStack
- ensure the name is `lokistack`
- set `Object Storage` -> `Secret`. Check [documentation](https://loki-operator.dev/docs/object_storage.md/).

Choose a reason for hiding this comment

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

Any secret in particular? The command for creating the secret has been removed from the previous section

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The object storage secret from documentation examples. Since it's different for each storage, I prefer to be generic here

Create gateway and gateway-status routes:
```bash
oc -n openshift-logging apply -f examples/gateway_routes.yaml
oc apply -f examples/loki-role.yaml

Choose a reason for hiding this comment

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

Off-topic: Should this be created automatically by the operator?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tenantID: application
sendAuthToken: true
url: 'https://lokistack-gateway-http.openshift-logging.svc.cluster.local:8080/api/logs/v1/application/'
```

Choose a reason for hiding this comment

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

Shall we add these fields into the config/samples/flows_v1alpha1_flowcollector.yaml file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When we will automatically deploy loki-operator from our operator, these will be forced to use the loki stack instance so the user will not have to set them.
If the user manage it's instance manually, I guess it's better to keep this separate (at least in another yaml file).

Note: I'm still looking at tenantID to add a network tenant in loki-operator.

@jpinsonneau
Copy link
Contributor Author

Maybe could we document a minimum size for the cluster?

Yes I can refer loki operator documentation. Did you try 1x.extra-small ?

@jpinsonneau jpinsonneau merged commit 035ce88 into netobserv:main Oct 20, 2022
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.

2 participants