k8s部署argocd

K8s+ArgoCD,低投入构建内部开发者平台 利用 Argo CD 以及 Kubernetes label 为 IDP 部署提供了精简高效的方案 阅读详情

前言:

本人k8s环境是使用kubekey创建的.部署详情参见kubesphere官网:

在 Linux 上以 All-in-One 模式安装 KubeSphere

基础环境
k8s版本 1.23.14
argocd版本2.4.2
操作系统版本centos7.9
uname -r3.10.0-1160.71.1.el7.x86_64
确定版本兼容性,

这里我咨询的ai1.23.14版本的k8s兼容哪个版本的argocd.推荐版本是2.4.2,因为我的本地k8s版本就是1.23.14 这里根据自己的情况拉取对应版本

https://github.com/argoproj/argo-cd/blob/v2.4.2/manifests/install.yaml

上面是argocd部署使用的yaml文件的地址.

从github上拉取该文件到集群中部署(打开后复制到集群中也可以.)

创建命名空间
#创建命名空间
[root@module /zpf/argocd]$kubectl create  ns argocd
#查看创建是否成功
[root@module /zpf/argocd]$kubectl get ns
NAME                              STATUS   AGE
argocd                            Active   23h
default                           Active   57d
ingress-nginx                     Active   22h
kube-node-lease                   Active   57d
kube-public                       Active   57d
kube-system                       Active   57d
kubekey-system                    Active   57d
kubesphere-controls-system        Active   57d
kubesphere-monitoring-federated   Active   57d
kubesphere-monitoring-system      Active   57d
kubesphere-system                 Active   57d
#查看详细信息(可查可不查)
[root@module /zpf/argocd]$kubectl describe ns argocd
Name:         argocd
Labels:       kubernetes.io/metadata.name=argocd
              kubesphere.io/namespace=argocd
Annotations:  <none>
Status:       Active

No resource quota.

No LimitRange resource.

需要注意的是

创建部署文件-->install.yaml

这里如果直接将github上的文件拉取到本地的话,就不用创建了.直接根据文件创建服务就行.

[root@module /zpf/argocd]$cat install.yaml
# This is an auto-generated file. DO NOT EDIT
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  labels:
    app.kubernetes.io/name: applications.argoproj.io
    app.kubernetes.io/part-of: argocd
  name: applications.argoproj.io
spec:
  group: argoproj.io
  names:
    kind: Application
    listKind: ApplicationList
    plural: applications
    shortNames:
    - app
    - apps
    singular: application
  scope: Namespaced
  versions:
  - additionalPrinterColumns:
    - jsonPath: .status.sync.status
      name: Sync Status
      type: string
    - jsonPath: .status.health.status
      name: Health Status
      type: string
    - jsonPath: .status.sync.revision
      name: Revision
      priority: 10
      type: string
    name: v1alpha1
    schema:
      openAPIV3Schema:
