diff --git a/2025/helm/juanxiu/Dockerfile b/2025/helm/juanxiu/Dockerfile index 22cf998..797d3c5 100644 --- a/2025/helm/juanxiu/Dockerfile +++ b/2025/helm/juanxiu/Dockerfile @@ -22,4 +22,3 @@ FROM scratch COPY --from=builder /app/main /main CMD ["/main"] - diff --git a/2025/helm/juanxiu/charts/templates/application.yaml b/2025/helm/juanxiu/charts/templates/application.yaml new file mode 100644 index 0000000..c104895 --- /dev/null +++ b/2025/helm/juanxiu/charts/templates/application.yaml @@ -0,0 +1,18 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: {{ .Values.application.metadata.name }} + namespace: {{ .Values.application.metadata.namespace }} + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: {{ .Values.application.metadata.name }}-project + source: + {{- toYaml .Values.application.spec.source | nindent 4 }} + destination: + namespace: {{ .Values.application.spec.destination.namespace }} + server: {{ (index .Values.project.destinations 0).server }} + syncPolicy: + automated: + prune: true + selfHeal: true \ No newline at end of file diff --git a/2025/helm/juanxiu/charts/templates/project.yaml b/2025/helm/juanxiu/charts/templates/project.yaml new file mode 100644 index 0000000..f27a3bc --- /dev/null +++ b/2025/helm/juanxiu/charts/templates/project.yaml @@ -0,0 +1,16 @@ +apiVersion: argoproj.io/v1alpha1 +kind: AppProject +metadata: + name: {{ .Values.application.metadata.name }}-project + namespace: {{ .Values.application.metadata.namespace }} +spec: + description: Project for the {{ .Values.application.metadata.name }} application + sourceRepos: + {{- toYaml .Values.project.sourceRepos | nindent 4 }} + destinations: + {{- toYaml .Values.project.destinations | nindent 4 }} + namespaceResourceWhitelist: + - group: '' + kind: Service + - group: 'apps' + kind: Deployment \ No newline at end of file diff --git a/2025/helm/juanxiu/charts/values.yaml b/2025/helm/juanxiu/charts/values.yaml index e3d0683..5783834 100644 --- a/2025/helm/juanxiu/charts/values.yaml +++ b/2025/helm/juanxiu/charts/values.yaml @@ -56,7 +56,7 @@ service: type: NodePort # This sets the ports more information can be found here: https://kubernetes.io/docs/concepts/services-networking/service/#field-spec-ports port: 8080 - nodePort: 30080 + nodePort: 30081 # This block is for setting up the ingress for more information can be found here: https://kubernetes.io/docs/concepts/services-networking/ingress/ ingress: @@ -124,3 +124,22 @@ nodeSelector: {} tolerations: [] affinity: {} + +project: + sourceRepos: + - 'https://github.com/argoproj/argocd-example-apps.git' + destinations: + - namespace: helm-guestbook + server: https://kubernetes.default.svc + +application: + metadata: + name: helm-guestbook + namespace: argocd + spec: + source: + repoURL: 'https://github.com/argoproj/argocd-example-apps.git' + path: helm-guestbook + targetRevision: HEAD + destination: + namespace: helm-guestbook