Portfolio deployment using K3s, Terraform, Atmos, and ArgoCD on Oracle Cloud Free Tier
· Installation · Architecture · Development · Common operations ·
This repository demonstrates infrastructure automation and GitOps principles by deploying a portfolio website on Oracle Cloud Infrastructure Free Tier. The stack uses Terraform with Atmos for infrastructure orchestration, K3s for container orchestration, and ArgoCD for continuous deployment.
Key capabilities:
- Declarative infrastructure provisioning with Terraform
- GitOps workflow via ArgoCD ApplicationSets
- Automated image updates and zero-downtime deployments
- Secure secret management using SOPS and OCI Vault
- CI/CD pipeline with minimal credentials via GitHub OIDC
Install the following tools before beginning:
- Create Oracle Cloud Infrastructure account
- Upgrade Free Tier to paid account for priority resource allocation (remains within Free Tier limits)
- Create Cloudflare account and generate API token with DNS management permissions
- Generate GitHub Personal Access Token with
repoandpackagesscopes
git clone https://github.com/fapiper/fabianpiper.com.git
cd fabianpiper.comInitialize encryption and configure secrets:
make setupNote
This generates secrets/.sops.key and configures SOPS for all secret files.
Copy the example secrets file and add your credentials:
cp secrets/prod/secrets.example.yaml secrets/prod/secrets.decrypted.yamlEdit secrets/prod/secrets.decrypted.yaml with your actual values, then encrypt:
make sops-encrypt-prodDeploy the complete stack with a single command:
make deploy-prodThis provisions networking, IAM policies, OCI Vault, OIDC configuration, and a K3s cluster with ArgoCD automatically installed.
Verify deployment health:
make validate-prodRetrieve the admin password:
ssh -i ~/.ssh/id_rsa ubuntu@<INGRESS_IP> \
'ssh ubuntu@10.0.2.10 sudo kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d'Create a port forward to access the UI:
ssh -i ~/.ssh/id_rsa -L 8080:10.0.2.10:80 ubuntu@<INGRESS_IP>Open your browser to http://localhost:8080 and log in with username admin and the retrieved password.
The infrastructure consists of:
- VCN with public (10.0.1.0/24) and private (10.0.2.0/24) subnets
- Three ARM Ampere A1 instances running K3s
- OCI Vault for runtime secret storage
- GitHub OIDC provider for CI/CD authentication
- ArgoCD managing GitOps deployments
fabianpiper.com/
├── components/terraform/ # Atmos component wrappers
│ ├── networking/ # VCN, subnets, security lists
│ ├── iam/ # Dynamic groups and policies
│ ├── vault/ # OCI Vault and stored secrets
│ ├── oidc/ # GitHub OIDC provider
│ └── cluster/ # K3s instances and cloud-init
├── modules/ # Terraform module implementations
├── stacks/ # Atmos stack configurations
│ ├── orgs/glg/prod/fra.yaml # Production deployment config
│ ├── mixins/ # Reusable configuration snippets
│ └── workflows/ # Multi-component workflows
├── kubernetes/ # GitOps manifests
│ ├── bootstrap/ # ArgoCD installation and root app
│ │ ├── root.yaml # Single entry point
│ │ ├── templates/ # ApplicationSets
│ │ └── argocd/ # ArgoCD manifests
│ ├── infrastructure/ # Platform services
│ └── apps/ # Application deployments
├── apps/www/ # Website source code
├── secrets/prod/ # SOPS-encrypted secrets
└── .github/workflows/ # CI/CD automation
The automated deployment flow:
- Code changes pushed to
mainbranch - GitHub Actions workflow triggered
- Docker image built and pushed to GHCR
- ArgoCD Image Updater detects new image digest
- ArgoCD automatically syncs and deploys updated application
Important
Only one GitHub secret is required: SOPS_AGE_KEY for infrastructure modifications.
Start the local development server:
make dev-wwwBuild production bundle:
make build-wwwBuild Docker image:
make docker-build-prod-wwwmake plan-prod-all # Review planned changes for all components
make apply-prod-networking # Deploy VCN and subnets
make apply-prod-iam # Deploy IAM policies
make apply-prod-vault # Deploy OCI Vault
make apply-prod-oidc # Deploy OIDC provider
make apply-prod-cluster # Deploy K3s clustermake sops-encrypt-prod # Encrypt secrets before committing
make sops-decrypt-prod # Decrypt secrets for editingmake destroy-prod-all # Destroy all infrastructure componentsFor detailed operational procedures and agent-friendly instructions, refer to AGENTS.md.
This project is licensed under the MIT License. See the LICENSE file for details.