automation-suite
2023.10
false
- Información general
- Requisitos
- Plantillas de implementación
- Manual: preparar la instalación
- Manual: preparar la instalación
- Paso 2: configurar el registro compatible con OCI para las instalaciones sin conexión
- Paso 3: configurar el almacén de objetos externo
- Paso 4: configurar High Availability Add-on
- Paso 5: configurar las bases de datos SQL
- Paso 6: configurar el equilibrador de carga
- Paso 7: configurar el DNS
- Paso 8: configurar los discos
- Paso 9: configurar los ajustes a nivel de kernel y sistema operativo
- Paso 10: configurar los puertos de nodo
- Paso 11: aplicar ajustes varios
- Paso 12: Validar e instalar los paquetes RPM necesarios
- Paso 13: Generar cluster_config.json
- Configuración de certificados
- Configuración de la base de datos
- Configuración del almacén de objetos externo
- Configuración de URL prefirmada
- Configuración de la autenticación Kerberos
- Configuración de registro externo compatible con OCI
- Disaster recovery: configuraciones activas/pasivas y activas/activas
- Configuración de High Availability Add-on
- Configuración específica de Orchestrator
- Configuración específica de Insights
- Process Mining-specific configuration
- Configuración específica de Document Understanding
- Automation Suite Robots-specific configuration
- Configuración de la supervisión
- Opcional: configurar el servidor proxy
- Opcional: habilitación de la resistencia a fallos de zona en un clúster multinodo de producción preparada para alta disponibilidad
- Opcional: pasar resolv.conf personalizado
- Optional: Increasing fault tolerance
- parámetros de install-uipath.sh
- Inclusión de un nodo agente dedicado compatible con GPU
- Añadir un nodo agente dedicado a Task Mining
- Conexión de la aplicación Task Mining
- Añadir un nodo agente dedicado a Automation Suite Robots
- Paso 15: configurar el registro temporal de Docker para las instalaciones sin conexión
- Paso 16: validar los requisitos previos para la instalación
- Manual: realizar la instalación
- Después de la instalación
- Administración de clústeres
- Gestionar los productos
- Primeros pasos con el Portal de administración del clúster
- Migrating objectstore from persistent volume to raw disks
- Migrar del en el clúster a High Availability Add-on externo
- Migrating data between objectstores
- Migrating in-cluster objectstore to external objectstore
- Migrar del registro en clúster a un registro externo compatible con OCI
- Cambiar manualmente al clúster secundario en una configuración activa/pasiva
- Disaster Recovery: realizar operaciones posteriores a la instalación
- Convertir una instalación existente en una configuración en varios sitios
- Directrices sobre la actualización de una implementación activa/pasiva o activa/activa
- Directrices sobre la copia de seguridad y restauración de una implementación activa/pasiva o activa/activa
- Redireccionando el tráfico de los servicios no compatibles al clúster principal
- Escalar una implementación de nodo único (evaluación) a una implementación multinodo (HA)
- Supervisión y alertas
- Migración y actualización
- Paso 1: Mover los datos de la organización de identidad de independiente a Automation Suite
- Paso 2: restaurar la base de datos del producto independiente
- Paso 3: Realizar una copia de seguridad de la base de datos de la plataforma en Automation Suite
- Paso 4: Fusionar organizaciones en Automation Suite
- Paso 5: actualizar las cadenas de conexión de los productos migrados
- Paso 6: migrar el Orchestrator independiente
- Paso 7: migrar Insights independiente
- Paso 8: eliminar el tenant predeterminado
- Realizar una migración de un solo tenant
- Migrar de Automation Suite en Linux a Automation Suite en EKS / AKS
- Actualizar Automation Suite
- Descargar los paquetes de instalación y obtener todos los archivos del primer nodo del servidor
- Recuperar la última configuración aplicada del clúster
- Actualizar la configuración del clúster
- Configurar el registro compatible con OCI para las instalaciones sin conexión
- Ejecutar la actualización
- Realizar operaciones posteriores a la actualización
- Configuración específica del producto
- Uso de la herramienta de configuración de Orchestrator
- Configurar parámetros de Orchestrator
- Configuración de Orchestrator
- Configurar AppSettings
- Configurar el tamaño máximo de la solicitud
- Anular la configuración de almacenamiento a nivel de clúster
- Configurar almacenes de credenciales
- Configurar clave de cifrado por tenant
- Limpiar la base de datos de Orchestrator
- Buenas prácticas y mantenimiento
- Solución de problemas
- Cómo solucionar los problemas de los servicios durante la instalación
- Cómo desinstalar el clúster
- Cómo limpiar los artefactos sin conexión para mejorar el espacio en disco
- Cómo borrar datos de Redis
- Cómo habilitar el registro de Istio
- Cómo limpiar manualmente los registros
- Cómo limpiar los registros antiguos almacenados en el depósito sf-logs
- Cómo deshabilitar los registros de transmisión para AI Center
- Cómo depurar instalaciones de Automation Suite fallidas
- Cómo eliminar imágenes del instalador antiguo después de la actualización
- Cómo deshabilitar la descarga de la suma de comprobación TX
- Cómo actualizar desde Automation Suite 2022.10.10 y 2022.4.11 a 2023.10.2
- Cómo establecer manualmente el nivel de registro de ArgoCD en Info
- Cómo expandir el almacenamiento de AI Center
- Cómo generar el pull_secret_value codificado para registros externos
- Cómo abordar los cifrados débiles en TLS 1.2
- Cómo trabajar con certificados
- Cómo reenviar registros de aplicaciones a Splunk
- Cómo limpiar las imágenes de Docker no utilizadas de los pods de registro
- Cómo recopilar datos de uso de DU con el almacén de objetos en el clúster (Ceph)
- Cómo instalar RKE2 SELinux en entornos aislados
- How to clean up old differential backups on an NFS server
- No se puede ejecutar una instalación sin conexión en el sistema operativo RHEL 8.4
- Error al descargar el paquete
- La instalación sin conexión falla porque falta un binario
- Problema de certificado en la instalación sin conexión
- First installation fails during Longhorn setup
- Error de validación de la cadena de conexión SQL
- Error en la comprobación de requisitos previos para el módulo iscsid de selinux
- Azure disk not marked as SSD
- Fallo tras la actualización del certificado
- El antivirus causa problemas de instalación
- Automation Suite not working after OS upgrade
- Automation Suite requiere que backlog_wait_time se establezca en 0
- El volumen no se puede montar porque no está listo para las cargas de trabajo
- Error de recopilación de registros del paquete de soporte
- Se ignora la cadena de conexión SQL de la automatización de pruebas
- Pérdida de datos al reinstalar o actualizar Insights tras la actualización de Automation Suite
- La actualización de nodo único falla en la etapa de tejido
- Cluster unhealthy after automated upgrade from 2021.10
- Upgrade fails due to unhealthy Ceph
- RKE2 no se inicia debido a un problema de espacio
- El volumen no se puede montar y permanece en estado de bucle de conexión/desconexión
- La actualización falla debido a objetos clásicos en la base de datos de Orchestrator
- El clúster de Ceph se encuentra en un estado degradado tras una actualización en paralelo.
- Un componente Insights en mal estado provoca el fallo de la migración
- La actualización del servicio falla para Apps
- Tiempos de actualización in situ
- La migración del registro de Docker se atasca en la fase de eliminación de PVC
- Error de aprovisionamiento de AI Center después de actualizar a 2023.10 o posterior
- La actualización falla en entornos sin conexión
- La validación SQL falla durante la actualización
- pod de snapshot-controller-crds en estado CrashLoopBackOff después de la actualización
- Error de actualización/reinstalación del punto final de la API REST de Longhorn
- La actualización falla debido a los tamaños de PVC de Insights anulados
- Establecer un intervalo de tiempo de espera para los portales de gestión
- La autenticación no funciona tras la migración
- kinit: no se puede encontrar la KDC para el territorio <AD Domain> mientras se obtienen las credenciales iniciales
- kinit: keytab no contiene claves adecuadas para *** mientras se obtienen las credenciales iniciales
- Error en la operación GSSAPI debido a un código de estado no válido
- Alarma recibida por un error en el trabajo de Kerberos-tgt-update
- Proveedor de SSPI: servidor no encontrado en la base de datos de Kerberos
- Error en inicio de sesión de un usuario AD debido a una cuenta deshabilitada
- ArgoCD login failed
- Actualizar las conexiones del directorio subyacente
- Fallo en la obtención de la imagen de Sandbox
- Los pods no se muestran en la interfaz de usuario de ArgoCD
- Fallo de la sonda Redis
- El servidor RKE2 no se inicia
- Secreto no encontrado en el espacio de nombres UiPath
- ArgoCD entra en estado de progreso tras la primera instalación
- Pods MongoDB en CrashLoopBackOff o pendientes de aprovisionamiento de PVC tras su eliminación
- Unhealthy services after cluster restore or rollback
- Pods atascados en Inicialización: 0 / X
- Faltan métricas de Ceph-rook en los paneles de supervisión
- Los pods no pueden comunicarse con FQDN en un entorno de proxy
- Error al configurar las alertas de correo electrónico después de la actualización
- No hay problema ascendente en buen estado
- Document Understanding no se encuentra en la barra izquierda de Automation Suite
- Estado fallido al crear una sesión de etiquetado de datos
- Estado fallido al intentar implementar una habilidad ML
- El trabajo de migración falla en ArgoCD
- El reconocimiento de la escritura manual con el extractor de formularios inteligente no funciona
- Error en la implementación de la habilidad ML debido a la caducidad del token
- Ejecutar alta disponibilidad con Process Mining
- La ingestión de Process Mining falló al iniciar sesión con Kerberos
- Después de Disaster Recovery, Dapr no funciona correctamente para Process Mining
- Configurar Dapr con Redis en modo clúster
- No se puede conectar a la base de datos AutomationSuite_ProcessMining_Warehouse utilizando una cadena de conexión en formato pyodbc
- La instalación de Airflow falla con sqlalchemy.exc.ArgumentError: no se pudo analizar la URL rfc1738 de la cadena ''
- Cómo añadir una regla de tabla de IP para utilizar el puerto 1433 de SQL Server
- El certificado de Automation Suite no es de confianza desde el servidor donde se ejecuta CData Sync
- Ejecutar la herramienta de diagnóstico
- Uso del paquete de soporte de Automation Suite
- Explorar registros
- Explorar la telemetría resumida
Importante :
La localización de contenidos recién publicados puede tardar entre una y dos semanas en estar disponible.

