A hands-on project to learn Flux CD on GKE: GitOps-style deployment of WordPress using Kustomization, HelmReleases, and OCI Helm charts.
- Flux – GitOps with GitRepository, Kustomization, and HelmRelease
- OCI Helm – Using Bitnami OCI charts
- Kustomize – Organizing clusters, infrastructure, and applications
- WordPress on Kubernetes – Bitnami WordPress + MariaDB on GKE
WordPress uses MariaDB
┌─────────────────────────────────────────────────────────────────────┐
│ GKE Cluster │
│ │
│ GitHub Repo │
│ │ │
│ ▼ │
│ ┌─────────────┐ ┌──────────────────┐ ┌───────────────┐ │
│ │ Flux │────▶│ Kustomization │────▶│ HelmReleases │ │
│ │ GitRepository │ infrastructure │ │ wordpress │ │
│ └─────────────┘ │ applications │ │ (Bitnami) │ │
│ │ └──────────────────┘ └───────┬───────┘ │
│ │ │ │ │
│ │ │ ▼ │
│ │ │ ┌─────────────────┐ │
│ │ │ │ WordPress │ │
│ │ │ │ + MariaDB │ │
│ │ │ │ (Bitnami) │ │
│ │ │ └─────────────────┘ │
└─────────┼───────────────────────────────────────────────────────────┘
│
▼
GitHub Repo
.
├── clusters/
│ └── production/
│ ├── kustomization.yaml
│ ├── infrastructure.yaml
│ ├── applications.yaml
│ └── flux-system/
├── infrastructure/
│ ├── namespace-wordpress.yaml
│ └── sources/
├── applications/
│ └── wordpress/
│ ├── kustomization.yaml
│ └── helmrelease.yaml
└── README.md
- GKE cluster – Create one or use an existing sandbox
- gcloud –
gcloud container clusters get-credentials ... - kubectl –
kubectl get nodes - flux CLI – Install Flux
- GitHub token – For
flux bootstrap(repo access)
# Clone this repo
git clone https://github.com/gma1k/flux-helm-wp.git
cd flux-helm-wp
# Connect to your GKE cluster
gcloud container clusters get-credentials YOUR_CLUSTER --region YOUR_REGION
kubectl get nodesThis installs Flux and points it at this repository.
flux bootstrap github \
--owner=GitUser \
--repository=flux-helm-wp \
--branch=main \
--path=clusters/production \
--personalWhen prompted, authenticate with GitHub (browser or token).
# See Kustomizations reconcile
flux get kustomizations -A
# See HelmReleases (WordPress + MariaDB)
flux get helmreleases -A
# Watch pods in the wordpress namespace
kubectl get pods -n wordpress -wWait until WordPress and MariaDB pods are Running and 1/1 Ready (usually 2–3 minutes).
Option A – LoadBalancer (if exposed by the chart):
kubectl get svc -n wordpress
# Use EXTERNAL-IP in browser, e.g. http://<EXTERNAL-IP>Option B – Port-forward (recommended for local access):
kubectl port-forward -n wordpress svc/wordpress 8080:80
# Open http://localhost:8080Default credentials (see applications/wordpress/helmrelease.yaml):
- Username:
admin - Password:
admin - Email:
admin@example.com
Edit applications/wordpress/helmrelease.yaml, e.g.:
wordpressPassword: my-new-passwordThen:
git add -A
git commit -m "Update WordPress password"
git push origin main
# Trigger Flux to reconcile
flux reconcile source git flux-system
flux reconcile kustomization applications# See what Flux is managing
flux get kustomizations
flux get helmreleases -A
# Inspect the Helm release
helm list -n wordpress# Pause automatic updates
flux suspend kustomization applications
# Resume
flux resume kustomization applicationsIn applications/wordpress/helmrelease.yaml:
chart:
spec:
chart: wordpress
version: "27.0.0" # Try a different versionPush to Git and reconcile as in step 1.
| Component | Namespace | Description |
|---|---|---|
| WordPress | wordpress | Bitnami WordPress chart |
| MariaDB | wordpress | Bitnami MariaDB – WordPress database |
| What to change | File |
|---|---|
| WordPress/MariaDB creds | applications/wordpress/helmrelease.yaml |
| Storage size | applications/wordpress/helmrelease.yaml → persistence.size |
| Chart version | applications/wordpress/helmrelease.yaml → chart.spec.version |
For production, move passwords into Kubernetes Secrets and reference them via existingSecret in the Helm values.
# Flux reconciliation
flux reconcile source git flux-system
flux reconcile kustomization infrastructure
flux reconcile kustomization applications
# Status
flux get kustomizations -A
flux get helmreleases -A
# Pods and logs
kubectl get pods -n wordpress
kubectl logs -n wordpress -l app.kubernetes.io/name=wordpress -fMIT