.
.
.
.
以下省略一万行....
创建服务组件
[root@module /zpf/argocd]$kubectl create -n argocd -f install.yaml
customresourcedefinition.apiextensions.k8s.io/applications.argoproj.io created
customresourcedefinition.apiextensions.k8s.io/applicationsets.argoproj.io created
customresourcedefinition.apiextensions.k8s.io/appprojects.argoproj.io created
serviceaccount/argocd-application-controller created
serviceaccount/argocd-applicationset-controller created
serviceaccount/argocd-dex-server created
serviceaccount/argocd-notifications-controller created
serviceaccount/argocd-redis created
serviceaccount/argocd-repo-server created
serviceaccount/argocd-server created
role.rbac.authorization.k8s.io/argocd-application-controller created
role.rbac.authorization.k8s.io/argocd-applicationset-controller created
role.rbac.authorization.k8s.io/argocd-dex-server created
role.rbac.authorization.k8s.io/argocd-notifications-controller created
role.rbac.authorization.k8s.io/argocd-server created
clusterrole.rbac.authorization.k8s.io/argocd-application-controller created
clusterrole.rbac.authorization.k8s.io/argocd-server created
rolebinding.rbac.authorization.k8s.io/argocd-application-controller created
rolebinding.rbac.authorization.k8s.io/argocd-applicationset-controller created
rolebinding.rbac.authorization.k8s.io/argocd-dex-server created
rolebinding.rbac.authorization.k8s.io/argocd-notifications-controller created
rolebinding.rbac.authorization.k8s.io/argocd-redis created
rolebinding.rbac.authorization.k8s.io/argocd-server created
clusterrolebinding.rbac.authorization.k8s.io/argocd-application-controller created
clusterrolebinding.rbac.authorization.k8s.io/argocd-server created
configmap/argocd-cm created
configmap/argocd-cmd-params-cm created
configmap/argocd-gpg-keys-cm created
configmap/argocd-notifications-cm created
configmap/argocd-rbac-cm created
configmap/argocd-ssh-known-hosts-cm created
configmap/argocd-tls-certs-cm created
secret/argocd-notifications-secret created
secret/argocd-secret created
service/argocd-applicationset-controller created
service/argocd-dex-server created
service/argocd-metrics created
service/argocd-notifications-controller-metrics created
service/argocd-redis created
service/argocd-repo-server created
service/argocd-server created
service/argocd-server-metrics created
deployment.apps/argocd-applicationset-controller created
deployment.apps/argocd-dex-server created
deployment.apps/argocd-notifications-controller created
deployment.apps/argocd-redis created
deployment.apps/argocd-repo-server created
deployment.apps/argocd-server created
statefulset.apps/argocd-application-controller created
networkpolicy.networking.k8s.io/argocd-application-controller-network-policy created
networkpolicy.networking.k8s.io/argocd-dex-server-network-policy created
networkpolicy.networking.k8s.io/argocd-redis-network-policy created
networkpolicy.networking.k8s.io/argocd-repo-server-network-policy created
networkpolicy.networking.k8s.io/argocd-server-network-policy created
 查看pod部署状态

[root@module /zpf/argocd]$kubectl get po -A|grep argo
argocd                         argocd-application-controller-0                        1/1     Running   0             3m6s
argocd                         argocd-applicationset-controller-75f464b975-n789x      1/1     Running   0             3m6s
argocd                         argocd-dex-server-9b7695954-rtk8r                      1/1     Running   0             3m6s
argocd                         argocd-notifications-controller-87d586594-ldvv7        1/1     Running   0             3m6s
argocd                         argocd-redis-78675b87fc-slc6m                          1/1     Running   0             3m6s
argocd                         argocd-repo-server-9f8b96f65-s84zg                     1/1     Running   0             3m6s
argocd                         argocd-server-56847dcb98-b8j6s                         1/1     Running   0             3m6s

这里说明一下,我在部署的时候出现了redis拉取不下来的情况.

这种情况有几种解决方式:

首先将imagePullPolicy字段修改成 IfNotPresent,意思是本地有这个镜像的话就不直接拉取.然后后面的步骤可选项.

1.从dockerhub上自己想办法拉取指定版本的redis,然后放到部署的服务器上.

2.将自己可以拉取下来的其他版本redis修改一下docker tag

3.将yaml文件中redis的image位置的redis修改成本地已经有的,redis版本号.

查看svc状态
[root@module /zpf/argocd]$kubectl get svc -A|grep argo
argocd                         argocd-applicationset-controller              ClusterIP   10.233.37.237   <none>        7000/TCP,8080/TCP               18m
argocd                         argocd-dex-server                             ClusterIP   10.233.21.129   <none>        5556/TCP,5557/TCP,5558/TCP      18m
argocd                         argocd-metrics                                ClusterIP   10.233.44.192   <none>        8082/TCP                        18m
argocd                         argocd-notifications-controller-metrics       ClusterIP   10.233.56.237   <none>        9001/TCP                        18m
argocd                         argocd-redis                                  ClusterIP   10.233.52.170   <none>        6379/TCP                        18m
argocd                         argocd-repo-server                            ClusterIP   10.233.45.144   <none>        8081/TCP,8084/TCP               18m
argocd                         argocd-server                                 ClusterIP   10.233.9.188    <none>        80/TCP,443/TCP                  18m
argocd                         argocd-server-metrics                         ClusterIP   10.233.11.60    <none>        8083/TCP                        18m
部署ingress

