Plantilla para desplegar el Agente de registro utilizando un Helm gráfico

Puede utilizar un gráfico Helm para desplegar el Agente de registro para recopilar y enrutar registros de infraestructura y aplicaciones desde un clúster Red Hat OpenShift on IBM Cloud (OpenShift) o un clúster Kubernetes a una instancia IBM Cloud Logs.

Plantilla para desplegar el Agente de registro utilizando un Helm en un clúster Openshift

metadata:
  name: "logs-agent"
image:
  version: "1.3.0"  # required

clusterName: ""     # Enter the name of your cluster. This information is used to improve the metadata and help with your filtering.

env:
  # ingestionHost is a required field. For example:
  # ingestionHost: "<logs instance>.ingress.us-east.logs.cloud.ibm.com"
  ingestionHost: "" # required

  # If you are using private CSE proxy, then use port number "3443"
  # If you are using private VPE Gateway, then use port number "443"
  # If you are using the public endpoint, then use port number "443"
  ingestionPort: "" # required

  iamMode: "TrustedProfile"
  # trustedProfileID - trusted profile id - required if iamMode is set to "TrustedProfile"
  trustedProfileID: ""

  # Configure this parameter to control the IAM endpoint used by the agent to exchange the tokens.
  # If omitted, the default value is "Production".
  # Valid values are :
  # "Production" to use the iam.cloud.ibm.com default endpoint
  # "PrivateProduction" to use the private.iam.cloud.ibm.com endpoint
  # "Custom" to use a custom provided IAM endpoint
  iamEnvironment: "Production"
  # iamHost - custom IAM endpoint (for example: private.eu-de.iam.cloud.ibm.com) - required if iamEnvironment is set to "Custom"
  iamHost: ""

scc:
  # true enables creation of Security Context Constraints in Openshift clusters
  create: true

defaultMetadata:
  # Configure to override the default subsystemName and applicationName that are used in the environment.
  subsystemName: ""  # The default value is set to the namespace that generated the log
  applicationName: ""  # The default value is set to the container name that generated the log

resources:
  # Configure this section to change the resources that are assigned to the agent container.
  limits:
    cpu: 500m
    ephemeral_storage: 10Gi
    memory: 3Gi
  requests:
    cpu: 100m
    ephemeral_storage: 2Gi
    memory: 1Gi

# Configure these parameters to include, exclude or restrict the set of logs that are processed by the agent
# By default, the agent will collect the logs from `/var/log/containers/*.log`.
# Each field is set as comma separated list, for example “/var/log/abc/*.log,/var/log/xyz/*.log”
additionalLogSourcePaths: "" # adds locations to the default set of logs that will be processed.
excludeLogSourcePaths: "" # ignores logs in the specified locations.
selectedLogSourcePaths: ""  # overrides the default path `/var/log/containers/*.log` and ignores the `additionalLogSourcePaths` configurations

# Configure this parameter to change the setting for the Kubernetes filter to include the annotations from Kubernetes with the log records.
# The default value for this setting is `false`.
includeAnnotations: true

# Configure this parameter to control the number of times the agent will retry sending data if an error occurs that is considered to be retryable.
# The default is `False`.
# For more information, see the [Fluentbit documentation about retries](https://docs.fluentbit.io/manual/administration/scheduling-and-retries) to understand the implications of setting this value.
retryLimit: False

# Configure additional tags as key/value pair tags that can be added as metadata to every log line.
additionalMetadata:
#  region: ca-tor
#  env: production

# Configure the level of logging
# Default value is info
# Valid values are: debug, info, or error
loggingLevel: info

Plantilla para desplegar el Agente de registro utilizando un Helm en un Kubernetes

metadata:
  name: "logs-agent"
image:
  version: "1.3.0"  # required

clusterName: ""     # Enter the name of your cluster. This information is used to improve the metadata and help with your filtering.

