44 lines
895 B
Markdown
44 lines
895 B
Markdown
|
|
# FluxCD System Configuration
|
||
|
|
|
||
|
|
This directory contains FluxCD configuration for GitOps.
|
||
|
|
|
||
|
|
## Setup
|
||
|
|
|
||
|
|
1. **Install FluxCD** (done automatically by Ansible):
|
||
|
|
```bash
|
||
|
|
flux install --namespace=flux-system
|
||
|
|
```
|
||
|
|
|
||
|
|
2. **Create Forgejo credentials secret**:
|
||
|
|
```bash
|
||
|
|
kubectl create secret generic forgejo-credentials \
|
||
|
|
--namespace=flux-system \
|
||
|
|
--from-literal=username=git \
|
||
|
|
--from-literal=password=YOUR_FORGEJO_TOKEN
|
||
|
|
```
|
||
|
|
|
||
|
|
3. **Update GitRepository URL** in `gotk-sync.yaml`:
|
||
|
|
```yaml
|
||
|
|
url: https://forgejo.your-domain.com/your-org/infra.git
|
||
|
|
```
|
||
|
|
|
||
|
|
4. **Apply FluxCD configuration**:
|
||
|
|
```bash
|
||
|
|
kubectl apply -k kubernetes/flux-system/
|
||
|
|
```
|
||
|
|
|
||
|
|
## Monitoring
|
||
|
|
|
||
|
|
Check FluxCD status:
|
||
|
|
```bash
|
||
|
|
flux get sources git
|
||
|
|
flux get kustomizations
|
||
|
|
flux logs
|
||
|
|
```
|
||
|
|
|
||
|
|
Force reconciliation:
|
||
|
|
```bash
|
||
|
|
flux reconcile source git infra-repo
|
||
|
|
flux reconcile kustomization apps --with-source
|
||
|
|
```
|