这里遇到了一个坑.因为我开着梯子,所以ingress一直访问不通,这里说明一下.

从argocd官网找到ingress部署方式

https://argo-cd.readthedocs.io/en/stable/operator-manual/ingress/#kubernetesingress-nginx

文件内容如下:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-server-ingress
  namespace: argocd
  annotations:
    nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
    nginx.ingress.kubernetes.io/ssl-passthrough: "true"
spec:
  ingressClassName: nginx
  rules:
  - host: argocd.example.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: argocd-server
            port:
              name: https

启动ingress.

本地hosts解析域名

用于访问页面

服务器上域名解析:

[root@module /zpf/argocd]$cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.59.100 argocd.example.com

电脑的hosts上解析域名:

C:\Windows\System32\drivers\etc\hosts
192.168.59.100 argocd.example.com 
从kubersphere上查看网关端口号.

浏览器访问argocd控制台地址.

argocd部署成功,
找到用户名密码登陆控制台.\

argocd的密码是以secret的形式保存的.

这里有两种方式获取,

1.直接使用kubectl使用命令行获取密码
[root@module /zpf/argocd]$kubectl get secret -n argocd argocd-initial-admin-secret -o jsonpath={.data.password}|base64 -d
VMfn9gQIQL3ZwRzB
2.使用kubesphere找到secret后,找到argocd-initial-admin-secret.

查看密码,

登陆控制台验证是否成功

验证成功 

argocd部署cli工具并添加k8s集群 本文介绍了在已有Kubernetes集群环境下部署ArgoCD CLI工具并添加K8s集群的步骤。首先从ArgoCD Web界面下载匹配版本的CLI工具,上传至服务器/usr/local/bin目录并配置执行权限。接着修改kubeconfig文件中的server地址为master主机IP,解决kubekey部署集群时的解析问题。使用argocd cluster add命令添加集群,创建argocd-manager服务账户并授予集群权限。最后通过CLI和Web界面验证集群添加成功,为后续应用部署做好准备。整个 阅读详情

相关推荐

Jenkins+ArgoCD实战:5分钟搞定K8s环境下的GitOps自动化部署

本文详细介绍了如何将Jenkins与ArgoCD结合,在Kubernetes环境中快速构建GitOps自动化部署流水线。通过清晰的步骤拆解,从ArgoCD安装、Jenkins流水线改造到应用创建,实现从代码提交到应用上线的五分钟级全自动部署,有效提升团队交付效率和部署可靠性。

9o8p7i6u5y的博客 874

k8s安装ArgoCD(统一身份认证对接LDAP)(配置用户的角色及权限)

K8S安装argocd,统一身份认证对接ldap,并且配置不同的角色及权限项。

天草二十六 2845

ArgoCD实战指南:GitOps驱动下的Kubernetes自动化部署与Helm/Kustomize集成

ArgoCD 是一种 GitOps 持续交付工具,专为 Kubernetes 设计。它能够自动同步 Git 仓库中的声明性配置,并将其应用到 Kubernetes 集群中。本文将介绍ArgoCD 的架构、安装步骤,以及如何结合Helm 和 Kustomize进行 Kubernetes 自动化部署。ArgoCD 是强大的 GitOps 解决方案,可提高 Kubernetes 资源管理效率。结合 Helm 和 Kustomize,可以实现更灵活的自动化部署。需要正确配置权限管理,确保安全性。未来展望✅。