env:
  # ingestionHost is a required field. For example:
  # ingestionHost: "<logs instance>.ingress.us-east.logs.cloud.ibm.com"
  ingestionHost: "" # required

  # If you are using private CSE proxy, then use port number "3443"
  # If you are using private VPE Gateway, then use port number "443"
  # If you are using the public endpoint, then use port number "443"
  ingestionPort: "" # required

  iamMode: "TrustedProfile"
  # trustedProfileID - trusted profile id - required for iam trusted profile mode
  trustedProfileID: "" # required if iamMode is set to TrustedProfile

  # Configure this parameter to control the IAM endpoint used by the agent to exchange the tokens.
  # If omitted, the default value is "Production".
  # Valid values are :
  # "Production" to use the iam.cloud.ibm.com default endpoint
  # "PrivateProduction" to use the private.iam.cloud.ibm.com endpoint
  # "Custom" to use a custom provided IAM endpoint
  iamEnvironment: "Production"
  # iamHost - custom IAM endpoint (for example: private.eu-de.iam.cloud.ibm.com) - required if iamEnvironment is set to "Custom"
  iamHost: ""

scc:
  # true enables creation of Security Context Constraints in Openshift clusters
  # set to false for Kubernetes clusters
  create: false

defaultMetadata:
  # Configure to override the default subsystemName and applicationName that are used in the environment.
  subsystemName: ""  # The default value is set to the namespace that generated the log
  applicationName: ""  # The default value is set to the container name that generated the log

resources:
  # Configure this section to change the resources that are assigned to the agent container.
  limits:
    cpu: 500m
    ephemeral_storage: 10Gi
    memory: 3Gi
  requests:
    cpu: 100m
    ephemeral_storage: 2Gi
    memory: 1Gi

# Configure these parameters to include, exclude or restrict the set of logs that are processed by the agent
# By default, the agent will collect the logs from `/var/log/containers/*.log`.
# Each field is set as comma separated list, for example “/var/log/abc/*.log,/var/log/xyz/*.log”
additionalLogSourcePaths: "" # adds locations to the default set of logs that will be processed.
excludeLogSourcePaths: "" # ignores logs in the specified locations.
selectedLogSourcePaths: ""  # overrides the default path `/var/log/containers/*.log` and ignores the `additionalLogSourcePaths` configurations

# Configure this parameter to change the setting for the Kubernetes filter to include the annotations from Kubernetes with the log records.
# The default value for this setting is `false`.
includeAnnotations: true

# Configure this parameter to control the number of times the agent will retry sending data if an error occurs that is considered to be retryable.
# The default is `False`.
# For more information, see the [Fluentbit documentation about retries](https://docs.fluentbit.io/manual/administration/scheduling-and-retries) to understand the implications of setting this value.
retryLimit: False

# Configure additional tags as key/value pair tags that can be added as metadata to every log line.
additionalMetadata:
#  region: ca-tor
#  env: production

# Configure the level of logging
# Default value is info
# Valid values are: debug, info, or error
loggingLevel: info

Helm Opciones de configuración de gráficos

La siguiente tabla contiene una lista de los parámetros que puede configurar en el archivo logs-values.yaml para ajustar las configuraciones de Agente de registro:

