# yafan11/kubernetes-argo-cd-gitops-hello-time-app architecture

> Architecture diagram of the GitHub repository yafan11/kubernetes-argo-cd-gitops-hello-time-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yafan11/kubernetes-argo-cd-gitops-hello-time-app
- Repository: https://github.com/yafan11/kubernetes-argo-cd-gitops-hello-time-app

## Overview

##### Project type and purpose
- This is a simple, containerized web application (“Hello Time App”) whose sole function is to display the current time in a browser.
- It demonstrates GitOps best-practices by using Argo CD to continuously deploy the application to a Kubernetes cluster.

##### File structure
- Top level:
- LICENSE, README.md
- hello-time-app/ (application source & Docker assets)
- img/ (any illustrative assets)
- k8s/ (Kubernetes manifests and Argo CD namespace YAML)
- hello-time-app/:
- Dockerfile & .dockerignore → container build context
- hello-time-app.conf → Nginx configuration
- index.html → static web page showing time
- k8s/:
- argocd-namespace.yaml → defines the Argo CD installation namespace
- hello-time-app-deployment.yaml → Deployment spec for the Nginx-based container
- hello-time-app-service.yaml → Service exposing the Pod

##### Key insights from the README
- Technologies: Docker, Nginx, Kubernetes, Argo CD, Git
- Workflow:
1. Developer commits code/manifests to GitHub
2. Argo CD watches the repo path
3. Argo CD syncs manifests into the cluster
- Outcome: a running Nginx Pod serving index.html, reachable via a Kubernetes Service (LoadBalancer/Ingress).

a. Main components
- Developer Git repository (GitHub)
- Continuous Delivery controller (Argo CD server + repo server)
- Container registry (implicit: Docker Hub or private registry)
- Kubernetes cluster
– Control plane (API server, etcd)
– hello-time-app Namespace
– Deployment → Pod running Nginx + index.html
– Service → ClusterIP/LoadBalancer exposing Pod
- (Optional) Ingress / LoadBalancer for external traffic

b. Relationships and interactions
1. Developer → Push to GitHub
2. Argo CD GitOps loop: GitHub → Argo CD (detects change) → K8s API Server (applies manifests)
3. Kubernetes scheduler pulls container image from registry → Pod
4. Client traffic → LoadBalancer/Ingress → Service → Pod

c. Architectural patterns & design principles
– GitOps: declarative manifests in Git drive cluster state
– Immutable container images for reproducibility
– Separation of concerns:
- Application code vs. infrastructure manifests
- Control plane vs. data plane

d. Key technologies
– Docker (image build)
– Nginx (web server)
– Kubernetes (orchestration)
– Argo CD (GitOps CD)
– GitHub (source of truth)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Lanes using subgraphs
    subgraph "CI/CD" 
        direction TB
        Developer["Developer"]:::external
        subgraph "GitHub Repository" 
            direction TB
            LICENSE["LICENSE"]:::code
            README["README.md"]:::code
            subgraph "hello-time-app/" 
                direction TB
                Dockerfile["Dockerfile"]:::code
                Dockerignore[".dockerignore"]:::code
                Index["index.html"]:::code
                NginxConf["hello-time-app.conf"]:::code
            end
            img_dir["img/"]:::code
            subgraph "k8s/" 
                direction TB
                ArgoNS["argocd-namespace.yaml"]:::code
                DeployYAML["hello-time-app-deployment.yaml"]:::code
                ServiceYAML["hello-time-app-service.yaml"]:::code
            end
        end
        Registry["Container Registry"]:::external
        ArgoCDServer["Argo CD Server"]:::control
        ArgoCDRepo["Argo CD Repo Server"]:::control
    end

    subgraph "Infrastructure"
        direction TB
        K8sAPI["K8s API Server"]:::control
    end

    subgraph "Application"
        direction TB
        subgraph "Kubernetes Cluster"
            direction TB
            subgraph "hello-time-app Namespace"
                direction TB
                Deployment["Deployment (Nginx Pod)"]:::runtime
                Service["Service (LoadBalancer)"]:::runtime
                Pod["Nginx Pod\nserving index.html"]:::runtime
            end
        end
        Client["End User (Browser)"]:::external
    end

    %% Connections
    Developer -->|push code| LICENSE
    LICENSE --> README
    README --> Dockerfile
    Dockerfile -->|"build image"| Registry
    Registry -->|"pull image"| Pod
    README --> ArgoNS
    ArgoNS --> DeployYAML
    DeployYAML --> ServiceYAML
    ServiceYAML --> ArgoCDServer
    LICENSE -.-> ArgoCDRepo
    README -.-> ArgoCDRepo
    ArgoCDRepo -->|detect change| ArgoCDServer
    ArgoCDServer -->|sync manifests| K8sAPI
    K8sAPI --> Deployment
    Deployment --> Pod
    Service --> Pod
    Client -->|HTTP request| Service

    %% Click Events
    click LICENSE "https://github.com/yafan11/kubernetes-argo-cd-gitops-hello-time-app/tree/main/LICENSE"
    click README "https://github.com/yafan11/kubernetes-argo-cd-gitops-hello-time-app/blob/main/README.md"
    click Dockerfile "https://github.com/yafan11/kubernetes-argo-cd-gitops-hello-time-app/tree/main/hello-time-app/Dockerfile"
    click Dockerignore "https://github.com/yafan11/kubernetes-argo-cd-gitops-hello-time-app/blob/main/hello-time-app/.dockerignore"
    click Index "https://github.com/yafan11/kubernetes-argo-cd-gitops-hello-time-app/blob/main/hello-time-app/index.html"
    click NginxConf "https://github.com/yafan11/kubernetes-argo-cd-gitops-hello-time-app/blob/main/hello-time-app/hello-time-app.conf"
    click img_dir "https://github.com/yafan11/kubernetes-argo-cd-gitops-hello-time-app/tree/main/img/"
    click ArgoNS "https://github.com/yafan11/kubernetes-argo-cd-gitops-hello-time-app/blob/main/k8s/argocd-namespace.yaml"
    click DeployYAML "https://github.com/yafan11/kubernetes-argo-cd-gitops-hello-time-app/blob/main/k8s/hello-time-app-deployment.yaml"
    click ServiceYAML "https://github.com/yafan11/kubernetes-argo-cd-gitops-hello-time-app/blob/main/k8s/hello-time-app-service.yaml"

    %% Styles
    classDef external fill:#BBDEFB,stroke:#1E88E5,color:#0D47A1
    classDef control fill:#FFE0B2,stroke:#FB8C00,color:#E65100
    classDef runtime fill:#C8E6C9,stroke:#43A047,color:#1B5E20
    classDef code fill:#E1BEE7,stroke:#8E24AA,color:#4A148C
```
