Salta ai contenuti

Note OpenShift

Componente SCC Nota
k8sgpt operator e runtime restricted-v2 nessuna modifica
Ollama restricted-v2 rimuovi runAsUser/fsGroup dal manifest; HOME=/data scrivibile
vLLM restricted-v2 HOME=/tmp; GPU via device plugin, nessun privilegio
HolmesGPT restricted-v2 nessuna modifica

Verifica quale SCC è stata assegnata:

Finestra del terminale
oc -n ai-llm get pod -l app=ollama -o jsonpath='{.items[0].metadata.annotations.openshift\.io/scc}{"\n"}'
Finestra del terminale
oc -n ai-llm get events --field-selector reason=FailedCreate

In OpenShift non serve kube-prometheus-stack: si usa Thanos Querier, che richiede un token con ruolo cluster-monitoring-view.

Finestra del terminale
oc adm policy add-cluster-role-to-user cluster-monitoring-view -z ai-readonly -n ai-tools
Finestra del terminale
oc adm policy add-cluster-role-to-user cluster-monitoring-view -z <holmes-sa> -n holmes

URL interno:

https://thanos-querier.openshift-monitoring.svc:9091

Test dal bastion:

Finestra del terminale
TOKEN=$(oc -n ai-tools create token ai-readonly --duration=1h)
Finestra del terminale
HOST=$(oc -n openshift-monitoring get route thanos-querier -o jsonpath='{.spec.host}')
Finestra del terminale
curl -sk -H "Authorization: Bearer $TOKEN" "https://$HOST/api/v1/query?query=up" | jq '.data.result | length'

Nella configurazione del toolset Prometheus di HolmesGPT servono l’URL https e l’header Authorization: Bearer <token>: controlla nella documentazione del toolset come passare header e CA (service-ca). Il token del SA montato nel pod si trova in /var/run/secrets/kubernetes.io/serviceaccount/token.

https://alertmanager-main.openshift-monitoring.svc:9094

Richiede lo stesso token. Per gli alert dei workload utente (UWM):

Finestra del terminale
oc -n openshift-user-workload-monitoring get svc

Con gli IDMS generati da oc-mirror i manifest possono mantenere i nomi originali (docker.io/ollama/ollama): il pull viene rediretto al registry interno.

Finestra del terminale
oc get imagedigestmirrorset,imagetagmirrorset
Finestra del terminale
oc debug node/<worker> -- chroot /host cat /etc/containers/registries.conf.d/*.conf | head -40

Attenzione: IDMS funziona solo per pull by digest; per pull by tag serve ITMS.

Finestra del terminale
oc -n ai-llm create secret docker-registry registry-internal --docker-server=registry.internal --docker-username=<user> --docker-password=<token>
Finestra del terminale
oc -n ai-llm secrets link default registry-internal --for=pull

Da OperatorHub mirrorato: Node Feature Discovery e NVIDIA GPU Operator.

Finestra del terminale
oc get csv -n nvidia-gpu-operator
Finestra del terminale
oc get nodes -l nvidia.com/gpu.present=true
Finestra del terminale
oc describe node <gpu-node> | grep -A2 nvidia.com/gpu
Finestra del terminale
oc new-project ai-llm
Finestra del terminale
oc label namespace k8sgpt-operator-system holmes ai-tools ai-llm-access=true --overwrite