From 1b5b620cde8064892522849d5e9380046e40cca8 Mon Sep 17 00:00:00 2001 From: clyhtsuriva Date: Wed, 29 Apr 2026 20:48:27 +0200 Subject: add hello-world test app --- apps/hello-world/deployment.yaml | 27 +++++++++++++++++++++++++++ apps/hello-world/kustomization.yaml | 8 ++++++++ apps/hello-world/namespace.yaml | 6 ++++++ apps/hello-world/service.yaml | 14 ++++++++++++++ argocd/applications/hello-world.yaml | 21 +++++++++++++++++++++ 5 files changed, 76 insertions(+) create mode 100644 apps/hello-world/deployment.yaml create mode 100644 apps/hello-world/kustomization.yaml create mode 100644 apps/hello-world/namespace.yaml create mode 100644 apps/hello-world/service.yaml create mode 100644 argocd/applications/hello-world.yaml diff --git a/apps/hello-world/deployment.yaml b/apps/hello-world/deployment.yaml new file mode 100644 index 0000000..29f3709 --- /dev/null +++ b/apps/hello-world/deployment.yaml @@ -0,0 +1,27 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello-world + namespace: hello-world +spec: + replicas: 2 + selector: + matchLabels: + app: hello-world + template: + metadata: + labels: + app: hello-world + spec: + containers: + - name: nginx + image: nginx:alpine + ports: + - containerPort: 80 + # Add a custom index page + lifecycle: + postStart: + exec: + command: ["/bin/sh", "-c", "echo '

Hello from GitOps! 🚀

Deployed via ArgoCD at '$(date)'

' > /usr/share/nginx/html/index.html"] +... diff --git a/apps/hello-world/kustomization.yaml b/apps/hello-world/kustomization.yaml new file mode 100644 index 0000000..47c9c45 --- /dev/null +++ b/apps/hello-world/kustomization.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: hello-world +resources: + - namespace.yaml + - deployment.yaml + - service.yaml diff --git a/apps/hello-world/namespace.yaml b/apps/hello-world/namespace.yaml new file mode 100644 index 0000000..3f02339 --- /dev/null +++ b/apps/hello-world/namespace.yaml @@ -0,0 +1,6 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: hello-world +... diff --git a/apps/hello-world/service.yaml b/apps/hello-world/service.yaml new file mode 100644 index 0000000..c93f494 --- /dev/null +++ b/apps/hello-world/service.yaml @@ -0,0 +1,14 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: hello-world + namespace: hello-world +spec: + selector: + app: hello-world + ports: + - port: 80 + targetPort: 80 + type: ClusterIP +... diff --git a/argocd/applications/hello-world.yaml b/argocd/applications/hello-world.yaml new file mode 100644 index 0000000..d7e8115 --- /dev/null +++ b/argocd/applications/hello-world.yaml @@ -0,0 +1,21 @@ +--- +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: hello-world + namespace: argocd +spec: + project: default + source: + repoURL: https://git.adjutor.xyz/homelab-gitops.git + targetRevision: main + path: apps/hello-world + destination: + server: https://kubernetes.default.svc + namespace: hello-world + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=true -- cgit v1.2.3