by shigemk2

当面は技術的なことしか書かない

GCP

KSA GSA

クラスタで Workload Identity Federation for GKE を有効にする 権限を構成する 3 .Kubernetes サービス アカウント(KSA)を Google サービス アカウント(GSA)にバインドする cloud.google.com kubernetes.io cloud.google.com cloud.google.com 図

Google Cloud Datadog SIEMメモ

ログシンク→Pub/Sub(プルサブスクリプション)→Dataflow ログシンク→Pub/Sub(プッシュサブスクリプション)は非推奨 ログシンクはOrganiztionで作成できて、Projectを横断検索できる Pub/Sub Dataflowは特定のProjectでしか作れない cloud.google.com cloud.go…

gcloud secrets versions access

GCP

gcloud secrets versions access - access a secret version's data バージョンとシークレット名が必須 cloud.google.com

Cloud 請求先アカウント

GCP

Cloud 請求先アカウントとは、 Google Cloud プロジェクトや Google Maps Platform プロジェクトの使用料金の請求先となるアカウントです。Google Workspace アカウントに関連する料金を Cloud 請求先アカウントで支払うことはできません。Google Workspace …

Logging のクエリ言語 NOT

GCP

AWSのCloudWatch Logsとは若干違う NOT textPayload: "unicorn phoenix" cloud.google.com

terraform-google-modules/composer

v2はあるけどv3はない… registry.terraform.io

roles/cloudbuild.builds.builder

GCP

名前はroles/cloudbuild.builds.builderだけど、タイトルはCloud Build の従来のサービス アカウント cloud.google.com

gcloud firebase

GCP

testしかない… cloud.google.com

Cloud Loggingの料金体系メモ

GCP

ざっくりとしたアーキテクチャは公式の通り。 ログルーター経由でBQにデータを流す場合、 cloud.google.com ログルーターはユーザー定義のものを利用することになるが、ログルーター自体に料金は発生しない。ログの保存と一定期間以上の保持に料金が発生する…

storage.buckets.getのロール

GCP

Storage Insights コレクタ サービス(roles/storage.insightsCollectorService)でカバーできる権限であってroles/storage.objectAdminでも無理っていう cloud.google.com

サービスエージェント概要

GCP

Some Google Cloud services have Google-managed service accounts that allow the services to access your resources. These service accounts are known as service agents. If an API requires a service agent, then Google creates the service agent…

Compute Engine の汎用マシン ファミリー

GCP

用途で使い分けていく感じだけど、例えばE2だとこんな感じ トラフィック量の少ないウェブサーバー バックオフィス アプリ コンテナ化されたマイクロサービス 小規模データベース 仮想デスクトップ 開発環境とテスト環境 cloud.google.com

GKE ノードプール ノード

ノードプールは、クラスタ内で同じ構成を持つノードのグループ ノードは、コンテナ化されたアプリケーションと他のワークロードを実行するワーカーマシン 個々のマシンは、GKE が作成する Compute Engine 仮想マシン(VM) ノードプール > ノード で、ノード…

gsutil rsync

GCP

cloud.google.com 感覚的にはawscliのs3 syncと一緒かも docs.aws.amazon.com

gcloud composer environments list

GCP

cloud composerのenvironmentをlistするやつ パラメータは適宜 $ gcloud composer environments list --project=project-1 --locations=us-central1 cloud.google.com

terraform-google-secret-manager

そのうちterraform-google-modulesに移行しそうな気はしている github.com registry.terraform.io registry.terraform.io

Cloud Buildの変数 GitHub系

GCP

$TRIGGER_NAME: トリガーに関連付けられた名前 $COMMIT_SHA: ビルドに関連付けられた commit ID $REVISION_ID: ビルドに関連付けられた commit ID $SHORT_SHA: COMMIT_SHA の最初の 7 文字 $REPO_NAME: リポジトリの名前 $BRANCH_NAME: ブランチの名前 $TAG_…

Cloud Build env

GCP

トリガーでの設定はアンダースコア必須 steps: # Uses the ubuntu build step: # to run a shell script; and # set env variables for its execution - name: 'ubuntu' args: ['bash', './myscript.sh'] env: - 'BUILD=$BUILD_ID' - 'PROJECT_ID=$PROJECT_I…

Cloud BuildでTerraformのCICDするチュートリアル

ざっくり リポジトリにCloud Build GitHub appをインストール Cloud Build用のサービスアカウントを作成して、editor権限を付与 Cloud Buildからリポジトリに接続 Cloud Buildのトリガー作成 cloudbuild.yamlを書く cloud.google.com github.com

gcloud storage buckets

GCP

gcsをなんかあれこれするやつ cloud.google.com 転送速度はgsutilより早いらしいけどgsutilの機能が未実装なやつも多い cloud.google.com

cert-managerについて

Issuer 証明書発行者 複数namespaceにまたがって発行したい場合はClusterIssuerを使う Certificate 証明書 ACME Automate Certificate Management Environmentの略 cert-manager.io zenn.dev

コンテナ イメージ内のアプリを GKE クラスタにデプロイする

GCP

やること Hello World アプリを作成 Cloud Build を使用して、アプリをコンテナイメージにパッケージ化 Google Kubernetes Engine(GKE)でクラスタを作成 コンテナ イメージをクラスタにデプロイ YAMLの設定をデプロイ cloud.google.com

まっさらなプロジェクトでterraform-google-memorystoreでredisを立てる時のメモ

v6.0.0 module "redis_test_00001" { source = "terraform-google-modules/memorystore/google" version = "6.0.0" enable_apis = false name = "redis_test_00001" project = data.google_project.current.project_id connect_mode = "PRIVATE_SERVICE_ACCE…

An IP range in the local network (xxxxxxxxxxx) allocated by resource (xxxxxxxxxxxx) overlaps with an IP range (xxxxxxxxxxxx) in an active peer of the peer network.”

ピアリング接続を作成しようとしたらエラーが出た。 「注: ピアリングした VPC ネットワーク内のサブネットの IP 範囲は重複してはなりません。」 って注意されているんだから、ピアリングしたVPCネットワークでサブネットのIPが重複していたらダメだよね。 …

Existing secondary range cannot be modified

サブネットワークのセカンダリ ipv4 レンジをTerraformで更新しようとしたら失敗するやつ github.com 更新ができないなら削除して追加をTerraformの内々で実行すればいいんだろうけど、このIssueが起票されてから数年間ずっと緑が続いているのを考えると、諦…

gcloud container describe

GCP

GKEのクラスターとかノードプールとかのdescribe cloud.google.com cloud.google.com

terraform-google-memorystore

importするときはredis_versionは指定しなくてもいい read_replica_modeはtierがSTANDARD_HAの時に必要なパラメータだけど、空文字列で指定してもいい registry.terraform.io github.com

terraform-google-kubernetes-engine beta-private-cluster min_master_version

Minimum master kubernetes version ってあるけど、HCLを見るとrelease_channelがUNSPECIFIEDの場合はmaster_versionを見てて、master_versionはリージョン指定ありならkubernetes_versionか最新のバージョンを取得しようとしてる。ドキュメントが書かれてい…

Backup for GKE

GCP

ワークロードのバックアップと復元の機能 割と最近できたようでベータ版 APIとBackup for GKE エージェントが動く Terraformではgke_backup_agent_configで設定する cloud.google.com

compute_address vs compute_global_address

リージョン付きなのがcompute_addressで、リージョンなしなのがcompute_global_address registry.terraform.io registry.terraform.io