3.6. Exemples de réglages personnalisés
Using TuneD profiles from the default CR
La CR suivante applique un réglage personnalisé au niveau du nœud pour les nœuds OpenShift Container Platform dont l'étiquette tuned.openshift.io/ingress-node-label
est définie sur n'importe quelle valeur.
Exemple : réglage personnalisé à l'aide du profil openshift-control-plane TuneD
apiVersion: tuned.openshift.io/v1 kind: Tuned metadata: name: ingress namespace: openshift-cluster-node-tuning-operator spec: profile: - data: | [main] summary=A custom OpenShift ingress profile include=openshift-control-plane [sysctl] net.ipv4.ip_local_port_range="1024 65535" net.ipv4.tcp_tw_reuse=1 name: openshift-ingress recommend: - match: - label: tuned.openshift.io/ingress-node-label priority: 10 profile: openshift-ingress
apiVersion: tuned.openshift.io/v1
kind: Tuned
metadata:
name: ingress
namespace: openshift-cluster-node-tuning-operator
spec:
profile:
- data: |
[main]
summary=A custom OpenShift ingress profile
include=openshift-control-plane
[sysctl]
net.ipv4.ip_local_port_range="1024 65535"
net.ipv4.tcp_tw_reuse=1
name: openshift-ingress
recommend:
- match:
- label: tuned.openshift.io/ingress-node-label
priority: 10
profile: openshift-ingress
Les auteurs de profils personnalisés sont fortement encouragés à inclure les profils de démon TuneD par défaut fournis avec le CR Tuned par défaut. L'exemple ci-dessus utilise le profil par défaut openshift-control-plane
.
Using built-in TuneD profiles
Étant donné le succès du déploiement de l'ensemble des démons gérés par NTO, les opérandes TuneD gèrent tous la même version du démon TuneD. Pour obtenir la liste des profils TuneD intégrés pris en charge par le démon, interrogez n'importe quel module TuneD de la manière suivante :
oc exec $tuned_pod -n openshift-cluster-node-tuning-operator -- find /usr/lib/tuned/ -name tuned.conf -printf '%h\n' | sed 's|^.*/||'
$ oc exec $tuned_pod -n openshift-cluster-node-tuning-operator -- find /usr/lib/tuned/ -name tuned.conf -printf '%h\n' | sed 's|^.*/||'
Vous pouvez utiliser les noms de profil ainsi récupérés dans votre spécification de réglage personnalisé.
Exemple : utilisation du profil TuneD intégré de hpc-compute
apiVersion: tuned.openshift.io/v1 kind: Tuned metadata: name: openshift-node-hpc-compute namespace: openshift-cluster-node-tuning-operator spec: profile: - data: | [main] summary=Custom OpenShift node profile for HPC compute workloads include=openshift-node,hpc-compute name: openshift-node-hpc-compute recommend: - match: - label: tuned.openshift.io/openshift-node-hpc-compute priority: 20 profile: openshift-node-hpc-compute
apiVersion: tuned.openshift.io/v1
kind: Tuned
metadata:
name: openshift-node-hpc-compute
namespace: openshift-cluster-node-tuning-operator
spec:
profile:
- data: |
[main]
summary=Custom OpenShift node profile for HPC compute workloads
include=openshift-node,hpc-compute
name: openshift-node-hpc-compute
recommend:
- match:
- label: tuned.openshift.io/openshift-node-hpc-compute
priority: 20
profile: openshift-node-hpc-compute
En plus du profil intégré hpc-compute
, l'exemple ci-dessus inclut le profil du démon openshift-node
TuneD fourni avec le CR Tuned par défaut afin d'utiliser un réglage spécifique à OpenShift pour les nœuds de calcul.