How chinnu0209/ecofact works
1. What this repository is
This is primarily an infrastructure / delivery repo, not an application codebase. Its purpose is to document and define the tooling needed to run the Ecofact app on a K3s Kubernetes cluster using GitLab CI and Argo CD.
2. Core runtime topology
The target environment is a 3-node K3s cluster: one control-plane/master node and two workers, with a mixed-architecture setup called out in the README:
- master: AMD64
- worker 1: AMD64
- worker 2: ARM64
This matters because the repo also describes a Raspberry Pi 4B ARM-based GitLab Runner, so the build/deploy chain spans multiple CPU architectures.
3. CI subsystem
The .gitlab-ci.yml file defines the pipeline that runs when developers push changes. The README indicates the pipeline is handled by a private GitLab Runner rather than shared runners, which creates a boundary between the GitLab control plane and local build infrastructure.
4. Runner execution boundary
The runner is installed on a Raspberry Pi and configured to use the Docker executor. That means CI jobs run inside containers on the Pi, not directly on the Kubernetes cluster. This runner is the place where source code is checked out, dependencies are installed, and images are built.
5. Container build and packaging flow
The README describes a standard Docker packaging flow: source code plus a Dockerfile produce a container image, which is then tested locally and pushed to a registry. The example app is Node-based, but the repo’s architecture is generic: source → image build → registry.
6. Registry handoff
After the GitLab job builds the image, it is pushed to a container registry such as Docker Hub. This registry is the handoff point between CI and deployment. The cluster does not build the app; it pulls a prebuilt image.
7. GitOps/CD subsystem
Argo CD is installed into the K3s cluster in its own namespace (argocd). The repo’s argocd-pipeline.yml likely supports the GitOps-style delivery flow, where Argo CD watches Git state and reconciles desired manifests to the cluster. This is the deployment control plane separate from GitLab CI.
8. Application deployment manifests
Ecofact-deployment.yml and Ecofact-service.yml represent the Kubernetes workload definition for the Ecofact app:
- Deployment: defines the pod template, replicas, and container image
- Service: exposes the pods inside the cluster
These manifests are the desired state that Argo CD applies into the target namespace, described in the README as raspi.
9. Namespace and environment boundaries
The repo uses namespaces to isolate concerns:
- argocd for the Argo CD control components
- raspi for the Ecofact application workload
- kubernetes-dashboard for the dashboard UI
This separation is important for diagramming, because the app plane, delivery plane, and admin/observability plane are distinct.
10. Cluster access and networking
The K3s cluster is exposed through Kubernetes API ports (6443, 443) and controlled via standard kubectl and argocd CLI flows. The README also mentions port-forwarding for Argo CD (8080:443) and Kubernetes Dashboard proxy access (8001), which means UI access is intentionally kept local rather than publicly exposed.
11. Observability/admin subsystem
dashboard.yml is associated with Kubernetes Dashboard access and RBAC setup. The dashboard is not part of application delivery; it is an operational view into the cluster, authenticated with a token and accessed through kubectl proxy.
12. Operational documentation
k3s.txt and the README act as the installation/runbook layer. They document cluster provisioning, token exchange, firewall opening, runner registration, and application deployment. In architecture terms, these files describe the infrastructure lifecycle, not business logic.
13. End-to-end data flow
The main flow is:
developer commit → GitLab CI pipeline → Docker image build on Raspberry Pi runner → image push to registry → Argo CD deploys manifests to K3s → pods run in the raspi namespace → dashboard/CLI used for verification.
That is the central architecture to capture in a diagram.
14. Key repo takeaway
The repository is best diagrammed as a delivery platform around Ecofact, with four major nodes:
- source/pipeline definition in GitLab
- private ARM runner for builds
- K3s cluster as the runtime target
- Argo CD and Kubernetes Dashboard as deployment and operations layers
Main entry points: .gitlab-ci.yml CI pipeline · argocd-pipeline.yml Argo CD app · README.md README · Ecofact-deployment.yml Deployment
Components 15
CI / Build
Pipeline and build runner boundary.
- CI pipeline · GitLab pipeline definition for build and delivery.
.gitlab-ci.yml - Pi runner · Private Raspberry Pi Docker executor used for jobs.
- Build image · Container packaging step from source and Dockerfile.
- Registry · Stores built container images for deployment.
GitOps / Deploy
Argo CD and Kubernetes workload manifests.
- Argo CD app · GitOps deployment configuration and sync target.
argocd-pipeline.yml - Deployment · Ecofact pod template and rollout definition.
Ecofact-deployment.yml - Service · Internal service exposure for the app pods.
Ecofact-service.yml
K3s Cluster
Target runtime environment and namespaces.
- argocd ns · Namespace for Argo CD control components.
- raspi ns · Namespace hosting the Ecofact application.
- dashboard ns · Namespace used for Kubernetes Dashboard.
- K3s cluster · Three-node mixed-architecture target cluster.
Connections 21
- README → CI pipeline: describes · Runbook documents the CI flow.
- README → K3s cluster: targets · Documents the K3s runtime topology.
- README → kubectl/argo: uses · Explains operational access patterns.
- K3s notes → K3s cluster: provisions · Cluster setup and node access notes.
- CI pipeline → Pi runner: runs on · GitLab jobs execute on the private runner.
- Pi runner → Build image: executes · Runner performs checkout, install, and image build.
- Build image → Registry: pushes · Built images are published to a registry.
- CI pipeline → Argo CD app: hands off · Pipeline produces deployment state for GitOps delivery.
- Registry → Deployment: image source · Deployment consumes the prebuilt container image.
- Argo CD app → Deployment: syncs · Argo CD reconciles application manifests.
- Argo CD app → Service: syncs · Argo CD applies service manifest as desired state.
- Deployment → raspi ns: applies to · Workload is deployed into the app namespace.
- Service → raspi ns: exposes in · Service lives with the application namespace.
- K3s cluster → argocd ns: contains · Cluster hosts the Argo CD control plane.
- K3s cluster → raspi ns: contains · Cluster hosts the Ecofact workload namespace.
- K3s cluster → dashboard ns: contains · Cluster hosts the dashboard namespace.
- Dashboard → dashboard ns: uses · Dashboard is deployed in its own namespace.
- Dashboard → kubectl/argo: accessed via · Dashboard is typically reached through kubectl proxy.
- kubectl/argo → K3s cluster: administers · CLI access manages and verifies the cluster.
- Argo CD app → argocd ns: operates in · Argo CD control components live in argocd namespace.
- CI pipeline → Registry: publishes · Pipeline ultimately delivers the built artifact.