4.7. Utilisation des rapports de santé à distance dans un réseau restreint
Vous pouvez collecter et télécharger manuellement les archives d'Insights Operator pour diagnostiquer les problèmes à partir d'un réseau restreint.
Pour utiliser l'Opérateur Insights dans un réseau restreint, vous devez
- Créez une copie de votre archive Insights Operator.
- Téléchargez l'archive Insights Operator sur console.redhat.com.
En outre, vous pouvez choisir d'obscurcir les données de l'opérateur Insights avant de les télécharger.
4.7.1. Exécution d'une opération de collecte par Insights Operator
Vous devez exécuter une opération de collecte pour créer une archive Insights Operator.
Conditions préalables
-
Vous êtes connecté à OpenShift Container Platform en tant que
cluster-admin
.
Procédure
Créez un fichier nommé
gather-job.yaml
en utilisant ce modèle :apiVersion: batch/v1 kind: Job metadata: name: insights-operator-job annotations: config.openshift.io/inject-proxy: insights-operator spec: backoffLimit: 6 ttlSecondsAfterFinished: 600 template: spec: restartPolicy: OnFailure serviceAccountName: operator nodeSelector: beta.kubernetes.io/os: linux node-role.kubernetes.io/master: "" tolerations: - effect: NoSchedule key: node-role.kubernetes.io/master operator: Exists - effect: NoExecute key: node.kubernetes.io/unreachable operator: Exists tolerationSeconds: 900 - effect: NoExecute key: node.kubernetes.io/not-ready operator: Exists tolerationSeconds: 900 volumes: - name: snapshots emptyDir: {} - name: service-ca-bundle configMap: name: service-ca-bundle optional: true initContainers: - name: insights-operator image: quay.io/openshift/origin-insights-operator:latest terminationMessagePolicy: FallbackToLogsOnError volumeMounts: - name: snapshots mountPath: /var/lib/insights-operator - name: service-ca-bundle mountPath: /var/run/configmaps/service-ca-bundle readOnly: true ports: - containerPort: 8443 name: https resources: requests: cpu: 10m memory: 70Mi args: - gather - -v=4 - --config=/etc/insights-operator/server.yaml containers: - name: sleepy image: quay.io/openshift/origin-base:latest args: - /bin/sh - -c - sleep 10m volumeMounts: [{name: snapshots, mountPath: /var/lib/insights-operator}]
apiVersion: batch/v1 kind: Job metadata: name: insights-operator-job annotations: config.openshift.io/inject-proxy: insights-operator spec: backoffLimit: 6 ttlSecondsAfterFinished: 600 template: spec: restartPolicy: OnFailure serviceAccountName: operator nodeSelector: beta.kubernetes.io/os: linux node-role.kubernetes.io/master: "" tolerations: - effect: NoSchedule key: node-role.kubernetes.io/master operator: Exists - effect: NoExecute key: node.kubernetes.io/unreachable operator: Exists tolerationSeconds: 900 - effect: NoExecute key: node.kubernetes.io/not-ready operator: Exists tolerationSeconds: 900 volumes: - name: snapshots emptyDir: {} - name: service-ca-bundle configMap: name: service-ca-bundle optional: true initContainers: - name: insights-operator image: quay.io/openshift/origin-insights-operator:latest terminationMessagePolicy: FallbackToLogsOnError volumeMounts: - name: snapshots mountPath: /var/lib/insights-operator - name: service-ca-bundle mountPath: /var/run/configmaps/service-ca-bundle readOnly: true ports: - containerPort: 8443 name: https resources: requests: cpu: 10m memory: 70Mi args: - gather - -v=4 - --config=/etc/insights-operator/server.yaml containers: - name: sleepy image: quay.io/openshift/origin-base:latest args: - /bin/sh - -c - sleep 10m volumeMounts: [{name: snapshots, mountPath: /var/lib/insights-operator}]
Copy to Clipboard Copied! Copiez votre version de l'image
insights-operator
:oc get -n openshift-insights deployment insights-operator -o yaml
$ oc get -n openshift-insights deployment insights-operator -o yaml
Copy to Clipboard Copied! Collez votre version de l'image dans
gather-job.yaml
:initContainers: - name: insights-operator image: <your_insights_operator_image_version> terminationMessagePolicy: FallbackToLogsOnError volumeMounts:
initContainers: - name: insights-operator image: <your_insights_operator_image_version> terminationMessagePolicy: FallbackToLogsOnError volumeMounts:
Copy to Clipboard Copied! Créer le travail de collecte :
oc apply -n openshift-insights -f gather-job.yaml
$ oc apply -n openshift-insights -f gather-job.yaml
Copy to Clipboard Copied! Recherchez le nom de l'unité d'emploi :
oc describe -n openshift-insights job/insights-operator-job
$ oc describe -n openshift-insights job/insights-operator-job
Copy to Clipboard Copied! Exemple de sortie
Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal SuccessfulCreate 7m18s job-controller Created pod: insights-operator-job-<your_job>
Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal SuccessfulCreate 7m18s job-controller Created pod: insights-operator-job-<your_job>
Copy to Clipboard Copied! où
insights-operator-job-<your_job>
est le nom du module.Vérifiez que l'opération est terminée :
oc logs -n openshift-insights insights-operator-job-<your_job> insights-operator
oc logs -n openshift-insights insights-operator-job-<your_job> insights-operator
Copy to Clipboard Copied! Exemple de sortie
I0407 11:55:38.192084 1 diskrecorder.go:34] Wrote 108 records to disk in 33ms
I0407 11:55:38.192084 1 diskrecorder.go:34] Wrote 108 records to disk in 33ms
Copy to Clipboard Copied! Sauvegarder l'archive créée :
oc cp openshift-insights/insights-operator-job-<your_job>:/var/lib/insights-operator ./insights-data
$ oc cp openshift-insights/insights-operator-job-<your_job>:/var/lib/insights-operator ./insights-data
Copy to Clipboard Copied! Nettoyer le travail :
oc delete -n openshift-insights job insights-operator-job
$ oc delete -n openshift-insights job insights-operator-job
Copy to Clipboard Copied!
4.7.2. Téléchargement d'une archive Insights Operator
Vous pouvez télécharger manuellement une archive Insights Operator vers console.redhat.com pour diagnostiquer les problèmes potentiels.
Conditions préalables
-
Vous êtes connecté à OpenShift Container Platform en tant que
cluster-admin
. - Vous disposez d'un poste de travail avec un accès illimité à l'internet.
- Vous avez créé une copie de l'archive Insights Operator.
Procédure
Téléchargez le fichier
dockerconfig.json
:oc extract secret/pull-secret -n openshift-config --to=.
$ oc extract secret/pull-secret -n openshift-config --to=.
Copy to Clipboard Copied! Copiez votre jeton
"cloud.openshift.com"
"auth"
dans le fichierdockerconfig.json
:{ "auths": { "cloud.openshift.com": { "auth": "<your_token>", "email": "asd@redhat.com" } }
{ "auths": { "cloud.openshift.com": { "auth": "<your_token>", "email": "asd@redhat.com" } }
Copy to Clipboard Copied! Téléchargez l'archive sur console.redhat.com:
curl -v -H \N "User-Agent : insights-operator/one10time200gather184a34f6a168926d93c330 cluster/<cluster_id>\N" -H "Authorization : Bearer <your_token>\N" -F \N "upload=@<path_to_archive>; type=application/vnd.redhat.openshift.periodic tar\N" https://console.redhat.com/api/ingress/v1/upload
$ curl -v -H \N "User-Agent : insights-operator/one10time200gather184a34f6a168926d93c330 cluster/<cluster_id>\N" -H "Authorization : Bearer <your_token>\N" -F \N "upload=@<path_to_archive>; type=application/vnd.redhat.openshift.periodic tar\N" https://console.redhat.com/api/ingress/v1/upload
Copy to Clipboard Copied! où
<cluster_id>
est l'identifiant de votre cluster,<your_token>
est le jeton de votre secret d'extraction, et<path_to_archive>
est le chemin d'accès à l'archive Insights Operator.Si l'opération est réussie, la commande renvoie une adresse
"request_id"
et"account_number"
:Exemple de sortie
* Connection #0 to host console.redhat.com left intact {"request_id":"393a7cf1093e434ea8dd4ab3eb28884c","upload":{"account_number":"6274079"}}%
* Connection #0 to host console.redhat.com left intact {"request_id":"393a7cf1093e434ea8dd4ab3eb28884c","upload":{"account_number":"6274079"}}%
Copy to Clipboard Copied!
Verification steps
- Connectez-vous à https://console.redhat.com/openshift.
- Cliquez sur le menu Clusters dans le volet gauche.
- Pour afficher les détails du cluster, cliquez sur le nom du cluster.
Ouvrez l'onglet Insights Advisor du cluster.
Si le téléchargement a réussi, l'onglet affiche l'un des éléments suivants :
- Your cluster passed all recommendationssi le conseiller Insights n'a pas identifié de problème.
- Liste des problèmes détectés par Insights Advisor, classés par ordre de priorité en fonction du risque (faible, modéré, important et critique).
4.7.3. Permettre de comprendre L'obscurcissement des données de l'opérateur
Vous pouvez activer l'obscurcissement pour masquer les adresses IPv4 et les domaines de base de cluster sensibles et identifiables que l'opérateur Insights envoie à console.redhat.com.
Bien que cette fonctionnalité soit disponible, Red Hat recommande de laisser l'obscurcissement désactivé pour une expérience d'assistance plus efficace.
L'obscurcissement attribue des valeurs non identifiantes aux adresses IPv4 des clusters et utilise une table de traduction conservée en mémoire pour remplacer les adresses IP par leurs versions obscurcies dans l'ensemble de l'archive Insights Operator avant de télécharger les données vers console.redhat.com.
Pour les domaines de base des clusters, l'obscurcissement remplace le domaine de base par une sous-chaîne codée en dur. Par exemple, cluster-api.openshift.example.com
devient cluster-api.<CLUSTER_BASE_DOMAIN>
.
La procédure suivante permet l'obscurcissement à l'aide du secret support
dans l'espace de noms openshift-config
.
Conditions préalables
-
Vous êtes connecté à la console web de OpenShift Container Platform en tant que
cluster-admin
.
Procédure
-
Naviguez jusqu'à Workloads
Secrets. - Sélectionnez le projet openshift-config.
-
Recherchez le secret support dans le champ Search by name. S'il n'existe pas, cliquez sur Create
Key/value secret pour le créer. -
Cliquez sur le menu Options
puis cliquez sur Edit Secret.
- Cliquez sur Add Key/Value.
-
Créez une clé nommée
enableGlobalObfuscation
avec une valeur detrue
, et cliquez sur Save. -
Naviguez vers Workloads
Pods -
Sélectionnez le projet
openshift-insights
. -
Trouvez la nacelle
insights-operator
. -
Pour redémarrer le pod
insights-operator
, cliquez sur le menu Optionspuis cliquez sur Delete Pod.
Vérification
-
Naviguez jusqu'à Workloads
Secrets. - Sélectionnez le projet openshift-insights.
- Recherchez le secret obfuscation-translation-table en utilisant le champ Search by name.
Si le secret obfuscation-translation-table
existe, l'obscurcissement est activé et fonctionne.
Vous pouvez également rechercher la valeur "is_global_obfuscation_enabled": true
dans votre archive Insights Operator à l'adresse /insights-operator/gathers.json
.