记录从移动端、鸿蒙到物联网与AI的完整实战与思考。专注于分享可复用的工程方案与产品思维,尤其深入鸿蒙生态与全栈开发。以十年工程与管理沉淀,为你提供清晰的技术纵深路径。坚信技术的价值在于“贯通”与“落地”。 1495

k8s部署Argo CD

在学习Argo CD之前,我们需要先了解一下GitOps,GitOps是一个用于持续部署应用程序的软件开发框架,它的核心是使用 Git 仓库来管理基础设施和应用的配置,并且以 Git 仓库作为基础设施和应用的单一事实来源,Git 仓库中的声明式配置描述了目标环境当前所需基础设施的期望状态,如果集群的实际状态与 Git 仓库中定义的期望状态不匹配,K8s 会根据期望状态来调整当前的状态,最终使实际状态符合期望状态。

qq_40208428的博客 1521

R语言的下载、安装及环境配置(Rstudio&VSCode)

R for Windows是一个免费的用于统计计算和统计制图的优秀工具,是R语言开发工具。它拥有数据存储和处理系统、数组运算工具(其向量、矩阵运算方面功能尤其强大)、完整连贯的统计分析工具、优秀的统计制图等功能。提供的图形界面,可以在其中访问控制台、创建脚本或安装其他软件包。

zegeai的博客 2万+

spm FMRI 各种小问题合集

预处理 1、预处理结果从normalize之后开始头歪、变形 问题描述:如下图 原因:DICOM2NIfTI时必须检查对应的T1像。下面是两种错误形式,第一种容易发现,第二种容易忽视,大脑失状位左右颠倒。 解决:重新转了一回格式,建议用SPM fmri进行格式转换。之前是用MRIconvert转换的,用了两台电脑,有的T1结果是对的,不确定什么原因产生的错位,操作都是一样的。 2、Check reg大脑图片边缘出边框 问题描述: 原因:应该是图片排版导致的,单独check就会发现大脑是全的。 解决

weixin_44669441的博客 1675

K8S安装argocd

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. Argo CD是一个基于Kubernetes的声明式的GitOps工具。链接: https://pan.baidu.com/s/1ho-ezf6GUzllOHGQObQeQA?3:Argo CD是一个独立的部署工具,支持对多个环境、多个Kubernetes集群上的应用进行统一部署和管理。2:应用部署和生命周期管理是全自动化的,是可审计的,清晰易懂;

hbhe0316的专栏 598

个人信息保护合规审计人员(高级)能力考核试卷+面试模拟

《个人信息保护合规审计考试与面试指南》 摘要:本文提供个人信息保护合规审计考试及面试的全面指导。考试采用闭卷笔试形式,满分100分,合格线75分,时长120分钟,包含单选、多选、判断题及综合案例分析题。内容涵盖《个人信息保护法》核心条款、审计程序、风险评估等实务要点。面试环节采用情景模拟方式,重点考察应试者在压力下处理审计独立性、客户关系与监管要求的平衡能力,以及应对数据泄露等突发事件的处置流程。案例题聚焦大型互联网平台的数据收集、共享、跨境传输等高风险环节的合规审计,要求设计完整的审计方案框架。面试评分标

qq_41525079的博客 1142

ArgoCD 与 GitOps:K8S 原生持续部署的实操指南

摘要: Kubernetes作为容器编排工具面临多环境配置不一致、配置漂移等问题,GitOps理念通过Git仓库作为单一可信源实现状态同步。ArgoCD是K8s中实践GitOps的核心工具,通过自动监控Git配置与集群差异实现持续部署。本文演示ArgoCD的安装(修改NodePort访问)、Git仓库配置及应用部署流程,包括YAML清单管理、版本更新(v1→v2镜像替换)和回滚操作。测试显示,ArgoCD能自动同步Git变更并清理旧Pod,通过提交注释实现精准回滚,验证了其自动化、可追溯的运维能力。

成为一个内心平静的人,要多久 3285

