Anypoint Flex Gateway では、管理された PKI 証明書を使用して Anypoint Platform と通信します。この証明書は、Flex Gateway を接続モードまたはローカルモードで登録すると生成されます。証明書を更新すると、確実にアプリケーションを運用し続けることができます。
証明書の更新は、flexctl registration renew コマンドを使用して登録を更新することで行います。
-
renew コマンドにより、Runtime Manager を使用して既存の Flex Gateway 登録が更新されます。 -
認証では、ユーザー証明書または接続アプリケーションのログイン情報を使用して
renew コマンドを実行します。ユーザーログイン情報を使用した認証には、--username フラグと --password フラグが必要です。接続アプリケーションのログイン情報を使用した認証には、--client-id フラグと --client-secret フラグが必要です。
flexctl registration inspect コマンドを使用して更新プロセスを確認します。
-
inspect コマンドでは、renew コマンドが成功したかどうかを確認するために使用できる登録情報が抽出されます。 -
inspect コマンドを使用して、登録の更新が実際に必要かどうかを最初に判断することもできます。inspect コマンドでは、証明書の有効期限が返されます。 -
デフォルトの方法を使用して更新を確認 (調査) することも、既存の登録ファイルを指定することもできます。フラグを付けずに
inspect コマンドを実行すると、このコマンドでデフォルトの方法を使用して登録状況が調査されます。
中断を回避する手順は、次のとおりです。
-
Flex Gateway の登録を更新します。
2 つの方法のいずれかを選択します。
-
更新プロセスが成功したことを確認します。
2 つの方法のいずれかを選択します。
始める前に
登録更新 flexctl コマンドを呼び出すには、最新バージョンの Flex Gateway をダウンロードしてください。このバージョンのゲートウェイを登録して実行する必要はありません。
Anypoint Platform ユーザーログイン情報を使用して登録を更新する
-
flex-renew-registration という名前 (または同様の名前) の新しいディレクトリを作成します。この新しいディレクトリで renew コマンドを実行します。このコマンドは、新しい登録ファイルを作成します。既存の登録ファイルが含まれているディレクトリで
renew コマンドが実行されると、登録更新に失敗します。 -
次のコマンドを使用します。
-
Linux
-
Docker
-
Podman
flexctl registration renew --username=<your-username> --password=<your-password> \ <path-to-registration-file><your-username> と <your-password> は Anypoint Platform ユーザーログイン情報に置き換えます。<path-to-registration-file> は既存の registration.yaml ファイルのパスとファイル名に置き換えます。このコマンドの実行時にファイル権限の問題が発生した場合は、
sudo を使用してください。コンテナで実行されている Flex Gateway の場合、コンテナの
run コマンドの一部として renew を呼び出します。docker run --entrypoint flexctl \ -v "$(pwd)":/renew \ -v <path-to-registration-directory>:/registration \ -u $UID mulesoft/flex-gateway \ registration renew \ --username=<your-username> \ --password=<your-password> \ --output-directory=/renew \ <path-to-registration-file-in-container><your-username> と <your-password> は Anypoint Platform ユーザーログイン情報に置き換えます。<path-to-registration-file-in-container> は既存の registration.yaml ファイルのパスとファイル名に置き換えます。コンテナファイルシステムでファイルを指定する必要があります。この場合は /registration/registration.yaml です。たとえば、
/home/user/flex/registration.yaml に現在の登録ファイルが含まれている場合は、/home/user/flex/ に移動して Anypoint Platform ログイン情報を使用して次のコマンドを実行します。docker run --entrypoint flexctl \ -u $UID -v "$(pwd)":/registration \ mulesoft/flex-gateway \ registration renew \ --username=<your-username> \ --password=<your-password> \ --output-directory=/registration/new \ /registration/registration.yamlこのコマンドでは、新しい登録ファイル
/home/user/flex/new/registration.yaml が作成されます。コンテナで実行されている Flex Gateway の場合、コンテナの
run コマンドの一部として renew を呼び出します。podman run --entrypoint flexctl --userns=keep-id \ -v "$(pwd)":/renew:Z \ -v <path-to-registration-directory>:/registration:Z \ -u $UID docker.io/mulesoft/flex-gateway \ registration renew \ --username=<your-username> \ --password=<your-password> \ --output-directory=/renew \ <path-to-registration-file-in-container><your-username> と <your-password> は Anypoint Platform ユーザーログイン情報に置き換えます。<path-to-registration-file-in-container> は既存の registration.yaml ファイルのパスとファイル名に置き換えます。コンテナファイルシステムでファイルを指定する必要があります。この場合は /registration/registration.yaml です。ユーザーログイン情報を使用して
renew コマンドを実行する前に、Anypoint Platform アカウントの MFA を無効にします。 -
-
コマンドを実行します。
出力には次のメッセージが含まれます。
Registration renewal completed -
新規作成された登録ファイルを実行時の登録ファイルの場所にコピーします。例:
/usr/local/share/mulesoft/flex-gateway/conf.d/registration.yaml -
Flex Gateway レプリカがすでに実行されている場合は、再起動します。
接続アプリケーションのログイン情報を使用して登録を更新する
-
Anypoint Platform のユーザー名またはパスワードがない場合は、Anypoint アクセス管理から接続アプリケーションを設定できます。
-
以下のスコープを含めます。
-
Read Servers (サーバーの参照)
-
Manage Servers (サーバーの管理)
-
View Organization (組織の表示)
-
-
設定する接続アプリケーションの ID とシークレットを保存してから、
renew コマンドでこれらのログイン情報を使用します。
-
-
flex-renew-registration という名前 (または同様の名前) の新しいディレクトリを作成します。この新しいディレクトリで renew コマンドを実行します。このコマンドは、新しい登録ファイルを作成します。既存の登録ファイルが含まれているディレクトリで
renew コマンドが実行されると、登録更新に失敗します。 -
次のコマンドを使用します。
-
Linux
-
Docker
-
Podman
flexctl registration renew --client-id=<your-client-id> --client-secret=<your-client-secret> \ <path-to-registration-file><your-client-id> と <your-client-secret> は接続アプリケーションのログイン情報に置き換えます。<path-to-registration-file> は既存の registration.yaml ファイルのパスとファイル名に置き換えます。このコマンドの実行時にファイル権限の問題が発生した場合は、
sudo を使用してください。コンテナで実行されている Flex Gateway の場合、コンテナの
run コマンドの一部として renew を呼び出します。docker run --entrypoint flexctl \ -v "$(pwd)":/renew \ -v <path-to-registration-directory>:/registration \ -u $UID mulesoft/flex-gateway \ registration renew \ --client-id=<your-client-id> \ --client-secret=<your-client-secret> \ --output-directory=/renew \ <path-to-registration-file-in-container><your-client-id> と <your-client-secret> は接続アプリケーションのログイン情報に置き換えます。<path-to-registration-file-in-container> は既存の registration.yaml ファイルのパスとファイル名に置き換えます。コンテナファイルシステムでファイルを指定する必要があります。この場合は /registration/registration.yaml です。たとえば、
/home/user/flex/registration.yaml に現在の登録ファイルが含まれている場合は、/home/user/flex/ に移動して接続アプリケーションのログイン情報を使用して次のコマンドを実行します。docker run --entrypoint flexctl \ -u $UID -v "$(pwd)":/registration \ mulesoft/flex-gateway \ registration renew \ --client-id=<your-client-id> \ --client-secret=<your-client-secret> \ --output-directory=/registration/new \ /registration/registration.yamlこのコマンドでは、新しい登録ファイル
/home/user/flex/new/registration.yaml が作成されます。コンテナで実行されている Flex Gateway の場合、コンテナの
run コマンドの一部として renew を呼び出します。podman run --entrypoint flexctl --userns=keep-id \ -v "$(pwd)":/renew:Z \ -v <path-to-registration-directory>:/registration:Z \ -u $UID docker.io/mulesoft/flex-gateway \ registration renew \ --client-id=<your-client-id> \ --client-secret=<your-client-secret> \ --output-directory=/renew \ <path-to-registration-file-in-container><your-client-id> と <your-client-secret> は接続アプリケーションのログイン情報に置き換えます。<path-to-registration-file-in-container> は既存の registration.yaml ファイルのパスとファイル名に置き換えます。コンテナファイルシステムでファイルを指定する必要があります。この場合は /registration/registration.yaml です。 -
-
コマンドを実行します。
出力には次のメッセージが含まれます。
Registration renewal completed -
新規作成された登録ファイルを実行時の登録ファイルの場所にコピーします。例:
/usr/local/share/mulesoft/flex-gateway/conf.d/registration.yaml -
Flex Gateway レプリカがすでに実行されている場合は、再起動します。
デフォルトの方法を使用した登録状況の確認
登録を調査するには、次のコマンドを実行します。
-
Linux
-
Docker
-
Podman
flexctl registration inspect
このコマンドの実行時にファイル権限の問題が発生した場合は、sudo を使用してください。
コンテナで実行されている Flex Gateway の場合、コンテナの exec コマンドの一部として inspect を実行します。<container-name-or-id> は実行中のコンテナ参照に置き換えます。
docker exec -u $UID <container-name-or-id> flexctl registration inspect
コンテナで実行されている Flex Gateway の場合、コンテナの exec コマンドの一部として inspect を実行します。<container-name-or-id> は実行中のコンテナ参照に置き換えます。
podman exec -u $UID <container-name-or-id> flexctl registration inspect
出力には証明書の有効期限の日付が含まれます。次に例を示します。
{“expiration_date”: “2025-09-25 19:27:32 +0000 UTC”}
登録ファイルを使用した登録状況の確認
registration.yaml ファイルから情報を抽出して、登録を調査できます。パスとファイル名を指定します。
登録を調査するには、次のコマンドを実行します。
-
Linux
-
Docker
-
Podman
flexctl registration inspect --file=<path-to-registration-file>
このコマンドの実行時にファイル権限の問題が発生した場合は、sudo を使用してください。
コンテナで実行されている Flex Gateway の場合、コンテナの run コマンドの一部として inspect を呼び出します。
docker run --entrypoint flexctl \
-v <path-to-registration-directory>:/registration \
-u $UID mulesoft/flex-gateway \
registration inspect --file=<path-to-registration-file>
コンテナで実行されている Flex Gateway の場合、コンテナの run コマンドの一部として inspect を呼び出します。
podman run --entrypoint flexctl --userns=keep-id \
-v <path-to-registration-directory>:/registration:Z \
-u $UID docker.io/mulesoft/flex-gateway \
registration inspect --file=<path-to-registration-file>
出力には証明書の有効期限の日付が含まれます。
{“expiration_date”: “2025-09-25 19:27:32 +0000 UTC”}
たとえば、現在のディレクトリに登録ファイルが含まれている場合は、次のコマンドを実行します。
docker run --entrypoint flexctl \
-v "$(pwd)":/registration \
-u $UID mulesoft/flex-gateway \
registration inspect --file=/registration/registration.yaml
Kubernetes で実行されている Flex Gateway の登録を確認する
次の例では、Flex Gateway が ingress リリース名を使用して gateway 名前空間にインストールされていて、登録が Kubernetes データベースに保存されているシナリオについて説明します。
-
次の
kubectl コマンドを使用して registration.yaml ファイルを復元します。kubectl -n gateway get secret "$(kubectl -n gateway get deployment ingress -o=jsonpath='{.spec.template.spec.volumes[?(@.name=="registration")].secret.secretName}')" -o=jsonpath='{.data.registration\.yaml}' | base64 --decode > registration.yamlこのコマンドにより、登録ファイルが
./registration.yaml に保存されます。 -
前のセクションで Docker について説明しているように、
flexctl registration renew コマンドを実行します。 -
次の
helm コマンドを使用して Flex Gateway をアップグレードします。helm get values -n gateway ingress > values.yaml \ && helm upgrade -n gateway ingress flex-gateway/flex-gateway --wait -f values.yaml --set-file registration.content=new/registration.yaml
更新コマンドと検証コマンドを使用したヘルプの取得
次の help コマンドを実行して使用方法に関する情報を確認できます。
-
更新
-
Linux
-
Docker
-
Podman
flexctl registration renew --helpこのコマンドの実行時にファイル権限の問題が発生した場合は、
sudo を使用してください。コンテナで実行されている Flex Gateway の場合、コンテナの
run コマンドの一部として help を呼び出します。docker run --entrypoint flexctl mulesoft/flex-gateway registration renew --helpコンテナで実行されている Flex Gateway の場合、コンテナの
run コマンドの一部として help を呼び出します。podman run --entrypoint flexctl docker.io/mulesoft/flex-gateway registration renew --help -
-
検証
-
Linux
-
Docker
-
Podman
flexctl registration inspect --helpこのコマンドの実行時にファイル権限の問題が発生した場合は、
sudo を使用してください。コンテナで実行されている Flex Gateway の場合、コンテナの
run コマンドの一部として help を呼び出します。docker run --entrypoint flexctl mulesoft/flex-gateway registration inspect --helpコンテナで実行されている Flex Gateway の場合、コンテナの
run コマンドの一部として help を呼び出します。podman run --entrypoint flexctl docker.io/mulesoft/flex-gateway registration inspect --help -
期限切れの登録の更新
接続モードで期限切れの証明書を使用して Flex Gateway を実行しようとすると、次の結果になります。
-
新規のレプリカは Anypoint Platform から API 設定のダウンロードに失敗するため、使用できなくなります。既存のクラスターは再読み込みに失敗します。
-
ログとメトリクスは Anypoint Platform へのアップロードに失敗します。Anypoint Platform を使用したトラブルシューティングはできません。
-
測定情報 Anypoint Platform へのアップロードに失敗します。MuleSoft では使用量メトリクスの収集やレポートができません。
ローカルモードで期限切れの証明書を使用して Flex Gateway を実行しようとすると、次の結果になります。
-
測定情報 Anypoint Platform へのアップロードに失敗します。MuleSoft では使用量メトリクスの収集やレポートができません。
証明書の期限が切れていても flexctl registration renew を呼び出すことはでき、これによって期限切れの証明書が更新されます。