这个可以换吗
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: elastic-operator
labels:
argocd.application.type: "system"
spec:
ignoreDifferences:
- group: admissionregistration.k8s.io
kind: ValidatingWebhookConfiguration
jsonPointers:
- /webhooks/0/clientConfig/caBundle
- group: admissionregistration.k8s.io
kind: ValidatingWebhookConfiguration
jsonPointers:
- /webhooks/1/clientConfig/caBundle
- group: admissionregistration.k8s.io
kind: ValidatingWebhookConfiguration
jsonPointers:
- /webhooks/2/clientConfig/caBundle
Run Code Online (Sandbox Code Playgroud)
对于使用“通配符”的东西?以下是我正在寻找的“非工作”示例:
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: elastic-operator
labels:
argocd.application.type: "system"
spec:
ignoreDifferences:
- group: admissionregistration.k8s.io
kind: ValidatingWebhookConfiguration
jsonPointers:
- /webhooks/[*]/clientConfig/caBundle
Run Code Online (Sandbox Code Playgroud)
我无法在他们的文档中找到任何说明这是可能的或相反的内容。iehttps://argoproj.github.io/argo-cd/user-guide/diffing/ 似乎正在使用“json-patch”,但阅读了一些 RFC,我也找不到有关通配符的任何信息。
谢谢!
我们已经愉快地将 ArgoCD 与公共存储库一起使用了一段时间,但在尝试将 ArgoCD 连接到私有存储库时遇到了问题。我们有一个Application
看起来像这样的:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: example-app
namespace: argocd
spec:
destination:
name: example-cluster
namespace: open-cluster-management-agent
project: ops
source:
path: .
repoURL: ssh://git@github.com/example-org/example-repo.git
targetRevision: HEAD
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- Validate=false
- ApplyOutOfSyncOnly=true
Run Code Online (Sandbox Code Playgroud)
以及相应的密钥,其密钥如下所示:
apiVersion: v1
metadata:
labels:
argocd.argoproj.io/secret-type: repository
name: example-repo
namespace: argocd
type: Opaque
stringData:
sshPrivateKey: |
-----BEGIN OPENSSH PRIVATE KEY-----
...
-----END OPENSSH PRIVATE KEY-----
url: ssh://git@github.com/example-org/example-repo.git
kind: Secret
Run Code Online (Sandbox Code Playgroud)
ArgoCD 无法同步此应用程序并显示以下错误:
rpc error: code = Unknown desc = …
Run Code Online (Sandbox Code Playgroud) 我正在尝试为 gitops 设置 ArgoCD。我使用 ArgoCD Helm Chart 将其部署到本地 Docker Desktop Kubernetes 集群。我正在尝试使用 ArgoCD 的应用程序模式。
\n问题是,当我应用 yaml 来创建根应用程序时,没有任何反应。\n这是 yaml(由helm template apps/ -n argocd
我的公共存储库中的命令创建https://github.com/gajewa/gitops
):
apiVersion: argoproj.io/v1alpha1\nkind: Application\nmetadata:\n name: root\n finalizers:\n - resources-finalizer.argocd.argoproj.io\nspec:\n destination:\n server: http://kubernetes.default.svc\n namespace: argocd\n project: default\n source:\n path: apps/\n repoURL: https://github.com/gajewa/gitops.git\n targetRevision: HEAD\n syncPolicy:\n automated:\n prune: true\n selfHeal: true\n
Run Code Online (Sandbox Code Playgroud)\n资源已创建,但 Argo UI 中实际上没有发生任何事情。没有可见的应用程序。因此,我尝试通过 Web UI 创建应用程序,甚至将 yaml 粘贴到其中。该应用程序是在 Web ui 中创建的,它似乎与 prometheus 和 argo 的 yaml 模板同步并查看存储库,但它实际上并未在 ArgoCD 中创建 prometheus 应用程序。根应用程序的普罗米修斯部分正在不断进步。
\n …我们\xe2\x80\x99在生产中面临一个奇怪的问题,其中一个应用程序陷入终止和同步状态。
\nArgoCD版本:2.1.7
\n背景:
\n我们手动终止了应用程序的同步,现在应用程序陷入终止同步状态,并且禁用自动同步按钮也不起作用。
\n注意:\n使用类似的配置创建一个新应用程序是可行的,但我们想调查当前应用程序卡住的原因。
\n执行的步骤:
\n已尝试的命令
\nargocd app terminate-op APPNAME\nargocd app sync APPNAME\nargocd app sync APPNAME --force --prune \n
Run Code Online (Sandbox Code Playgroud)\n一些日志(不确定这些是否相关):
\ntime="2022-01-07T16:19:36Z" level=debug msg="Failed to apply normalization: error in remove for path: \'/spec/preserveUnknownFields\': Unable to remove nonexistent key: preserveUnknownFields: missing value"\ntime="2022-01-07T16:19:36Z" level=debug msg="Failed to apply normalization: error in remove for path: \'/status\': Unable to remove nonexistent key: …
Run Code Online (Sandbox Code Playgroud) 我们设置了 Traefik 作为入口控制器/CRD 和 ArgoCD。我们将 ArgoCD 安装到EKS 设置中,如Argo 入门指南中所述:
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Run Code Online (Sandbox Code Playgroud)
现在,正如文档所述,正确配置 Traefik 的对象IngressRoute
如下所示:
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: argocd-server
namespace: argocd
spec:
entryPoints:
- websecure
routes:
- kind: Rule
match: Host(`argocd.tekton-argocd.de`)
priority: 10
services:
- name: argocd-server
port: 80
- kind: Rule
match: Host(`argocd.tekton-argocd.de`) && Headers(`Content-Type`, `application/grpc`)
priority: 11
services:
- name: argocd-server
port: 80
scheme: h2c
tls:
certResolver: default
Run Code Online (Sandbox Code Playgroud)
现在文档中有一个错误- …
全部 !:)
\nI\xe2\x80\x99m 使用具有多应用程序架构的单一存储库。
\n- foo\n - dev\n - alp\n - prd\n- bar\n - dev\n - alp\n - prd\n- argocd\n - dev\n - foo-application (argo cd app, target revision : master, destination cluster : dev, path: foo/dev)\n - bar-application (argo cd app, target revision : master, destination cluster : dev, path: bar/dev)\n - alp\n - foo-application (argo cd app, target revision : master, destination cluster: alp, path: foo/alp)\n - bar-application (argo cd app, target revision : master, destination …
Run Code Online (Sandbox Code Playgroud) 我需要根据一些标签过滤器列出所有应用程序。
https://argocd_domain/api/v1/applications
为了列出 argoCD API 中的所有应用程序,我想放置所有可能的过滤器。
我正在尝试将舵图(https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack)添加到ArgoCD。
当我这样做时,我收到以下错误:
无法保存更改:应用程序规范无效:InvalidSpecError:存储库不可访问:未找到存储库
你们能帮我一下吗?我认为我做的一切都是对的,但似乎有些不对劲......
这是项目 yaml。
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: prom-oper
namespace: argocd
spec:
project: prom-oper
source:
repoURL: https://prometheus-community.github.io/helm-charts
targetRevision: "13.2.1"
path: prometheus-community/kube-prometheus-stack
helm:
# Release name override (defaults to application name)
releaseName: prom-oper
version: v3
values: |
... redacted
directory:
recurse: false
destination:
server: https://kubernetes.default.svc
namespace: prom-oper
syncPolicy:
automated: # automated sync by default retries failed attempts 5 times with following delays between attempts ( 5s, 10s, 20s, 40s, 80s ); retry controlled using `retry` …
Run Code Online (Sandbox Code Playgroud) 我想知道在使用 ArgoCD 成功部署任何微服务后,如何运行应用程序 E2E(UI 或 API)测试。
当前设置:我使用 github-actions 设置了 CI 管道。完成任何微服务的 CI 构建后,它会更新位于 github 存储库之一的 helm 值中的 docker 镜像版本。然后 ArgoCD 会轮询此存储库是否有任何更改,如果存在更改,则将其部署在 Kubernetes 集群中。
意图:我想在 argocd 同步 Helm 图表中定义的任何微服务部署对象后运行应用程序 E2E(UI 和 API)测试。但我不确定 github 操作中的触发点应该是什么。E2E 测试 github 操作工作流程如何知道 argocd 已毫无问题地部署了微服务,并且服务已准备好供自动化测试使用。
我遇到了一种情况,我需要创建一个部署模板来依次使用多个值文件,而不需要合并或覆盖。valueFiles 在 argoCD 应用程序 yaml 文件的 valueFiles 参数下指定。
有人可以帮助解决如何克服这种情况。我需要创建一个舵模板,该模板应该使用某种范围函数等依次获取值文件。
提前致谢
一个简单的 helm 模板示例,用于将多个值文件依次传递到 helm 模板。
argocd ×10
kubernetes ×3
argo ×2
gitops ×2
argoproj ×1
deployment ×1
devops ×1
git ×1
json-patch ×1
jsonpath ×1
kustomize ×1
ssh ×1
traefik ×1