Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
      • Pod
    • Helm Chart
    • OAuth2 Proxy
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
    • MetalLB
    • Kong Gateway
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Argo Events
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • DevSecOps
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
      • Azure Cloud
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log, Monitor & Tracing
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

[ArgoCD] Thiết kế App of Apps trong ArgoCD

Posted on September 18, 2021December 13, 2021 By nim No Comments on [ArgoCD] Thiết kế App of Apps trong ArgoCD

Links tham khảo
https://medium.com/dzerolabs/turbocharge-argocd-with-app-of-apps-pattern-and-kustomized-helm-ea4993190e7c

Và nếu bạn lười đọc bài trên thì đọc bài của mình.

Turbocharge ArgoCD with App of Apps Pattern and Kustomized Helm | by Adri V  | Dzero Labs | Medium
Hình này mình lấy của bài viết trên

Từ trước đến giờ thì các App của mình thì nó show hết trên web và khá là rời rạc

Khi bạn ít app thì ko sao chứ nhiều bạn sẽ có nhu cầu group nó lại ví dụ theo môi trường, theo nhu cầu.

vậy giờ làm sao.

Bạn thiết kế theo kiểu helm chart
Đây là helm chart appcation Argocd nhé.

Contents

Toggle
  • 1) Simple tutorial
  • 2) Practice – step by step (Mon 13 Dec 2021)

1) Simple tutorial

Link helm chart ở dưới, nếu bạn biết helm rồi khá dễ hiểu
https://github.com/mrnim94/argocd-example-apps

Các đầu tiên tạo bằng UI

Nhiều ảnh chứ click nhanh lắm. Create thôi.

Cách 2: viết file yaml và apply

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: root-app
  namespace: argocd
  finalizers:
  - resources-finalizer.argocd.argoproj.io
spec:
  destination:
    namespace: default
    name: in-cluster
  project: default
  source:
    path: apps
    repoURL: https://github.com/argoproj/argocd-example-apps
    targetRevision: HEAD

Rồi dùng kubectl apply -f ….

Giờ bạn thử sync 1 app con

2) Practice – step by step (Mon 13 Dec 2021)

Mình sẽ tạo 1 folder: addons-istio-multi-cluster và trong này chứa các folder và file như ảnh:

kustomization.yaml: là file để argocd nó list path manifest cho dễ.
prometheus-multi-app.yaml: để dẫn vào chart app argocd, nó được design như helm ấy
>>>>kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: argocd
resources:
- prometheus-multi-app.yaml

file kustomization.yaml bảo với argocd là mày vào đọc file và apply file prometheus-multi-app.yaml

>>>>>prometheus-multi-app.yaml

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: prometheus-config
  namespace: argocd ##namepace này là nơi apply application argocd
  labels:
    type: root-app

spec:
  destination:
    namespace: argocd ##namepace này là nơi apply chart of argocd
    name: in-cluster
  project: default
  source:
    path: tiki/addons-istio-multi-cluster/app
    repoURL: https://gitlab.nimtechnology.com/nim/manifest-k8s
    targetRevision: HEAD

Giờ khám phá folder app có j?

Sẽ có 3 phần cũng na ná như helm
templates: Bộ sương của file manifest được gen ra
Chart.yaml và values.yaml: nó thêm data vào template.
>>>>>Chart.yaml

apiVersion: v2
name: prometheus ##trong file này mình chỉ khuyên bạn change chỗ này thôi he!!!
description: Applications

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: "1.0"

chúng ta sẽ đi vào file template trước

>>template(folder)
>>>>cluster.yaml

{{- range .Values.spec.destinations }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: app-prometheus-{{ .name }}
  namespace: argocd
spec:
  {{- if eq .autoSync "yes" }}
  syncPolicy:
    automated: {}
  {{- end }}
  destination:
    name: {{ .argoClusterName }}
    namespace: {{ .argoNamespace }}
  project: default
  source:
    {{- if .argoPath }}
    path: {{ .argoPath }}
    {{- else }}
    path: production/{{ .argoClusterName }}/{{ .argoNamespace }}
    {{- end }}
    repoURL: {{ $.Values.spec.source.repoURL }}
    targetRevision: {{ $.Values.spec.source.targetRevision }}
---
{{- end }}

Giờ chúng ta đến file value.yaml nó đưa data vào trong template

>>>>values.yaml

# Default values for app.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
spec:
  source:
    repoURL: https://gitlab.nimtechnology.com/nim/manifest-k8s
    targetRevision: HEAD
  destinations:
    - name: "istio-1.12.0-addons"
      autoSync: "no"
      argoClusterName: "in-cluster"
      argoNamespace: istio-system
      argoPath: istio/istio-1.12.0/samples/addons

Giờ bạn vào UI và tạo bình thường:

Giờ bạn click vào đó

Và giờ click tiếp

Ngon chiêm
ArgoCD

Post navigation

Previous Post: [alpine] Các câu lệnh hay quên trên linux alpine
Next Post: [rclone] Mount folder in linux with google drive by rclone. So helpful to backup data!

More Related Articles

[Argo-Notification] fix the problem: bad character U+005B ‘[‘  ArgoCD
[ArgoCD] Hướng dẫn tạo “local user” trên argocd ArgoCD
[ArgoCD Image Updater] How does Argocd trigger images on Dockerhub and deploy workload on k8s automatically? ArgoCD
[Argocd/Vault] Integrate Vault inside Argocd by the plugin ArgoCD
[ArgoCD/KSOPS/AWS] Encrypt secrets before pushing them to GitHub. ArgoCD
[Gitops] Evolving DevOps to GitOps ArgoCD

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • [Azure/Loadbalancer] Creating an internal load balancer on Azure Kubernetes Service (AKS). May 13, 2025
  • [Azure] The subscription is not registered to use namespace ‘Microsoft.ContainerService’ May 8, 2025
  • [Azure] Insufficient regional vcpu quota left May 8, 2025
  • [WordPress] How to add a Dynamic watermark on WordPress. May 6, 2025
  • [vnet/Azure] VNet provisioning via Terraform. April 28, 2025

Archives

  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • BareMetal
    • NextCloud
  • CI/CD
    • Argo Events
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • DevSecOps
    • Golang
    • Jquery & JavaScript
    • Laravel
    • NextJS 14 & ReactJS & Type Script
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • Azure Cloud
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kong Gateway
    • Kubernetes
      • Ingress
      • Pod
    • Longhorn – Storage
    • MetalLB
    • OAuth2 Proxy
    • Vault
    • VictoriaMetrics
  • Log, Monitor & Tracing
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Fluent
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2025 NimTechnology.