别再死记硬背了!用这5个Qt Design Studio小项目,彻底玩转核心组件

本文通过5个Qt Design Studio实战项目,帮助开发者深入理解核心组件的协作与应用。从动态登录界面到游戏化任务列表,每个项目都展示了组件属性与交互设计的巧妙结合,让你不再死记硬背,而是真正掌握Qt Design Studio的核心技能。

weixin_29202213的博客 271

QT C++ AI棉花智能变量灌溉工上位机(信创完整版)

北斗履带灌溉机器人/田间分区电磁阀基站 → 多层土壤温湿度/盐分EC传感器实时采集墒情 → 双目AI视觉扫描棉田长势、病苗分布 → AI融合**生育期+土壤墒情+盐分+棉株长势**计算变量灌溉定额、水肥配比、灌溉时长 → 分区电磁阀/变频水泵变量供水,病弱苗地块减量、干旱地块增量;墒情、盐分、长势多因子闭环修正灌水量;多层土壤含水率(0–10/20–40/40–80cm)、土壤EC盐分、土壤温度、空气温湿度、蒸发量、北斗地块坐标、管道水压、水肥罐液位、分区流量计、水泵电机负载、滴灌带压力反馈。

寒寒豆豆软件公司的博客 184

使用ArgoCD管理Kubernetes部署指南

对于寻求利用云原生技术力量的组织来说,高效管理 Kubernetes 部署至关重要。ArgoCD 是一款针对 Kubernetes 的声明式 GitOps 持续交付工具,它是一种强大的解决方案。它有助于根据存储在 Git 存储库中的配置自动部署应用程序,从而使 Kubernetes 集群中的应用程序状态与 Git 中声明的配置保持一致。

Kaede6的博客 1386

LeetCode --- 937. Reorder Data in Log Files 解题报告

You are given an array oflogs. Each log is a space-delimited string of words, where the first word is theidentifier. There are two types of logs: Letter-logs: All words (except the identifier) consist of lowercase English letters. Digit-logs: All word..

杨鑫newlife的专栏 426

在K8S中使用ArgoCD做持续部署

设置介绍添加仓库地址添加成功。

cherryの技术文档 1937

uniapp - 使用web-view加载本地网页vue页面,用webview导入本地网页,uniAPP中使用web-view加载的本地及远程vue页面+双向通讯功能(兼容微信小程序、安卓苹果APP)

uniapp的App端web-view加载本地html,uniapp微信小程序webview加载本地HTML文件,在uniAPP中使用web-view加载的本地及远程vue页面且进行双向通讯,uni-app的web-view组件,支持加载远程网页,在app环境下,还支持加载本地HTML页面。uniapp WebView组件实现本地网页加载与通讯传值,uniAPP如何内嵌webView引入本地的vue网页示例代码,uniapp在web-view加载的本地及远程HTML中调用uni的API及网页和vue页面跳转

🏆 前端领域优质创作者 5226

PPT制作能力在职场中真的重要吗?一定要美术功底才能学好PPT吗?

我推出PPT技能培训专栏啦!好的PPT可以让你事半功倍、2023拥有PPT能力还可以让你具备一门极有价值的斜杠能力。更多内容请进:梦幻训练营专栏。专栏内会用本人积累的近10年的PPT学习方法论在短时间内教会你如何制作出精美绝伦的PPT,每篇教程后还会免费赠送一些小福利,不可多得。

打造全国最全的AI Agent开发知识领域的博客 728

Kubernetes + ArgoCD+github搭建自动化个人站点服务部署-上(原创)

利用kubeadm,用标准步骤部署一个最新版本的单节点kubernetes集群

Lrain的博客 1190

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

用快马 + ArgoCD 实现 Kubernetes 应用的 AI 生成与自动化部署

