argocd

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package argocd 는 Argo CD Application 리소스를 만든다.

스택이 Argo CD 를 설치해도 Application 이 없으면 아무것도 동기화하지 않는다. 앱 저장소의 deploy/ 경로를 가리키는 Application 을 만들어야, CI 가 갱신한 이미지 태그가 실제 배포로 이어진다.

Index

Constants

View Source
const (
	// DefaultManifestPath 는 앱 저장소에서 매니페스트가 있는 경로다.
	// 스캐폴딩이 deploy/ 에 파일을 넣으므로 기본값을 맞춘다.
	DefaultManifestPath = "deploy"

	// DefaultTargetRevision 은 추적할 기본 브랜치다.
	DefaultTargetRevision = "main"

	// DefaultArgoProject 는 Argo CD 의 기본 프로젝트다.
	DefaultArgoProject = "default"
)

Variables

This section is empty.

Functions

func RenderApplication

func RenderApplication(spec ApplicationSpec) (string, error)

RenderApplication 은 Application 매니페스트 YAML 을 만든다.

구조체를 map 으로 조립한 뒤 직렬화한다 — 문자열 템플릿은 들여쓰기 실수가 조용히 통과할 수 있고, 그 결과는 클러스터에 적용할 때야 드러난다.

func RenderRepositorySecret

func RenderRepositorySecret(spec RepositorySecretSpec) (string, error)

RenderRepositorySecret 은 Argo CD 저장소 자격증명 Secret 을 만든다.

Application 만 만들고 자격증명을 주지 않으면 private 저장소에서 "authentication required" 로 동기화가 실패한다.

Types

type ApplicationSpec

type ApplicationSpec struct {
	AppName string
	// ArgoNamespace 는 Argo CD 가 설치된 네임스페이스다.
	// Application 이 이 네임스페이스에 있어야 컨트롤러가 인식한다.
	ArgoNamespace string
	// ArgoProject 는 Argo CD 프로젝트다. 비면 default.
	ArgoProject string
	// RepoURL 은 앱 저장소 주소다.
	RepoURL string
	// Path 는 저장소 안 매니페스트 경로다. 비면 deploy.
	Path string
	// TargetRevision 은 추적할 브랜치/태그다. 비면 main.
	TargetRevision string
	// DestinationNamespace 는 배포 대상 네임스페이스다.
	DestinationNamespace string
}

ApplicationSpec 은 Application 렌더 요청이다.

type RepositorySecretSpec

type RepositorySecretSpec struct {
	AppName       string
	ArgoNamespace string
	RepoURL       string
	Username      string
	Password      string
}

RepositorySecretSpec 은 저장소 자격증명 Secret 요청이다.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL