Files
K3S/addons/argocd
Sergey Antropoff 38aaadbfb1 docs: sync addon docs with explicit external/internal service modes
Обновлена документация под новые аддоны (gitlab, redis, mongodb, kafka, kafka-ui, rabbitmq) и новую модель явного выбора зависимостей. Добавлены и унифицированы описания переключателей *_database_mode и *_redis_mode, обновлена таблица зависимостей аддонов, примеры конфигурации и список vault-секретов.
2026-04-29 23:21:04 +03:00
..
2026-04-24 21:01:26 +03:00

ArgoCD

GitOps-инструмент для непрерывного деплоя. Синхронизирует состояние кластера с Git-репозиторием. Устанавливается через Helm, поддерживает Ingress, TLS и интеграцию с Prometheus.

Быстрый старт

# group_vars/all/addons.yml
addon_argocd: true
make addon-argocd

Параметры

Переменная Умолч. Описание
argocd_ingress_enabled false Включить Ingress
argocd_ingress_host argocd.example.com Hostname
argocd_ingress_tls false TLS через cert-manager
argocd_metrics_enabled true Prometheus метрики
argocd_redis_mode auto auto | internal | external_redis
# group_vars/all/addons.yml
argocd_ingress_enabled: true
argocd_ingress_host: "argocd.example.com"
argocd_ingress_tls: true

Режим Redis (встроенный или внешний)

Выбор задаётся переменной argocd_redis_mode:

  • auto — внешний Redis при addon_redis: true, иначе встроенный Redis чарта;
  • internal — всегда встроенный Redis;
  • external_redis — всегда внешний Redis (например из addon redis).

Первый вход

После установки Ansible выводит начальный пароль. Сменить:

argocd login argocd.example.com
argocd account update-password

Или получить начальный пароль вручную:

kubectl -n argocd get secret argocd-initial-admin-secret \
  -o jsonpath='{.data.password}' | base64 -d

Создать приложение

Через CLI

argocd app create my-app \
  --repo https://github.com/org/repo.git \
  --path k8s/ \
  --dest-server https://kubernetes.default.svc \
  --dest-namespace default \
  --sync-policy automated

Через манифест

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-app
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/org/repo.git
    targetRevision: main
    path: k8s/
  destination:
    server: https://kubernetes.default.svc
    namespace: my-app
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true

ApplicationSet — деплой в несколько кластеров/окружений

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: my-app-environments
  namespace: argocd
spec:
  generators:
    - list:
        elements:
          - cluster: staging
            url: https://staging-k8s:6443
          - cluster: production
            url: https://prod-k8s:6443
  template:
    metadata:
      name: 'my-app-{{cluster}}'
    spec:
      source:
        repoURL: https://github.com/org/repo.git
        path: 'environments/{{cluster}}'
      destination:
        server: '{{url}}'
        namespace: my-app

Helm чарт через ArgoCD

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-helm-app
  namespace: argocd
spec:
  source:
    repoURL: https://charts.example.com
    chart: my-chart
    targetRevision: "1.2.3"
    helm:
      values: |
        replicaCount: 2
        ingress:
          enabled: true
          host: app.example.com
  destination:
    server: https://kubernetes.default.svc
    namespace: my-app

Интеграция с Gitea/GitHub

В ArgoCD UI → Settings → Repositories → Connect Repo:

# Или через Secret:
apiVersion: v1
kind: Secret
metadata:
  name: gitea-repo
  namespace: argocd
  labels:
    argocd.argoproj.io/secret-type: repository
stringData:
  type: git
  url: https://gitea.example.com/org/repo.git
  username: gitea
  password: "token-or-password"

Официальные ресурсы