Run and monitor a workflow
Go to file
2024-09-03 17:48:25 +02:00
conf updating with other components changes 2024-08-27 11:01:26 +02:00
demo_nginx Merge branch 'main' of https://cloud.o-forge.io/core/oc-monitord into services_demo 2024-09-03 17:48:25 +02:00
models Create and update a k8s service for each processing with expose model 2024-09-03 14:24:03 +02:00
workflow_builder refactor for better readability 2024-09-03 15:57:14 +02:00
.gitignore conf 2024-08-06 11:42:59 +02:00
Dockerfile debug 2024-08-20 15:23:02 +02:00
go.mod adapt to services 2024-08-29 10:17:31 +02:00
go.sum adapt to services 2024-08-29 10:17:31 +02:00
main.go correct some comments/typo 2024-09-03 15:57:35 +02:00
oc-monitord simplify processing check up 2024-08-29 09:34:10 +02:00
README.md How to set uo + TODO 2024-09-03 15:56:16 +02:00
test-logs-workflow.json files to display 2024-08-27 11:02:30 +02:00

oc-monitor

## Deploy in k8s (dev)

While a registry with all of the OC docker images has not been set-up we can export this image to k3s ctr

docker save oc-monitord:latest | sudo k3s ctr images import -

Then in the pod manifest for oc-monitord use :

image: docker.io/library/oc-monitord
imagePullPolicy: Never

Not doing so will end up in the pod having a ErrorImagePull

Allow argo to create services

In order for monitord to expose open cloud services on the node, we need to give him permission to create k8s services.

For that we can update the RBAC configuration for a role already created by argo :

### Manually edit the rbac authorization

kubectl edit roles.rbac.authorization.k8s.io -n argo argo-role

In rules add a new entry :

- apiGroups:
  - ""
  resources:  
  - services
    verbs:                                                                                                                                                          
    - get
    - create

Patch the rbac authorization with a one liner

kubectl patch role argo-role -n argo --type='json' -p='[{"op": "add", "path": "/rules/-", "value": {"apiGroups": [""], "resources": ["services"], "verbs": ["get","create"]}}]'

Check wether the modification is effective

kubectl auth can-i create services --as=system:serviceaccount:argo:argo -n argo

This command must return "yes"

## TODO

  • [ ] Logs the output of each pods :
    • logsPods() function already exists
    • need to implement the logic to create each pod's logger and start the monitoring routing
  • [ ] Allow the front to known on which IP the service are reachable
    • currently doing it by using kubectl get nodes -o wide