automation-suite
2023.10
false
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。
UiPath logo, featuring letters U and I in white

Linux の Automation Suite のインストール ガイド

最終更新日時 2025年5月5日

レジストリ ポッドから未使用の Docker イメージをクリーンアップする方法

特定の状況では、レジストリのクリーンアップ コマンドを実行した後でも、未使用の Docker イメージがすべてのレジストリ ポッドから効果的にクリアされないことがあります。

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

残りの Docker イメージを削除するには、次のスクリプトを実行する必要があります。

#!/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."

このページは役に立ちましたか?

サポートを受ける
RPA について学ぶ - オートメーション コース
UiPath コミュニティ フォーラム
Uipath Logo White
信頼とセキュリティ
© 2005-2025 UiPath. All rights reserved.