特别是对于 Kubernetes 这种配置复杂的场景,AI 生成的 YAML 文件既符合最佳实践,又带有详细注释,大大降低了学习曲线。结合 ArgoCD 后,真正实现了从代码生成到部署上线的全自动化流程。最近在研究如何将 AI 代码生成与 GitOps 工作流结合,发现用快马平台和 ArgoCD 搭配使用能极大提升 Kubernetes 应用的开发效率。配置完成后,ArgoCD 会立即开始第一次同步,将应用部署到集群。这种组合既利用了 AI 的快速开发能力,又充分发挥了 GitOps 在运维端的优势。

SnowflakeJaguar14的博客 757

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

WINCC7.3破解文件

WINCC7.3硬件够破解文件,有需要的下载!WINCC7.3硬件够破解文件,有需要的下载!

基于k8s的Jenkins CI/CD平台部署实践(三):集成ArgoCD实现持续部署

ArgoCD 是一款基于 GitOps 模式的持续部署工具,专为 Kubernetes 场景设计。它通过监听 Git 仓库中的应用声明文件(如 Kubernetes YAML/Helm/Kustomize 等),实现集群中资源的自动同步与状态管理。与传统的手动或脚本式部署方式不同,ArgoCD 将“部署即代码”理念贯彻到底,使部署流程标准化、可追溯、易于回滚。其提供了丰富的 Web UI、命令行工具和 API 支持,方便开发团队对应用的部署状态进行可视化管理与操作。

沉淀自己 3452

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

SpringBoot 自动部署到 Kubernetes:从 Helm 模板到 ArgoCD GitOps 实战

在现代企业级 DevOps 实践中,SpringBoot 服务的容器化部署已成为标准路径,而 Kubernetes 提供的强大编排能力让“声明式部署”成为可能。本文将系统性解析如何通过 Helm 管理部署模板、结合 ArgoCD 实现 GitOps 式持续交付,并围绕变量注入、自动化回滚、配置隔离等关键技术环节展开深入实战分析,帮助团队构建稳定、可审计、可回滚的 SpringBoot 微服务部署体系。

努力分享一些人工智能、计算机视觉、影像等相关的知识干货! 1412

GitOps实践指南:GitLab CI/CD + ArgoCD 实现 Kubernetes 自动化部署

🚀 本篇文章详细介绍了 GitLab CI/CD 的完整流程,从部署 Runner 到自动构建镜像、推送 Harbor、修改 K8s 配置再到 ArgoCD 自动更新,形成了一个标准的 GitOps 流水线。

沉淀自己 2019

基于K8s环境·使用ArgoCD部署Jenkins和静态Agent节点

今天是「DevOps云学堂」与你共同进步的第47天第⑦期DevOps实战训练营· 7月15日已开营实践环境升级基于K8s和ArgoCD本文节选自第⑦期DevOps训练营, 对于训练营的同学实践此文档依赖于基础环境配置文档, 运行K8s集群并配置NFS存储。实际上只要有个K8s集群并安装好Ingress、配置好持久化存储并部署好ArgoCD就可以实践了。本文主要分享的是编写Jenkins部署文件...

DevOps持续集成的博客 1185

ArgoCD集成部署到Kubernetes

ArgoCD集成部署到Kubernetes

虫虫的博客 1373

用ArgoCD快速验证K8s应用部署方案

尝试部署这个工具时,发现其内置的Kubernetes环境能直接对接ArgoCD实例,省去了自建集群的麻烦。对于需要快速验证方案的团队,这种开箱即用的体验确实能提升效率。在Kubernetes生态中,ArgoCD凭借声明式的GitOps工作流成为持续部署的热门工具。根据用户选择的策略和参数(如灰度比例),动态生成Application CRD和Rollout配置,自动填充所需的annotations与health checks。设置10%的初始流量,观察错误率监控5分钟后,通过滑动条逐步提升到50%

EmeraldWolf23的博客 655
上一篇: Terraform创建阿里云基础组件资源
下一篇: argocd部署cli工具并添加k8s集群
被一米六支配的恐惧
博客等级 码龄9年 246粉丝 95原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值