网站完整模板月嫂的个人简历网站模板
2025/12/26 16:45:39 网站建设 项目流程
网站完整模板,月嫂的个人简历网站模板,兼职做平面模特网站,免费网站建设价格费用为什么要GitOps 传统的CI/CD流程: 代码提交 → CI构建 → 推送镜像 → CD脚本执行kubectl apply这个流程有几个问题: 状态漂移:有人手动改了集群配置,CI/CD不知道 回滚困难:出问题了想回滚,得翻找历史构建记录 审计缺失:谁改了什么、什么时候改的,不清楚 多环境同步:…为什么要GitOps传统的CI/CD流程:代码提交 → CI构建 → 推送镜像 → CD脚本执行kubectl apply这个流程有几个问题:状态漂移:有人手动改了集群配置,CI/CD不知道回滚困难:出问题了想回滚,得翻找历史构建记录审计缺失:谁改了什么、什么时候改的,不清楚多环境同步:dev、staging、prod三套环境,配置容易不一致GitOps的核心思想:Git是唯一的真相来源。所有配置都在Git仓库里集群状态必须和Git仓库一致任何变更都通过Git提交漂移会被自动修复或告警ArgoCD就是实现GitOps的工具,它持续监控Git仓库,发现差异就自动同步。架构概览┌──────────────────────────────────────────────────────────────┐ │ ArgoCD Server │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ │ │ API Server │ │ Repo Server │ │ Application Controller│ │ │ └─────────────┘ └─────────────┘ └─────────────────────┘ │ └──────────────────────────────────────────────────────────────┘ │ │ │ │ │ │ ▼ ▼ ▼ ┌─────────┐ ┌──────────┐ ┌──────────────┐ │ UI │ │ Git │ │ Kubernetes │ │ CLI │ │ Repos │ │ Clusters │ └─────────┘ └──────────┘ └──────────────┘核心组件:API Server:提供REST/gRPC API,处理UI和CLI请求Repo Server:克隆Git仓库,生成Kubernetes manifestsApplication Controller:监控应用状态,执行同步操作安装部署快速安装# 创建命名空间kubectl create namespace argocd# 安装ArgoCDkubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml# 等待Pod就绪kubectlwait--for=condition=Ready pods --all -n argocd --timeout=300s# 获取初始密码kubectl -n argocd get secret argocd-initial-admin-secret -ojsonpath="{.data.password}"|base64 -d高可用部署生产环境用HA模式:kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/ha/install.yaml或者用Helm更灵活:# argocd-values.yamlglobal:image:tag:v2.9.3controller:replicas:2resources:requests:cpu:250mmemory:512Milimits:cpu:1000mmemory:1Giserver:replicas:2service:type:LoadBalancerrepoServer:replicas:2resources:requests:cpu:100mmemory:256Milimits:cpu:500mmemory:512Miredis-ha:enabled:truereplicas:3configs:params:server.insecure:true# 如果前面有LB做TLShelm repoaddargo https://argoproj.github.io/argo-helm helminstallargocd argo/argo-cd -n argocd -f argocd-values.yaml基础使用连接Git仓库# 安装CLIbrewinstallargocd# 登录argocd login argocd.example.com# 添加私有仓库(SSH)argocd repoaddgit@github.com:org/manifests.git\--ssh-private-key-path ~/.ssh/id_rsa# 添加私有仓库(HTTPS)argocd repoaddhttps://github.com/org/manifests.git\--username admin\--password token123创建应用YAML方式(推荐):apiVersion:argoproj.io/v1alpha1kind:Applicationmetadata:name:guestbooknamespace:argocdspec:project:defaultsource:repoURL:https://github.com/argoproj/argocd-example-apps.gittargetRevision:HEADpath:guestbookdestination:server:https://kubernetes.default.svcnamespace:guestbooksyncPolicy:automated:prune:true# 删除Git中不存在的资源selfHeal:true# 自动修复漂移allowEmpty

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询