13.5. Red Hat Quay UI でクォータの確立

次の手順では、ストレージ消費量をレポートし、ストレージクォータ制限を設定する方法を説明します。

前提条件

  • Red Hat Quay レジストリー
  • スーパーユーザーアカウント
  • クォータ制限の要求を満たすのに十分なストレージ

手順

  1. 新しい組織を作成するか、既存の組織を選択します。Organization Settings タブに表示されているように、最初はクォータが設定されていません。

    No Quota Configured

  2. スーパーユーザーとしてレジストリーにログインし、Super User Admin PanelManage Organizations タブに移動します。ストレージクォータ制限を作成する組織の Options アイコンをクリックします。

    Organization options

  3. Configure Quota をクリックして、初期クォータ (たとえば 10 MB) を入力します。次に、Apply をクリックしてから Close をクリックします。

    Initial quota

  4. スーパーユーザーパネルの Manage Organizations タブで、消費されたクォータが 0 of 10 MB を示していることを確認します。

    Initial consumed quota

    消費されたクォータ情報は、組織ページから直接入手することもできます。

    最初に消費されたクォータ

    Initial consumed quota

  5. クォータを 100MB に増やすには、スーパーユーザーパネルの Manage Organizations タブに移動します。Options アイコンをクリックし、Configure Quota を選択して、クォータを 100 MB に設定します。Apply をクリックしてから Close をクリックします。

    Increase quota

  6. 次のコマンドを入力して、サンプルイメージをプルします。

    $ podman pull ubuntu:18.04
  7. 次のコマンドを入力して、サンプルイメージにタグを付けます。

    $ podman tag docker.io/library/ubuntu:18.04 example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/testorg/ubuntu:18.04
  8. 次のコマンドを入力して、サンプルイメージを組織にプッシュします。

    $ podman push --tls-verify=false example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/testorg/ubuntu:18.04
  9. スーパーユーザーパネルには、組織ごとに消費されたクォータが表示されます。

    Total Quota Consumed for first image

  10. 組織ページには、イメージで使用されているクォータの合計比率が表示されます。

    最初のイメージで消費された合計クォータ

    Total Quota Consumed for first image

  11. 次のコマンドを入力して、2 番目のサンプルイメージを取得します。

    $ podman pull nginx
  12. 次のコマンドを入力して、2 番目のイメージにタグを付けます。

    $ podman tag docker.io/library/nginx example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/testorg/nginx
  13. 次のコマンドを入力して、2 番目のイメージを組織にプッシュします。

    $ podman push --tls-verify=false example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/testorg/nginx
  14. 組織ページには、その組織の各リポジトリーで使用されているクォータの合計比率が表示されます。

    各リポジトリーで消費された合計クォータ

    Total Quota Consumed for each repository

  15. 拒否警告 の制限を作成します。

    スーパーユーザーパネルから、Manage Organizations タブに移動します。組織の Options アイコンをクリックし、Configure Quota を選択します。Quota Policy セクションで、Action タイプを Reject に設定し、Quota Threshold80 に設定して、Add Limit をクリックします。

    Reject limit

  16. 警告 制限を作成するには、Action タイプに Warning を選択し、Quota Threshold70 に設定して、Add Limit をクリックします。

    Warning limit

  17. クォータポップアップで Close をクリックします。制限は、Organization ページの Settings タブで表示できますが、編集することはできません。

    Quota policy in organization settings

  18. 拒否制限を超えたイメージをプッシュします。

    拒否制限 (80%) が現在のリポジトリーサイズ (~83%) 未満に設定されているため、次にプッシュされたイメージは自動的に拒否されます。

    サンプルイメージプッシュ

    $ podman pull ubuntu:20.04
    
    $ podman tag docker.io/library/ubuntu:20.04 example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/testorg/ubuntu:20.04
    
    $ podman push --tls-verify=false example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org/testorg/ubuntu:20.04

    クォータを超えたときのサンプル出力

    Getting image source signatures
    Copying blob d4dfaa212623 [--------------------------------------] 8.0b / 3.5KiB
    Copying blob cba97cc5811c [--------------------------------------] 8.0b / 15.0KiB
    Copying blob 0c78fac124da [--------------------------------------] 8.0b / 71.8MiB
    WARN[0002] failed, retrying in 1s ... (1/3). Error: Error writing blob: Error initiating layer upload to /v2/testorg/ubuntu/blobs/uploads/ in example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org: denied: Quota has been exceeded on namespace
    Getting image source signatures
    Copying blob d4dfaa212623 [--------------------------------------] 8.0b / 3.5KiB
    Copying blob cba97cc5811c [--------------------------------------] 8.0b / 15.0KiB
    Copying blob 0c78fac124da [--------------------------------------] 8.0b / 71.8MiB
    WARN[0005] failed, retrying in 1s ... (2/3). Error: Error writing blob: Error initiating layer upload to /v2/testorg/ubuntu/blobs/uploads/ in example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org: denied: Quota has been exceeded on namespace
    Getting image source signatures
    Copying blob d4dfaa212623 [--------------------------------------] 8.0b / 3.5KiB
    Copying blob cba97cc5811c [--------------------------------------] 8.0b / 15.0KiB
    Copying blob 0c78fac124da [--------------------------------------] 8.0b / 71.8MiB
    WARN[0009] failed, retrying in 1s ... (3/3). Error: Error writing blob: Error initiating layer upload to /v2/testorg/ubuntu/blobs/uploads/ in example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org: denied: Quota has been exceeded on namespace
    Getting image source signatures
    Copying blob d4dfaa212623 [--------------------------------------] 8.0b / 3.5KiB
    Copying blob cba97cc5811c [--------------------------------------] 8.0b / 15.0KiB
    Copying blob 0c78fac124da [--------------------------------------] 8.0b / 71.8MiB
    Error: Error writing blob: Error initiating layer upload to /v2/testorg/ubuntu/blobs/uploads/ in example-registry-quay-quay-enterprise.apps.docs.gcp.quaydev.org: denied: Quota has been exceeded on namespace

  19. 制限を超えると、UI に通知が表示されます。

    クォータ通知

    Quota notifications