diff --git a/2025/argo-cd/bianbbc87/octocat/Chart.yaml b/2025/argo-cd/bianbbc87/octocat/Chart.yaml new file mode 100644 index 0000000..59db9e6 --- /dev/null +++ b/2025/argo-cd/bianbbc87/octocat/Chart.yaml @@ -0,0 +1,8 @@ +apiVersion: v2 # Helm 3 +name: bianbbc87-study +version: 0.1.1 +appVersion: 0.1.0 +description: "A Helm chart for deploying bianbbc87's study application with AppProject" +maintainers: + - name: bianbbc87 + email: bian87@dgu.ac.kr \ No newline at end of file diff --git a/2025/argo-cd/bianbbc87/octocat/templates/application.yaml b/2025/argo-cd/bianbbc87/octocat/templates/application.yaml new file mode 100644 index 0000000..b3d5484 --- /dev/null +++ b/2025/argo-cd/bianbbc87/octocat/templates/application.yaml @@ -0,0 +1,21 @@ +# application 리소스를 정의, 어디에 어떤 앱을 어떻게 배포할지 등 + +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: {{ .Values.application.metadata.name }} + namespace: {{ .Values.application.metadata.namespace }} +spec: + project: {{ .Values.application.spec.project | default "study" }} + source: + repoURL: {{ index .Values.project.sourceRepos 0 }} + targetRevision: HEAD + path: helm-guestbook + destination: + server: https://kubernetes.default.svc + namespace: {{ .Values.application.spec.destination.namespace }} + syncPolicy: + # 자동 sync + automated: + prune: true + selfHeal: true \ No newline at end of file diff --git a/2025/argo-cd/bianbbc87/octocat/templates/project.yaml b/2025/argo-cd/bianbbc87/octocat/templates/project.yaml new file mode 100644 index 0000000..747b1da --- /dev/null +++ b/2025/argo-cd/bianbbc87/octocat/templates/project.yaml @@ -0,0 +1,23 @@ +# application 그룹화, 정책적 제약 설정 + +apiVersion: argoproj.io/v1alpha1 +kind: AppProject +metadata: + name: study +spec: + destinations: + {{- range .Values.project.destinations }} + - namespace: {{ .namespace }} + server: {{ .server }} + {{- end }} + # sourceRepos : 프로젝트에서 허용된 git 저장소 목록 + sourceRepos: + {{- range .Values.project.sourceRepos }} + - {{ . }} + {{- end }} + # deployment와 service만 허용 + namespaceResourceWhitelist: + - group: '*' + kind: Service + - group: '*' + kind: Deployment \ No newline at end of file diff --git a/2025/argo-cd/bianbbc87/octocat/values.yaml b/2025/argo-cd/bianbbc87/octocat/values.yaml new file mode 100644 index 0000000..1d182a3 --- /dev/null +++ b/2025/argo-cd/bianbbc87/octocat/values.yaml @@ -0,0 +1,14 @@ +project: + sourceRepos: + - https://github.com/bianbbc87/argocd-example-apps + destinations: + - namespace: argocd + server: https://kubernetes.default.svc + +application: + metadata: + name: bianbbc87-study + namespace: argocd + spec: + destination: + namespace: argocd \ No newline at end of file diff --git a/2025/argo-cd/bianbbc87/test-rendered.yaml b/2025/argo-cd/bianbbc87/test-rendered.yaml new file mode 100644 index 0000000..8c2d2a3 --- /dev/null +++ b/2025/argo-cd/bianbbc87/test-rendered.yaml @@ -0,0 +1,44 @@ +--- +# Source: bianbbc87-study/templates/project.yaml +# application 그룹화, 정책적 제약 설정 + +apiVersion: argoproj.io/v1alpha1 +kind: AppProject +metadata: + name: study +spec: + destinations: + - namespace: argocd + server: https://kubernetes.default.svc + # sourceRepos : 프로젝트에서 허용된 git 저장소 목록 + sourceRepos: + - https://github.com/bianbbc87/argocd-example-apps + # deployment와 service만 허용 + namespaceResourceWhitelist: + - group: '*' + kind: Service + - group: '*' + kind: Deployment +--- +# Source: bianbbc87-study/templates/application.yaml +# application 리소스를 정의, 어디에 어떤 앱을 어떻게 배포할지 등 + +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: bianbbc87-study + namespace: argocd +spec: + project: study + source: + repoURL: https://github.com/bianbbc87/argocd-example-apps + targetRevision: HEAD + path: helm-guestbook + destination: + server: https://kubernetes.default.svc + namespace: argocd + syncPolicy: + # 자동 sync + automated: + prune: true + selfHeal: true