Parámetros del mapa delHelm
Parámetro Descripción Estado Valor predeterminado
metadata.name El nombre del agente que se utiliza para todos los recursos Kubernetes Obligatorio logs-agent
image.version La versión de la imagen contenedora del agente (por ejemplo, 1.3.0) Obligatorio No hay ningún valor predeterminado
env.ingestionHost El IBM Cloud Logs host al que enviar los registros Obligatorio No hay ningún valor predeterminado
env.ingestionPort El puerto IBM Cloud Logs al que enviar los registros Obligatorio No hay ningún valor predeterminado
env.iamMode Indique el mecanismo de autenticación IAM utilizado. Los valores válidos son: TrustedProfile o IAMAPIKey Obligatorio TrustedProfile
env.trustedProfileID El ID del perfil de confianza. Este parámetro es necesario cuando iamMode=TrustedProfile No hay ningún valor predeterminado
env.iamEnvironment Controla el endpoint IAM utilizado por el agente para intercambiar los tokens.
Para obtener más información, consulte iamEnvironment.
Obligatorio Production
env.iamHost Nombre de host utilizado para el entorno IAM personalizado. Necesario si iamEnviroment está configurado como Custom. No hay ningún valor predeterminado
secret.iamAPIKey El ID de la APIKey. Sólo debe proporcionar este valor a través de la CLI. Para obtener más información, consulte env.iamMode. Este parámetro es necesario cuando iamMode=IAMAPIKey No hay ningún valor predeterminado
clusterName El nombre del clúster kubernetes Opcional No hay ningún valor predeterminado
scc.create Indica cuándo crear las Restricciones de Contexto Seguro en Openshift Requerido solo para despliegues de clúster Openshift. false
defaultMetadata.subsystemName Cadena estática para anular el subsystemName en IBM Cloud Logs Opcional El valor por defecto se establece en el espacio de nombres que generó el registro
defaultMetadata.applicationName Cadena estática para anular el applicationName en IBM Cloud Logs Opcional El valor por defecto es el nombre del contenedor que generó el registro
resources Anular los recursos kubernetes asignados al logs-agent Opcional Consulte Recursos para ver los valores por defecto
additionalLogSourcePaths La ruta de logs adicionales más allá del predeterminado. /var/log/containers/*.log
Para obtener más información, consulte Configuraciones de rutas de origen de registros.
Opcional No hay ningún valor predeterminado
excludeLogSourcePaths La ruta de los registros adicionales que no deben ser recogidos por el agente.
Para obtener más información, consulte Configuraciones de rutas de origen de registro.
Opcional No hay ningún valor predeterminado
selectedLogSourcePaths La ruta de los logs que son recogidos por el agente, excluyendo la ruta por defecto y cualquier archivo configurado en additionalLogSourcePaths.
Para obtener más información, consulte Configuraciones de rutas de origen de registro.
Opcional No hay ningún valor predeterminado
includeAnnotations Indique al plugin de kubernetes que incluya las anotaciones del contenedor con los mensajes de registro
' Para obtener más información, consulte [includeAnnotations#agent-helm-template-clusters-chart-options-include-annotations]).
Obligatorio false
retryLimit Limita el número de reintentos que se intentarán
Para más información, véase retryLimit
Obligatorio No
loggingLevel El tipo de registros que debe notificar el propio agente. Los valores válidos son: debug, info, o error. Obligatorio info
additionalMetadata Una lista de etiquetas de par clave/valor que pueden añadirse como metadatos a cada línea de registro.
Para obtener más información, consulte additionalMetadata.
Opcional No hay ningún valor predeterminado

env.iamMode

Configure este parámetro para elegir el método de autenticación que utilizará el agente cuando envíe registros a una instancia IBM Cloud Logs.

  • Puede elegir una configuración IAM APIKey o un perfil de confianza.
  • Los valores válidos son: TrustedProfile o IAMAPIKey
  • El valor predeterminado es una configuración de perfil de confianza.

La entrada en el archivo logs-values.yaml tiene el siguiente aspecto:

env:
  iamMode: IAMAPIKey

Tenga en cuenta la siguiente información al configurar este parámetro:

  • Si se establece env.iamMode: "TrustedProfile", también debe proporcionarse la variable env.trustedProfileID.

  • Si env.iamMode: "IAMAPIKey" está establecido, la configuración espera que se defina un secreto que contenga una Apikey IAM con permisos.

    Si la variable secret.iamAPIKey se proporciona en el comando de control (por ejemplo, --set secret.iamAPIKey=<your iamAPIKey>), entonces el gráfico de control creará el secreto Kubernetes.

    Alternativamente, puede crear el secreto de antemano con el comando: (Asegúrese de que está conectado a su clúster)

    kubectl create secret generic <helm install-name> -n ibm-observe --from-literal=IAM_API_KEY=<apikey>
    

defaultMetadata

Esta sección permite al usuario anular los valores predeterminados subsystemName y applicationName que se utilizan en el entorno. Por defecto, los valores no se establecen y el plugin de salida establecerá dinámicamente los valores a:

  • subsystemName: el espacio de nombres Kubernetes que generó el registro
  • applicationName: el nombre del contenedor que generó el registro

La entrada en el archivo logs-values.yaml tiene el siguiente aspecto:

defaultMetadata:
  subsystemName: ""
  applicationName: ""

recursos

Esta sección permite al usuario cambiar los recursos que se asignan al contenedor Agente de registro.

La entrada en el archivo logs-values.yaml tiene el siguiente aspecto y establece los siguientes valores predeterminados:

resources:
  limits:
    cpu: 500m
    ephemeral_storage: 10Gi
    memory: 3Gi
  requests:
    cpu: 100m
    ephemeral_storage: 2Gi
    memory: 1Gi

Si necesita actualizar alguno de los valores, deberá proporcionar la configuración completa aunque no actualice todos los valores.

Configuraciones de las rutas de origen de los registros

Por defecto el agente recogerá los logs de /var/log/containers/*.log.

Se pueden proporcionar las siguientes variables adicionales para incluir, excluir o restringir el conjunto de registros a procesar:

  • additionalLogSourcePaths añade ubicaciones al conjunto predeterminado de registros que se procesarán.
  • excludeLogSourcePaths ignora los registros en las ubicaciones especificadas.
  • selectedLogSourcePaths anula la ruta por defecto /var/log/containers/*.log e ignora las configuraciones additionalLogSourcePaths. El agente sólo recoge los archivos que se establecen mediante este parámetro.

Puede definir varias rutas utilizando una lista separada por comas, por ejemplo "/var/log/abc/.log,/var/log/xyz/.log".

La entrada en el archivo logs-values.yaml tiene el siguiente aspecto:

# comma separated list, for example “/var/log/abc/*.log,/var/log/xyz/*.log”
additionalLogSourcePaths: ""
excludeLogSourcePaths: ""
selectedLogSourcePaths: ""

env.iamEnvironment

Esta configuración controla el endpoint IAM utilizado por el agente para intercambiar los tokens.

El valor predeterminado es Production.

Los valores válidos son :

  • Establezca Production para utilizar el punto final predeterminado iam.cloud.ibm.com
  • Establezca PrivateProduction para utilizar el punto final private.iam.cloud.ibm.com
  • Establecer Custom para utilizar un punto final IAM personalizado (por ejemplo, private.eu-de.iam.cloud.ibm.com )

La entrada en el archivo logs-values.yaml tiene el siguiente aspecto:

env:
  iamEnvironment: "Production"

Para una configuración de Custom iamEnvironment, también se debe proporcionar el iamHost.

env:
  iamEnvironment: "Custom"
  iamHost: "private.eu-de.iam.cloud.ibm.com"

includeAnnotations

Esta configuración cambia la configuración del filtro Kubernetes para incluir las anotaciones de Kubernetes con los registros de log.

El valor por defecto de este ajuste es false.

La entrada en el archivo logs-values.yaml tiene el siguiente aspecto:

includeAnnotations: true

retryLimit

Esta configuración pone un límite al número de veces que el agente reintentará el envío de datos si se produce un error considerado reintentable.

El valor predeterminado es False.

Para obtener más información, consulte la documentación de Fluentbit sobre reintentos para comprender las implicaciones de establecer este valor.

En algunas situaciones, esta configuración puede provocar que el agente descarte los datos de registro debido a la imposibilidad de enviarlos.

La entrada en el archivo logs-values.yaml tiene el siguiente aspecto:

retryLimit: 8

additionalMetadata

Se trata de una lista de pares clave/valor que se añadirán bajo el objeto meta para permitir etiquetas adicionales.

La entrada en el archivo logs-values.yaml tiene el siguiente aspecto:

additionalMetadata:
  region: ca-tor
  env: production

El ejemplo anterior dará como resultado los siguientes campos adicionales añadidos a cada línea de registro en IBM Cloud Logs:

{
  "meta": {
    "region": "ca-tor",
    "env": "production"
  }
}