Guía de instalación de Automation Suite en Linux
Última actualización 13 de nov. de 2025
Si tienes problemas relacionados con el almacenamiento, consulta lo siguiente:
Descripción
El compactador de Thanos puede fallar al compactar las métricas cuando se detectan bloques corruptos en el almacén de objetos. Esta condición evita que el compactador procese las métricas, lo que conduce a un mayor uso del almacenamiento en el depósito de Ceph.Solución
Para solucionar el problema, sigue los siguientes pasos:- En cualquier nodo del servidor, ejecuta el siguiente script:
thanosns=monitoring && if kubectl get application -n argocd rancher-monitoring; then thanosns=cattle-monitoring-system; fi && cat <<EOF | kubectl apply -f - --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: annotations: labels: app.kubernetes.io/component: thanos-cleaner app.kubernetes.io/instance: thanos-block-cleaner app.kubernetes.io/name: thanos-block-cleaner name: thanos-cleaner-role namespace: ${thanosns} rules: - apiGroups: - apps resources: - statefulsets - statefulsets/scale verbs: - list - get - update - patch - apiGroups: - batch resources: - jobs - cronjobs verbs: - delete - list - get - update - create - watch - apiGroups: - "" resources: - pods verbs: - delete - list - get - update --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: labels: app.kubernetes.io/component: thanos-cleaner app.kubernetes.io/instance: thanos-block-cleaner app.kubernetes.io/name: thanos-block-cleaner name: thanos-cleaner-role-binding namespace: ${thanosns} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: thanos-cleaner-role subjects: - kind: ServiceAccount name: thanos-cleaner namespace: ${thanosns} --- apiVersion: v1 kind: ServiceAccount metadata: name: thanos-cleaner namespace: ${thanosns} --- apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: name: thanos-cleaner namespace: uipath spec: groups: - name: thanos rules: - alert: ThanosCompactorNotWorking annotations: description: Thanos compactor is not working. This will disable metrics compaction in objectstore bucket. Please check thanos compact pod in ${thanosns} namespace for any error. Compactor in faulty state will exhaust object store space message: Thanos compactor is not working. Please check if thanos cleaner job is functional and able to fix corruption runbook_url: https://docs.uipath.com/automation-suite/docs/alert-runbooks summary: Thanos compactor is not working expr: thanos_compactor_issue{job="thanos-cleaner"} >= 1 for: 1d labels: app: thanos severity: critical --- EOFthanosns=monitoring && if kubectl get application -n argocd rancher-monitoring; then thanosns=cattle-monitoring-system; fi && cat <<EOF | kubectl apply -f - --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: annotations: labels: app.kubernetes.io/component: thanos-cleaner app.kubernetes.io/instance: thanos-block-cleaner app.kubernetes.io/name: thanos-block-cleaner name: thanos-cleaner-role namespace: ${thanosns} rules: - apiGroups: - apps resources: - statefulsets - statefulsets/scale verbs: - list - get - update - patch - apiGroups: - batch resources: - jobs - cronjobs verbs: - delete - list - get - update - create - watch - apiGroups: - "" resources: - pods verbs: - delete - list - get - update --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: labels: app.kubernetes.io/component: thanos-cleaner app.kubernetes.io/instance: thanos-block-cleaner app.kubernetes.io/name: thanos-block-cleaner name: thanos-cleaner-role-binding namespace: ${thanosns} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: thanos-cleaner-role subjects: - kind: ServiceAccount name: thanos-cleaner namespace: ${thanosns} --- apiVersion: v1 kind: ServiceAccount metadata: name: thanos-cleaner namespace: ${thanosns} --- apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: name: thanos-cleaner namespace: uipath spec: groups: - name: thanos rules: - alert: ThanosCompactorNotWorking annotations: description: Thanos compactor is not working. This will disable metrics compaction in objectstore bucket. Please check thanos compact pod in ${thanosns} namespace for any error. Compactor in faulty state will exhaust object store space message: Thanos compactor is not working. Please check if thanos cleaner job is functional and able to fix corruption runbook_url: https://docs.uipath.com/es/automation-suite/docs/alert-runbooks summary: Thanos compactor is not working expr: thanos_compactor_issue{job="thanos-cleaner"} >= 1 for: 1d labels: app: thanos severity: critical --- EOF - En cualquier nodo del servidor, ejecuta el siguiente script:
cat <<'EOF' | kubectl apply -f - --- apiVersion: v1 data: thanos-cleanup.sh: | #!/bin/bash # Copyright UiPath 2021 # # ================= # LICENSE AGREEMENT # ----------------- # Use of paid UiPath products and services is subject to the licensing agreement # executed between you and UiPath. Unless otherwise indicated by UiPath, use of free # UiPath products is subject to the associated licensing agreement available here: # https://www.uipath.com/legal/trust-and-security/legal-terms (or successor website). # You must not use this file separately from the product it is a part of or is associated with. set -eu -o pipefail export PATH=$PATH:/thanos-bin/ # Below script removes the blocks which are overlapping or having index issue or having duplicated compaction # # In few cases with above mentioned scenarios, thanos may skip the compaction and halt the compaction module. # Compaction halt requires manual deletion of corrupted blocks and restart of compact pod. config_file=/etc/thanos/${THANOS_CONFIG_KEY} function info() { echo "[INFO] [$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" } function warn() { echo -e "\e[0;33m[WARN] [$(date +'%Y-%m-%dT%H:%M:%S%z')]:\e[0m $*" >&2 } function error_without_exit() { echo -e "\e[0;31m[ERROR][$(date +'%Y-%m-%dT%H:%M:%S%z')]:\e[0m $*" >&2 } function error() { echo -e "\e[0;31m[ERROR][$(date +'%Y-%m-%dT%H:%M:%S%z')]:\e[0m $*" >&2 exit 1 } function is_compaction_halted() { info "Checking if thanos compactor running" IFS=" " read -r -a compactor_addresses <<<"$(kubectl get pods -n "$NAMESPACE" -l app.kubernetes.io/instance=thanos-compact -o jsonpath="{.items[*].status.podIP}")" is_compactor_halted=0 if [[ "${#compactor_addresses[@]}" -eq 0 ]]; then info "Thanos compactor pod is not running" is_compactor_halted=1 fi for ip in "${compactor_addresses[@]}"; do #shellcheck disable=SC2086 halted=$(curl -s http://${ip}:10902/metrics | grep thanos_compact_halted | grep -v '#' | awk -F ' ' '{print $2}') if [[ "$halted" -eq "1" ]]; then warn "Compaction is halted" is_compactor_halted=1 break fi done return $is_compactor_halted } function execute_thanos_issue_command() { if [[ $# -ne 1 ]]; then error "missing issue name for execute_thanos_issue_command function" fi issue=$1 info "Checking for issue $issue" cmd_ret=0 #shellcheck disable=SC2086 verify_output=$(thanos tools bucket --objstore.config-file=${config_file} verify --log.format=json -i $issue 2>&1) && true || cmd_ret=1 if [[ $cmd_ret -eq 1 ]]; then error_without_exit "Output of $issue command: -> $verify_output" error "Failed to verify bucket for $issue" fi #shellcheck disable=SC2086 echo $verify_output } function fix_index_issue() { info "Fixing index_known_issue issue" verify_output=$(execute_thanos_issue_command "index_known_issues") #shellcheck disable=SC2086 for b in $(echo $verify_output | sed 's/} {/\r\n/g' | grep err | grep "detected issue" | awk -F '"id":' '{print $2}' | awk -F ',' '{print $1}' | tr -d '"'); do info "Block=$b is having the issue, removing it.." thanos tools bucket mark --id="$b" \ --marker=deletion-mark.json \ --details="deleted by job" \ --objstore.config-file="${config_file}" info "Block=$b is marked for deletion" done info "Fixing index_known_issue issue done" } function fix_overlapping_issue() { info "Fixing overlapped_blocks issue" overlap_output=$(execute_thanos_issue_command "overlapped_blocks") while IFS= read -r line; do #shellcheck disable=SC2086 for b in $(echo $line | awk -F '"overlap":' '{print $2}' | awk -v search="ulid" 'match($0, search) {print substr($0, RSTART)}' | sed 's/ulid/\r\nulid/g' | awk -F ',' '{print $1}' | grep '^ulid' | awk -F ': ' '{print $2}'); do info "Block=$b is having the issue, removing it.." thanos tools bucket mark --id="$b" \ --marker=deletion-mark.json \ --details="deleted by job" \ --objstore.config-file="${config_file}" info "Block=$b is marked for deletion" done done < <(echo "$overlap_output" | sed 's/} {/\r\n/g' | grep "found overlapped blocks") info "Fixing overlapped_blocks issue done" } function fix_duplicate_issue() { info "Fixing duplicated_compaction issue" duplicate_output=$(execute_thanos_issue_command "duplicated_compaction") #shellcheck disable=SC2086,SC2006 for b in $(echo $duplicate_output | sed 's/ts=2/\r\n2/g' | grep "Found duplicated blocks that are ok to be removed" | awk -F 'ULIDs="' '{print $2}' | tr -d '[]' | awk -F '"' '{print $1}'); do info "Block=$b is having the issue, removing it.." thanos tools bucket mark --id="$b" \ --marker=deletion-mark.json \ --details="deleted by job" \ --objstore.config-file="${config_file}" info "Block=$b is marked for deletion" done info "Fixing duplicated_compaction issue done" } if [[ -z "$NAMESPACE" ]]; then error "NAMESPACE is not set" fi # We will check if compaction is halted or not before checking for issues if is_compaction_halted; then info "Thanos compaction is working" echo "thanos_compactor_issue 0" | curl --data-binary @- "http://pushgateway-prometheus-pushgateway.uipath.svc.cluster.local:9091/metrics/job/thanos-cleaner" exit 0 fi warn "Thanos compactor is not working. Checking for corrupted blocks..." echo "thanos_compactor_issue 1" | curl --data-binary @- "http://pushgateway-prometheus-pushgateway.uipath.svc.cluster.local:9091/metrics/job/thanos-cleaner" if [[ "$DISABLE_BLOCK_CLEANER" == true ]]; then info "DISABLE_BLOCK_CLEANER is set to $DISABLE_BLOCK_CLEANER, skipping block clean" exit 0 fi info "DISABLE_BLOCK_CLEANER is set to $DISABLE_BLOCK_CLEANER, removing corrupted blocks" replica=$(kubectl get sts -n "$NAMESPACE" thanos-compact -o jsonpath='{.spec.replicas}') # compactor must not be running while deleting blocks info "Stopping compactor" kubectl scale sts -n "$NAMESPACE" thanos-compact --replicas=0 kubectl delete pods -n "$NAMESPACE" -l app.kubernetes.io/instance=thanos-compact --force # fixing index_known_issues info "Checking blocks having issue" fix_index_issue fix_overlapping_issue fix_duplicate_issue info "Triggering deletion of all marked blocks" #shellcheck disable=SC2086 thanos tools bucket cleanup --delete-delay=0 --objstore.config-file=${config_file} info "Corrupted blocks are deleted" info "Scaling thanos compactor's replica to $replica" #shellcheck disable=SC2086 kubectl scale sts -n "$NAMESPACE" thanos-compact --replicas=$replica info "Thanos compactor started" validate-cronjob.sh: | #!/bin/bash # Copyright UiPath 2021 # # ================= # LICENSE AGREEMENT # ----------------- # Use of paid UiPath products and services is subject to the licensing agreement # executed between you and UiPath. Unless otherwise indicated by UiPath, use of free # UiPath products is subject to the associated licensing agreement available here: # https://www.uipath.com/legal/trust-and-security/legal-terms (or successor website). # You must not use this file separately from the product it is a part of or is associated with. set -eu -o pipefail function info() { echo "[INFO] [$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" } function warn() { echo -e "\e[0;33m[WARN] [$(date +'%Y-%m-%dT%H:%M:%S%z')]:\e[0m $*" >&2 } function error_without_exit() { echo -e "\e[0;31m[ERROR][$(date +'%Y-%m-%dT%H:%M:%S%z')]:\e[0m $*" >&2 } function error() { echo -e "\e[0;31m[ERROR][$(date +'%Y-%m-%dT%H:%M:%S%z')]:\e[0m $*" >&2 exit 1 } alias kubectl='kubectl --cache-dir=/tmp/' IFS="," read -ra cronjobs <<<"$CRONJOB_LIST" for cr in "${cronjobs[@]}"; do #shellcheck disable=SC2206 name=(${cr//// }) cronNs=default cronName="" if [[ ${#name[@]} -gt 2 || ${#name[@]} -lt 1 ]]; then error "Invalid cronjob name=$cr" fi if [[ ${#name[@]} -eq 2 ]]; then cronNs=${name[0]} cronName=${name[1]} else cronName=${name[0]} fi info "Validating cronjob=$cr" jobName="${cronName}-sf-job-validation" created=1 info "Creating validation job for $cr" kubectl delete job -n "${cronNs}" "${jobName}" --ignore-not-found --timeout=3m #shellcheck disable=SC2086 kubectl create job -n "${cronNs}" --from=cronjob/${cronName} "$jobName" || created=0 if [[ $created == 0 ]]; then error "Failed to create job for $cr" fi #shellcheck disable=SC2086 kubectl wait --timeout=20m --for=condition=complete -n "${cronNs}" job/$jobName & cpid=$! #shellcheck disable=SC2086 kubectl wait --timeout=20m --for=condition=failed -n "${cronNs}" job/${jobName} && exit 1 & fpid=$! ret=0 wait -n $cpid $fpid || ret=1 kill -9 $cpid || true kill -9 $fpid || true if [[ $ret -eq 0 ]]; then info "Job for $cr is validated/completed" #ignore deletion error. if deletion fail then will get caught in next sync. This is to reduce failure during installation kubectl delete job -n "${cronNs}" "${jobName}" --timeout=3m || true else error "Job for $cr failed" fi done kind: ConfigMap metadata: name: thanos-cleaner-script namespace: cattle-monitoring-system --- EOFcat <<'EOF' | kubectl apply -f - --- apiVersion: v1 data: thanos-cleanup.sh: | #!/bin/bash # Copyright UiPath 2021 # # ================= # LICENSE AGREEMENT # ----------------- # Use of paid UiPath products and services is subject to the licensing agreement # executed between you and UiPath. Unless otherwise indicated by UiPath, use of free # UiPath products is subject to the associated licensing agreement available here: # https://www.uipath.com/legal/trust-and-security/legal-terms (or successor website). # You must not use this file separately from the product it is a part of or is associated with. set -eu -o pipefail export PATH=$PATH:/thanos-bin/ # Below script removes the blocks which are overlapping or having index issue or having duplicated compaction # # In few cases with above mentioned scenarios, thanos may skip the compaction and halt the compaction module. # Compaction halt requires manual deletion of corrupted blocks and restart of compact pod. config_file=/etc/thanos/${THANOS_CONFIG_KEY} function info() { echo "[INFO] [$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" } function warn() { echo -e "\e[0;33m[WARN] [$(date +'%Y-%m-%dT%H:%M:%S%z')]:\e[0m $*" >&2 } function error_without_exit() { echo -e "\e[0;31m[ERROR][$(date +'%Y-%m-%dT%H:%M:%S%z')]:\e[0m $*" >&2 } function error() { echo -e "\e[0;31m[ERROR][$(date +'%Y-%m-%dT%H:%M:%S%z')]:\e[0m $*" >&2 exit 1 } function is_compaction_halted() { info "Checking if thanos compactor running" IFS=" " read -r -a compactor_addresses <<<"$(kubectl get pods -n "$NAMESPACE" -l app.kubernetes.io/instance=thanos-compact -o jsonpath="{.items[*].status.podIP}")" is_compactor_halted=0 if [[ "${#compactor_addresses[@]}" -eq 0 ]]; then info "Thanos compactor pod is not running" is_compactor_halted=1 fi for ip in "${compactor_addresses[@]}"; do #shellcheck disable=SC2086 halted=$(curl -s http://${ip}:10902/metrics | grep thanos_compact_halted | grep -v '#' | awk -F ' ' '{print $2}') if [[ "$halted" -eq "1" ]]; then warn "Compaction is halted" is_compactor_halted=1 break fi done return $is_compactor_halted } function execute_thanos_issue_command() { if [[ $# -ne 1 ]]; then error "missing issue name for execute_thanos_issue_command function" fi issue=$1 info "Checking for issue $issue" cmd_ret=0 #shellcheck disable=SC2086 verify_output=$(thanos tools bucket --objstore.config-file=${config_file} verify --log.format=json -i $issue 2>&1) && true || cmd_ret=1 if [[ $cmd_ret -eq 1 ]]; then error_without_exit "Output of $issue command: -> $verify_output" error "Failed to verify bucket for $issue" fi #shellcheck disable=SC2086 echo $verify_output } function fix_index_issue() { info "Fixing index_known_issue issue" verify_output=$(execute_thanos_issue_command "index_known_issues") #shellcheck disable=SC2086 for b in $(echo $verify_output | sed 's/} {/\r\n/g' | grep err | grep "detected issue" | awk -F '"id":' '{print $2}' | awk -F ',' '{print $1}' | tr -d '"'); do info "Block=$b is having the issue, removing it.." thanos tools bucket mark --id="$b" \ --marker=deletion-mark.json \ --details="deleted by job" \ --objstore.config-file="${config_file}" info "Block=$b is marked for deletion" done info "Fixing index_known_issue issue done" } function fix_overlapping_issue() { info "Fixing overlapped_blocks issue" overlap_output=$(execute_thanos_issue_command "overlapped_blocks") while IFS= read -r line; do #shellcheck disable=SC2086 for b in $(echo $line | awk -F '"overlap":' '{print $2}' | awk -v search="ulid" 'match($0, search) {print substr($0, RSTART)}' | sed 's/ulid/\r\nulid/g' | awk -F ',' '{print $1}' | grep '^ulid' | awk -F ': ' '{print $2}'); do info "Block=$b is having the issue, removing it.." thanos tools bucket mark --id="$b" \ --marker=deletion-mark.json \ --details="deleted by job" \ --objstore.config-file="${config_file}" info "Block=$b is marked for deletion" done done < <(echo "$overlap_output" | sed 's/} {/\r\n/g' | grep "found overlapped blocks") info "Fixing overlapped_blocks issue done" } function fix_duplicate_issue() { info "Fixing duplicated_compaction issue" duplicate_output=$(execute_thanos_issue_command "duplicated_compaction") #shellcheck disable=SC2086,SC2006 for b in $(echo $duplicate_output | sed 's/ts=2/\r\n2/g' | grep "Found duplicated blocks that are ok to be removed" | awk -F 'ULIDs="' '{print $2}' | tr -d '[]' | awk -F '"' '{print $1}'); do info "Block=$b is having the issue, removing it.." thanos tools bucket mark --id="$b" \ --marker=deletion-mark.json \ --details="deleted by job" \ --objstore.config-file="${config_file}" info "Block=$b is marked for deletion" done info "Fixing duplicated_compaction issue done" } if [[ -z "$NAMESPACE" ]]; then error "NAMESPACE is not set" fi # We will check if compaction is halted or not before checking for issues if is_compaction_halted; then info "Thanos compaction is working" echo "thanos_compactor_issue 0" | curl --data-binary @- "http://pushgateway-prometheus-pushgateway.uipath.svc.cluster.local:9091/metrics/job/thanos-cleaner" exit 0 fi warn "Thanos compactor is not working. Checking for corrupted blocks..." echo "thanos_compactor_issue 1" | curl --data-binary @- "http://pushgateway-prometheus-pushgateway.uipath.svc.cluster.local:9091/metrics/job/thanos-cleaner" if [[ "$DISABLE_BLOCK_CLEANER" == true ]]; then info "DISABLE_BLOCK_CLEANER is set to $DISABLE_BLOCK_CLEANER, skipping block clean" exit 0 fi info "DISABLE_BLOCK_CLEANER is set to $DISABLE_BLOCK_CLEANER, removing corrupted blocks" replica=$(kubectl get sts -n "$NAMESPACE" thanos-compact -o jsonpath='{.spec.replicas}') # compactor must not be running while deleting blocks info "Stopping compactor" kubectl scale sts -n "$NAMESPACE" thanos-compact --replicas=0 kubectl delete pods -n "$NAMESPACE" -l app.kubernetes.io/instance=thanos-compact --force # fixing index_known_issues info "Checking blocks having issue" fix_index_issue fix_overlapping_issue fix_duplicate_issue info "Triggering deletion of all marked blocks" #shellcheck disable=SC2086 thanos tools bucket cleanup --delete-delay=0 --objstore.config-file=${config_file} info "Corrupted blocks are deleted" info "Scaling thanos compactor's replica to $replica" #shellcheck disable=SC2086 kubectl scale sts -n "$NAMESPACE" thanos-compact --replicas=$replica info "Thanos compactor started" validate-cronjob.sh: | #!/bin/bash # Copyright UiPath 2021 # # ================= # LICENSE AGREEMENT # ----------------- # Use of paid UiPath products and services is subject to the licensing agreement # executed between you and UiPath. Unless otherwise indicated by UiPath, use of free # UiPath products is subject to the associated licensing agreement available here: # https://www.uipath.com/legal/trust-and-security/legal-terms (or successor website). # You must not use this file separately from the product it is a part of or is associated with. set -eu -o pipefail function info() { echo "[INFO] [$(date +'%Y-%m-%dT%H:%M:%S%z')]: $*" } function warn() { echo -e "\e[0;33m[WARN] [$(date +'%Y-%m-%dT%H:%M:%S%z')]:\e[0m $*" >&2 } function error_without_exit() { echo -e "\e[0;31m[ERROR][$(date +'%Y-%m-%dT%H:%M:%S%z')]:\e[0m $*" >&2 } function error() { echo -e "\e[0;31m[ERROR][$(date +'%Y-%m-%dT%H:%M:%S%z')]:\e[0m $*" >&2 exit 1 } alias kubectl='kubectl --cache-dir=/tmp/' IFS="," read -ra cronjobs <<<"$CRONJOB_LIST" for cr in "${cronjobs[@]}"; do #shellcheck disable=SC2206 name=(${cr//// }) cronNs=default cronName="" if [[ ${#name[@]} -gt 2 || ${#name[@]} -lt 1 ]]; then error "Invalid cronjob name=$cr" fi if [[ ${#name[@]} -eq 2 ]]; then cronNs=${name[0]} cronName=${name[1]} else cronName=${name[0]} fi info "Validating cronjob=$cr" jobName="${cronName}-sf-job-validation" created=1 info "Creating validation job for $cr" kubectl delete job -n "${cronNs}" "${jobName}" --ignore-not-found --timeout=3m #shellcheck disable=SC2086 kubectl create job -n "${cronNs}" --from=cronjob/${cronName} "$jobName" || created=0 if [[ $created == 0 ]]; then error "Failed to create job for $cr" fi #shellcheck disable=SC2086 kubectl wait --timeout=20m --for=condition=complete -n "${cronNs}" job/$jobName & cpid=$! #shellcheck disable=SC2086 kubectl wait --timeout=20m --for=condition=failed -n "${cronNs}" job/${jobName} && exit 1 & fpid=$! ret=0 wait -n $cpid $fpid || ret=1 kill -9 $cpid || true kill -9 $fpid || true if [[ $ret -eq 0 ]]; then info "Job for $cr is validated/completed" #ignore deletion error. if deletion fail then will get caught in next sync. This is to reduce failure during installation kubectl delete job -n "${cronNs}" "${jobName}" --timeout=3m || true else error "Job for $cr failed" fi done kind: ConfigMap metadata: name: thanos-cleaner-script namespace: cattle-monitoring-system --- EOF -
Sustituye
SF_K8S_TAGpor la etiqueta de imagen correcta y, a continuación, aplica el trabajo programado.Desde el directorio del instalador en cualquier nodo del servidor, obtenga la última etiqueta:
cat versions/docker-images.json |grep uipath/sf-k8-utils-rhel | tr -d ',"' | awk -F ':' '{print $2}' |sort |uniq |tail -1cat versions/docker-images.json |grep uipath/sf-k8-utils-rhel | tr -d ',"' | awk -F ':' '{print $2}' |sort |uniq |tail -1A continuación, actualiza el bloque cronjob sustituyendoSF_K8S_TAGpor el valor devuelto.Una vez actualizado, pegue el bloque completo en el terminal de cualquier nodo del servidor:
thanosns=monitoring && if kubectl get application -n argocd rancher-monitoring; then thanosns=cattle-monitoring-system; fi && thanosimage=$(kubectl get statefulset -n $thanosns thanos-compact -o jsonpath='{.spec.template.spec.containers[0].image}') && cat <<EOF | kubectl apply -f - --- apiVersion: batch/v1 kind: CronJob metadata: name: thanos-cleaner namespace: ${thanosns} spec: concurrencyPolicy: Forbid failedJobsHistoryLimit: 3 jobTemplate: metadata: creationTimestamp: null spec: backoffLimit: 3 template: metadata: annotations: sidecar.istio.io/inject: "false" creationTimestamp: null labels: app.kubernetes.io/name: thanos-cleaner-cronjob spec: containers: - args: - /script/thanos-cleanup.sh command: - /bin/bash env: - name: NAMESPACE valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - name: THANOS_CONFIG_KEY value: thanos.yaml - name: DISABLE_BLOCK_CLEANER value: "false" image: docker.io/uipath/sf-k8-utils-rhel:SF_K8S_TAG imagePullPolicy: IfNotPresent name: thanos-cleaner resources: limits: cpu: 200m memory: 400Mi requests: cpu: 20m memory: 64Mi terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /script/ name: script - mountPath: /etc/thanos/ name: thanos-objectstore-vol - mountPath: /thanos-bin/ name: thanos - mountPath: /.kube/ name: kubedir - mountPath: /tmp/ name: tmpdir dnsPolicy: ClusterFirst initContainers: - args: - set -e; cp /bin/thanos /thanos-bin/thanos && chmod +x /thanos-bin/thanos command: - /bin/sh - -c image: ${thanosimage} imagePullPolicy: IfNotPresent name: copy-uipathcore-binary resources: {} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /thanos-bin/ name: thanos nodeSelector: kubernetes.io/os: linux restartPolicy: Never schedulerName: default-scheduler securityContext: fsGroup: 3000 runAsGroup: 2000 runAsNonRoot: true runAsUser: 1000 serviceAccount: thanos-cleaner serviceAccountName: thanos-cleaner terminationGracePeriodSeconds: 120 volumes: - emptyDir: {} name: kubedir - emptyDir: {} name: tmpdir - emptyDir: {} name: thanos - name: thanos-objectstore-vol secret: defaultMode: 420 secretName: thanos-objectstore-config - configMap: defaultMode: 420 name: thanos-cleaner-script name: script schedule: 0 1/6 * * * successfulJobsHistoryLimit: 2 suspend: false --- EOFthanosns=monitoring && if kubectl get application -n argocd rancher-monitoring; then thanosns=cattle-monitoring-system; fi && thanosimage=$(kubectl get statefulset -n $thanosns thanos-compact -o jsonpath='{.spec.template.spec.containers[0].image}') && cat <<EOF | kubectl apply -f - --- apiVersion: batch/v1 kind: CronJob metadata: name: thanos-cleaner namespace: ${thanosns} spec: concurrencyPolicy: Forbid failedJobsHistoryLimit: 3 jobTemplate: metadata: creationTimestamp: null spec: backoffLimit: 3 template: metadata: annotations: sidecar.istio.io/inject: "false" creationTimestamp: null labels: app.kubernetes.io/name: thanos-cleaner-cronjob spec: containers: - args: - /script/thanos-cleanup.sh command: - /bin/bash env: - name: NAMESPACE valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - name: THANOS_CONFIG_KEY value: thanos.yaml - name: DISABLE_BLOCK_CLEANER value: "false" image: docker.io/uipath/sf-k8-utils-rhel:SF_K8S_TAG imagePullPolicy: IfNotPresent name: thanos-cleaner resources: limits: cpu: 200m memory: 400Mi requests: cpu: 20m memory: 64Mi terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /script/ name: script - mountPath: /etc/thanos/ name: thanos-objectstore-vol - mountPath: /thanos-bin/ name: thanos - mountPath: /.kube/ name: kubedir - mountPath: /tmp/ name: tmpdir dnsPolicy: ClusterFirst initContainers: - args: - set -e; cp /bin/thanos /thanos-bin/thanos && chmod +x /thanos-bin/thanos command: - /bin/sh - -c image: ${thanosimage} imagePullPolicy: IfNotPresent name: copy-uipathcore-binary resources: {} terminationMessagePath: /dev/termination-log terminationMessagePolicy: File volumeMounts: - mountPath: /thanos-bin/ name: thanos nodeSelector: kubernetes.io/os: linux restartPolicy: Never schedulerName: default-scheduler securityContext: fsGroup: 3000 runAsGroup: 2000 runAsNonRoot: true runAsUser: 1000 serviceAccount: thanos-cleaner serviceAccountName: thanos-cleaner terminationGracePeriodSeconds: 120 volumes: - emptyDir: {} name: kubedir - emptyDir: {} name: tmpdir - emptyDir: {} name: thanos - name: thanos-objectstore-vol secret: defaultMode: 420 secretName: thanos-objectstore-config - configMap: defaultMode: 420 name: thanos-cleaner-script name: script schedule: 0 1/6 * * * successfulJobsHistoryLimit: 2 suspend: false --- EOF