GKE + Helm + ArgoCD は本番 Kubernetes 環境の GitOps デファクト構成です。 本記事ではセットアップから App of Apps パターン、Workload Identity、Sealed Secrets までを実装例で解説します。
Developer
|
git push (Helm Chart / values)
|
v
GitHub Repository ← ArgoCD が Sync (pull)
|
v
GKE Cluster (Prod)
|
v
Pods (Helm Chart 展開)gcloud container clusters create-auto prod-cluster \ --region=asia-northeast1 \ --release-channel=stable \ --enable-private-nodes gcloud container clusters get-credentials prod-cluster \ --region=asia-northeast1
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# UI アクセス (Port Forward)
kubectl port-forward svc/argocd-server -n argocd 8080:443
# 初期パスワード取得
kubectl -n argocd get secret argocd-initial-admin-secret \
-o jsonpath="{.data.password}" | base64 -dmy-app/
├── Chart.yaml
├── values.yaml
├── values-prod.yaml
├── values-staging.yaml
└── templates/
├── deployment.yaml
├── service.yaml
├── ingress.yaml
├── hpa.yaml
├── serviceaccount.yaml # Workload Identity 用 Annotation
└── _helpers.tpl# templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels: { app: {{ .Release.Name }} }
template:
metadata:
labels: { app: {{ .Release.Name }} }
spec:
serviceAccountName: {{ .Release.Name }}
containers:
- name: app
image: {{ .Values.image.repo }}:{{ .Values.image.tag }}
resources:
requests: { cpu: {{ .Values.resources.cpu }}, memory: {{ .Values.resources.memory }} }
---
# templates/serviceaccount.yaml (Workload Identity)
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Release.Name }}
annotations:
iam.gke.io/gcp-service-account: {{ .Values.gsaEmail }}# argocd/applications/my-app-prod.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-app-prod
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/my-org/k8s-config.git
targetRevision: HEAD
path: charts/my-app
helm:
valueFiles: [values-prod.yaml]
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground# argocd/root-app.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: root
namespace: argocd
spec:
source:
repoURL: https://github.com/my-org/k8s-config.git
path: argocd/applications/
targetRevision: HEAD
destination:
server: https://kubernetes.default.svc
namespace: argocd
syncPolicy:
automated: { prune: true, selfHeal: true }
# 全 App が applications/ 配下から自動同期# Sealed Secrets Controller インストール helm install sealed-secrets sealed-secrets/sealed-secrets -n kube-system # Secret を Sealed Secret に変換 kubectl create secret generic db-pass --from-literal=password=secret -o yaml --dry-run=client | \ kubeseal -o yaml > db-pass-sealed.yaml # 結果: Git に commit 可能な暗号化 YAML # 復号鍵はクラスタ内のみ存在
# GSA 作成 gcloud iam service-accounts create my-app-gsa # Role 付与 gcloud projects add-iam-policy-binding PROJECT \ --member=serviceAccount:[email protected] \ --role=roles/cloudsql.client # KSA ↔ GSA 紐づけ gcloud iam service-accounts add-iam-policy-binding \ [email protected] \ --role=roles/iam.workloadIdentityUser \ --member="serviceAccount:PROJECT.svc.id.goog[production/my-app]" # Helm values gsaEmail: [email protected]
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: my-app
spec:
strategy:
canary:
steps:
- setWeight: 20
- pause: { duration: 5m }
- setWeight: 50
- pause: { duration: 10m }
- setWeight: 100
selector: { matchLabels: { app: my-app } }
template: ... # Deployment と同じHelm と Kustomize どちらを使う?
テンプレート化と複雑な設定なら Helm、シンプルな環境差分なら Kustomize。両方併用 (Helm Chart を Kustomize で Overlay) も一般的。
ArgoCD と Cloud Deploy どちらを選ぶ?
GitOps + 多 Cluster 管理 → ArgoCD、Canary/Blue-Green マネージド → Cloud Deploy。両方併用 (ArgoCD → Cloud Deploy 連携) もあり。
ArgoCD のインストール方法は?
<code>kubectl create ns argocd && kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml</code> または Helm Chart 利用。
GitOps の利点は?
Git が Single Source of Truth、レビュー / 監査 / ロールバックが Git で完結、Drift Detection 自動、宣言的で再現性高い。
App of Apps パターンとは?
ArgoCD で「App を管理する App」を作って組織全体の Application を Git で一元管理。スケール時の標準パターン。
Helm Chart の値はどう管理?
values.yaml + environment 別 (values-prod.yaml / values-staging.yaml)。Secret は Sealed Secrets / SOPS / External Secrets で暗号化管理。
Workload Identity との連携は?
Helm Chart の ServiceAccount に annotation で GSA 紐づけ、Pod に SA 指定。Workload Identity が KSA→GSA 変換。キー不要。
他選択肢は?
Flux CD (ArgoCD 競合)、Jenkins X、Spinnaker、Cloud Build + Cloud Deploy。GitOps 主流は ArgoCD と Flux。
関連記事・Kubernetes / GitOps
GitHub Actions + GCP CI/CD 完全ガイド|Workload Identity・Cloud Run/GKE デプロイ (2026)
GitHub Actions で GCP CI/CD を構築する完全ガイド。Workload Identity Federation、setup-gcloud、Cloud Run / GKE デプロイ、Cloud Build 連携、Reusable Workflow、Self-hosted Runner、Secrets 管理を 2026 年最新版で網羅。
Terraform on GCP 完全ガイド|IaC・Provider・Workload Identity・GitHub Actions (2026)
Google Cloud で Terraform を使う IaC 完全ガイド。Google Cloud Provider / Beta、State 管理 (gcs バックエンド)、Workload Identity Federation、Module 設計、GitHub Actions CI、Infracost、Config Connector を 2026 年最新版で網羅。
Google Cloud (GCP) 認定資格ロードマップ 2026 完全版|全 15 試験を体系化
Google Cloud 認定資格 全 15 試験 (Foundational 2 + Associate 3 + Professional 10) の 2026 年版ロードマップ。14/15 試験が日本語対応、Generative AI Leader (2025-05 新)・PMLE 2026-06 新版、AWS/Azure/GCP シェア比較、役割別ルートを日本語で整理。
GKE Autopilot vs Standard 徹底比較|Google Kubernetes Engine の選び方と料金
Google Kubernetes Engine (GKE) の Autopilot モードと Standard モードを徹底比較。料金体系、機能差、Cloud Run との使い分け、Workload Identity、GKE Enterprise (旧 Anthos) も解説。
※ Google Cloud は Google LLC、Argo Project / Helm は CNCF の所有物です。最新は ArgoCD 公式 をご確認ください。
NicheeLab編集部
データエンジニアリング・クラウド資格の専門家。Databricks・Snowflake等の認定資格を保有し、実務経験に基づいた問題作成・解説を行っています。NicheeLab運営。
Google Cloud (GCP) 認定資格ロードマップ 2026 完全版|全 15 試験を体系化
Google Cloud 認定資格 全 15 試験 (Foundational 2 + Associate 3 + Pr...
Cloud Digital Leader (CDL) 完全ガイド|出題範囲・学習リソース・合格戦略
Google Cloud Cloud Digital Leader (CDL) の完全ガイド。6 ドメイン 92 bul...
Generative AI Leader (GAIL) 完全ガイド|Google Cloud 生成 AI 認定
Google Cloud Generative AI Leader (GAIL、2025-05-14 リリース) の完全...
Vertex AI 入門|Google Cloud 統合 ML プラットフォームの全機能
Google Cloud Vertex AI の入門解説。Vertex AI Studio / Agent Builde...
GCP Associate Cloud Engineer (ACE) 完全ガイド|試験範囲・受験料・学習ロードマップ
Google Cloud Associate Cloud Engineer (ACE) の試験範囲・受験料 125 US...