跳到主要內容

發表文章

目前顯示的是有「argocd」標籤的文章

私有 GKE 叢集整合 ArgoCD 實現 GitOps 自動部署

  私有 GKE 叢集整合 ArgoCD 實現 GitOps 自動部署 前言 為了提升安全性, 企業通常會採用 Private GKE 的叢集架構, 只允許在內網裡存取 Control Plane, 在這種情況下, 若要部署資源到叢集裡, 除了額外再架一個跳板機使用 kubectl 去操作之外, 另一個方式是走 Pull-based 的 GitOps 流程, 安裝一個 Agent 在 GKE 叢集裡,  定時地去掃指定Git Repository 內的 k8s 資源檔, 並將差異同步到 GKE 叢集中 以下介紹如何使用 ArgoCD 來快速地實現以上的流程 Step 1. 安裝 ArgoCD $gcloud container clusters get-credentials cluster --zone us-central1 --project=stage $kubectl create ns argocd $kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml Step 2. Patch ArgoCD Server Service 指派外部 IP 因為在接下來的步驟會需要連線到 ArgoCD Server 上操作, 所以必須先  patch 一個 Load Balancer type 的 Service 給 ArgoCD Server 使它能對外溝通 $kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer","loadBalancerIP":"10.51.0.12"},"metadata":{"annotations":{"networking.gke.io/load-balancer-type":"Internal"}}}' 以上範例使用 Internal Load Balancer 的 Service, ...