automation-suite
2023.10
false
Wichtig :
Es kann 1–2 Wochen dauern, bis die Lokalisierung neu veröffentlichter Inhalte verfügbar ist.
UiPath logo, featuring letters U and I in white

Automation Suite unter Linux – Installationsanleitung

Letzte Aktualisierung 30. Mai 2025

So löschen Sie ungenutzte Docker-Images aus Registrierungs-Pods

In bestimmten Situationen werden die nicht verwendeten Docker-Images nicht effektiv aus allen Registrierungs-Pods gelöscht, auch nach dem Ausführen des Befehls zur Bereinigung der Registrierung:

./bin/uipathctl registry cleanup --manifest versions/docker-images.json./bin/uipathctl registry cleanup --manifest versions/docker-images.json

Um die verbleibenden Docker-Images zu entfernen, müssen Sie das folgende Skript ausführen:

#!/bin/bash

# Set the namespace if necessary
NAMESPACE="docker-registry"  

# Get list of docker-registry StatefulSet pods
PODS=$(kubectl get pods -n $NAMESPACE -l app=docker-registry -o jsonpath='{.items[*].metadata.name}')

# Modify the docker-registry service selector to include traffic: allowed
echo "Modifying docker-registry service selector..."
kubectl patch svc docker-registry -n $NAMESPACE --type='json' -p='[{"op": "add", "path": "/spec/selector/traffic", "value": "allowed"}]'

# Loop through each registry pod one at a time
for POD in $PODS; do
    echo "Processing pod: $POD"

    # Add label traffic=allowed to the current pod
    kubectl label pod $POD -n $NAMESPACE traffic=allowed --overwrite
    echo "Label traffic=allowed added to $POD"

    # Run the registry cleanup command
    echo "Running registry cleanup on $POD..."
    ./bin/uipathctl registry cleanup --manifest versions/docker-images.json

    # Remove label traffic=allowed from the pod
    kubectl label pod $POD -n $NAMESPACE traffic-
    echo "Label traffic=allowed removed from $POD"

    echo "Completed cleanup for $POD"
done

# Revert the docker-registry service selector modification
echo "Reverting docker-registry service selector..."
kubectl patch svc docker-registry -n $NAMESPACE --type='json' -p='[{"op": "remove", "path": "/spec/selector/traffic"}]'

echo "Cleanup process completed for all registry pods."#!/bin/bash

# Set the namespace if necessary
NAMESPACE="docker-registry"  

# Get list of docker-registry StatefulSet pods
PODS=$(kubectl get pods -n $NAMESPACE -l app=docker-registry -o jsonpath='{.items[*].metadata.name}')

# Modify the docker-registry service selector to include traffic: allowed
echo "Modifying docker-registry service selector..."
kubectl patch svc docker-registry -n $NAMESPACE --type='json' -p='[{"op": "add", "path": "/spec/selector/traffic", "value": "allowed"}]'

# Loop through each registry pod one at a time
for POD in $PODS; do
    echo "Processing pod: $POD"

    # Add label traffic=allowed to the current pod
    kubectl label pod $POD -n $NAMESPACE traffic=allowed --overwrite
    echo "Label traffic=allowed added to $POD"

    # Run the registry cleanup command
    echo "Running registry cleanup on $POD..."
    ./bin/uipathctl registry cleanup --manifest versions/docker-images.json

    # Remove label traffic=allowed from the pod
    kubectl label pod $POD -n $NAMESPACE traffic-
    echo "Label traffic=allowed removed from $POD"

    echo "Completed cleanup for $POD"
done

# Revert the docker-registry service selector modification
echo "Reverting docker-registry service selector..."
kubectl patch svc docker-registry -n $NAMESPACE --type='json' -p='[{"op": "remove", "path": "/spec/selector/traffic"}]'

echo "Cleanup process completed for all registry pods."

War diese Seite hilfreich?

Hilfe erhalten
RPA lernen – Automatisierungskurse
UiPath Community-Forum
Uipath Logo White
Vertrauen und Sicherheit
© 2005–2025 UiPath. Alle Rechte vorbehalten