Some checks failed
Test / test (push) Has been cancelled
Co-authored-by: Cursor <cursoragent@cursor.com>
2.7 KiB
2.7 KiB
GitOps Configuration
This directory contains GitOps manifests for Flux to manage infrastructure and applications.
Structure
gitops/
├── infrastructure/ # Base infrastructure (namespaces, RBAC, etc.)
└── apps/ # Application deployments
├── besu/
├── firefly/
├── chainlink/
├── blockscout/
├── cacti/
└── nginx-proxy/
Setup Instructions
Prerequisites
- Gitea must be configured and accessible
- Flux must be installed in the K3s cluster
- Git repository must be created in Gitea
Steps
-
Create Git Repository in Gitea:
- Access Gitea: http://192.168.1.121:3000
- Create new repository:
gitops - Initialize with README
-
Push GitOps Manifests:
git clone http://192.168.1.121:3000/hc-stack/gitops.git cd gitops # Copy manifests from this directory git add . git commit -m "Initial GitOps configuration" git push -
Configure Flux GitRepository:
ssh ubuntu@192.168.1.188 export KUBECONFIG=/etc/rancher/k3s/k3s.yaml # Create GitRepository sudo kubectl apply -f - <<EOF apiVersion: source.toolkit.fluxcd.io/v1beta2 kind: GitRepository metadata: name: gitops-repo namespace: flux-system spec: interval: 1m url: http://192.168.1.121:3000/hc-stack/gitops.git ref: branch: main EOF -
Create Kustomizations:
# Infrastructure Kustomization sudo kubectl apply -f - <<EOF apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: name: infrastructure namespace: flux-system spec: interval: 5m path: ./infrastructure prune: true sourceRef: kind: GitRepository name: gitops-repo EOF # Applications Kustomization sudo kubectl apply -f - <<EOF apiVersion: kustomize.toolkit.fluxcd.io/v1 kind: Kustomization metadata: name: applications namespace: flux-system spec: interval: 5m path: ./apps prune: true sourceRef: kind: GitRepository name: gitops-repo EOF -
Monitor Reconciliation:
sudo kubectl get gitrepository -n flux-system sudo kubectl get kustomization -n flux-system sudo kubectl logs -n flux-system -l app=kustomize-controller -f
Notes
-
If Gitea requires authentication, create a secret:
sudo kubectl create secret generic gitops-repo-auth \ --from-literal=username=<username> \ --from-literal=password=<token> \ -n flux-systemThen update GitRepository to reference the secret:
spec: secretRef: name: gitops-repo-auth