症状
Apigee ハイブリッドをアップグレードすると、Universal Data Collection Agent(UDCA)と Connect Agent の Pod で権限の問題エラーが発生します。
エラー メッセージ
UDCA Pod のログに次のエラーがスローされます。
Permission 'apigee.runtimeconfigs.get' denied on resource 'organizations/org-example/runtimeConfig' (or it may not exist)\\\",\\n \\\"status\\\": \\\"PERMISSION_DENIED\\
また、Runtime(MART)の Management API Pod で、Connect Agent に関する次のエラーがスローされます。
Permission 'apigeeconnect.endpoints.connect' denied on resource '//apigeeconnect.googleapis.com/projects/org-example/endpoints/APIGEE_MART' (or it may not exist).
共通の診断手順
クラスタから Apigee ハイブリッドの Must-Gather スクリプトとクラスタの overrides.yaml
ファイルを収集します。
考えられる原因
原因 | 説明 |
---|---|
認証情報が正しくない | overrides.yaml ファイルに間違った認証情報を入力した可能性があります。 |
SA ファイルが間違ったディレクトリにある | サービス アカウント(SA)ファイルが $APIGEE_HELM_CHARTS_HOME ディレクトリの外部に存在している可能性があります。 |
原因 1: 認証情報が正しくない
UDCA、MART、Connect エージェント Pod の overrides.yaml
ファイルで使用されている serviceAccountPath
または serviceAccountRef
が正しくありません。これは、Terraform を使用するなどして、自動化またはカスタム スクリプトによって overrides.yaml
ファイルが生成されたことが原因である可能性があります。
診断
-
使用するサービス アカウントに割り当てられている IAM ロールと権限を確認します。
gcloud iam service-accounts get-iam-policy SERVICE_ACCOUNT_EMAIL
gcloud projects get-iam-policy PROJECT_ID
ここで
- SERVICE_ACCOUNT_EMAIL は、サービス アカウントのメールアドレスです。
- PROJECT_ID は、サービス アカウントに関連付けられた Google Cloud プロジェクトです。
-
overrides.yaml
ファイルを確認して、参照されているサービス アカウントが、プロジェクトの IAM ポリシーとロールで使用されているものと一致していることを確認します。
例
非本番環境のサービス アカウントの IAM ポリシーの例:
gcloud iam service-accounts get-iam-policy apigee-non-prod@org-example.iam.gserviceaccount.com
出力例:
bindings: - members: - serviceAccount:org-example.svc.id.goog[apigee/apigee-cassandra-backup-sa] - serviceAccount:org-example.svc.id.goog[apigee/apigee-cassandra-default] - serviceAccount:org-example.svc.id.goog[apigee/apigee-cassandra-guardrails-sa] - serviceAccount:org-example.svc.id.goog[apigee/apigee-connect-agent-org-example-sa] - serviceAccount:org-example.svc.id.goog[apigee/apigee-mart-org-example-sa] - serviceAccount:org-example.svc.id.goog[apigee/apigee-metrics-sa] - serviceAccount:org-example.svc.id.goog[apigee/apigee-runtime-org-example-sa] - serviceAccount:org-example.svc.id.goog[apigee/apigee-synchronizer-org-example-sa] - serviceAccount:org-example.svc.id.goog[apigee/apigee-udca-org-example-sa] - serviceAccount:org-example.svc.id.goog[apigee/apigee-watcher-org-example-sa] role: roles/iam.workloadIdentityUser etag: BwYw33-1N8s= version: 1
ロールの検証の例:
gcloud projects get-iam-policy org-example
出力例:
bindings: - members: - serviceAccount:apigee-non-prod@org-example.iam.gserviceaccount.com role: roles/apigee.analyticsAgent - members: - serviceAccount:apigee-non-prod@org-example.iam.gserviceaccount.com role: roles/apigee.runtimeAgent - members: - serviceAccount:apigee-non-prod@org-example.iam.gserviceaccount.com role: roles/apigee.synchronizerManager - members: - serviceAccount:apigee-non-prod@org-example.iam.gserviceaccount.com role: roles/apigeeconnect.Agent - members: - serviceAccount:apigee-non-prod@org-example.iam.gserviceaccount.com role: roles/storage.objectAdmin
本番環境では、apigee-udca
の本番環境サービス アカウントに対して同じコマンドを実行し、インストール セクションに一致する IAM ロールを確認します。
解決策
overrides.yaml
で使用されているサービス アカウント ファイルが、プロジェクトの IAM バインディングとロールの正しいサービス アカウントと一致しない場合は、サービス アカウントを削除して再作成し、overrides.yaml
で使用されているサービス アカウント ファイルを修正する必要があります。
原因 2: SA ファイルが間違ったディレクトリにある
この問題は、Helm チャートを設定してサービス アカウントを作成するときに発生します。
診断
サービス アカウント認証情報ファイルの場所を確認して、正しい Helm チャート ディレクトリにあることを確認します。サービス アカウントの JSON ファイルは、次のディレクトリに配置する必要があります。
$APIGEE_HELM_CHARTS_HOME/apigee-datastore
$APIGEE_HELM_CHARTS_HOME/apigee-telemetry
$APIGEE_HELM_CHARTS_HOME/apigee-org
$APIGEE_HELM_CHARTS_HOME/apigee-env
例
たとえば、apigee-datastore
ディレクトリを一覧表示して Helm チャートのディレクトリを確認し、apigee-org
、apigee-env
、apigee-telemetry
ディレクトリについても同様の操作を行います。
サンプル コマンド:
正しいディレクトリにいることを確認します。
pwd
出力例:
/usr/local/home/example/Hybrid/helm-charts
├── apigee-datastore │ ├── org-example-apigee-non-prod.json │ └── templates ├── apigee-env │ ├── org-example-apigee-non-prod.json │ └── templates ├── apigee-ingress-manager │ └── templates ├── apigee-operator │ ├── etc │ │ ├── crds │ │ │ ├── crd │ │ │ │ ├── bases │ │ │ │ └── patches │ │ │ └── default │ │ ├── examples │ │ │ └── helmfiles │ │ └── tools │ │ └── service-accounts │ │ ├── org-example-apigee-cassandra.json │ │ ├── org-example-apigee-logger.json │ │ ├── org-example-apigee-mart.json │ │ ├── org-example-apigee-metrics.json │ │ ├── org-example-apigee-runtime.json │ │ ├── org-example-apigee-synchronizer.json │ │ ├── org-example-apigee-udca.json │ │ └── org-example-apigee-watcher.json │ └── templates ├── apigee-org │ ├── org-example-apigee-non-prod.json │ └── templates ├── apigee-redis │ └── templates ├── apigee-telemetry │ ├── org-example-apigee-non-prod.json │ └── templates ├── apigee-virtualhost │ ├── certs │ └── templates └── cluster-check 29 directories, 12 files
解決策
上記のツリーの場所の例に従って、サービス アカウント ファイルを 4 つのディレクトリ(apigee-datastore
、apigee-telemetry
、apigee-org
、apigee-env
)にコピーし、Helm チャートを再実行します。