Install Joomla with bitnami helm chart (with flux). The setup is required to handle different clusters. Therefore, the setup is in two parts: A general part for all clusters and a second part for settings unique for each cluster. Like load balancer IP or storage class.
Below show the file-structure and files for a GitHub repo 'red'. flux use a GitHub repo called 'red' and cluster 'test' is bootstrapped to the 'clusters/test' path. Path 'apps/base' include all general settings for all repositories (both staging and test in this case). So 'apps/base/joomla' and 'apps/base/metallb' include general settings for Joomla and metallb. Settings specify for each cluster is separated in the 'apps' folder. Like 'apps/test or 'apps/staging'. So 'app/test/joomla' include all specific (Joomla) settings for cluster 'test'. And likewise, with 'app/test/longhorn' for longhorn settings in cluster test. Not all directories and files are shown.
Showing flux GitHub bootstrapping with path 'cluster/test'
flux bootstrap github \
--owner=${GITHUB_USER} \
--repository=red \
--branch=main \
--personal \
--path=clusters/test
Directory structure and (selected) files.
red
├── README.md
├── apps
│ ├── base
│ │ ├── joomla
│ │ │ ├── kustomization.yaml (4)
│ │ │ ├── namespace.yaml (5)
│ │ │ ├── release.yaml (7)
│ │ │ └── repository.yaml (6)
│ │ ├── longhorn
│ │ ├── metallb
│ │ └── traefik
│ ├── staging
│ └── test
│ ├── joomla
│ │ ├── custom-values.yaml (3)
│ │ └── kustomization.yaml (2)
│ ├── longhorn
│ ├── metallb
│ └── traefik
└── clusters
├── staging
└── test
├── flux-system flux
├── joomla.yaml (1)
├── longhorn.yaml
├── metallb-base.yaml
├── metallb-system.yaml
└── traefik1.yaml
Start off with '/cluster/test/joomla.yaml (1)' Kustomization and create a GitRepository resource. This repo is pointing to './apps/test/joomla'. Directory 'apps/test/joomla' include joomla settings for cluster 'test'.
(1) joomla.yaml
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: joomla
namespace: flux-system
spec:
interval: 1m0s
sourceRef:
kind: GitRepository
name: flux-system
path: ./apps/test/joomla
prune: true
wait: true
timeout: 5m0s
Next up is 'apps/test/joomla/kustomization.yaml' (2). Below is a simple way to load the base configuration and overload this configuration with custom values. I.e., the 'resources' part below point to the base configuration and the 'patch' part is the overload for the base configuration. I.e., a patch. The resources listed in the 'resources' part, will run first.
(2) kustomization.yaml
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
metadata:
name: joomla-test
namespace: joomla
resources:
- ../../base/joomla
patches:
- path: custom-values.yaml
target:
kind: HelmRelease
Ignoring (3) custom-values.yaml for now.
Now the base configuration (4) '/apps/base/joomla/kustomization.yaml'. The base configuration is basically a simple list of resources for creating a namespace, repository and release.
(4) kustomization.yaml
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
metadata:
name: joomla-base
namespace: joomla
resources:
- namespace.yaml
- repository.yaml
- release.yaml
Creating the namespace.
(5) namespace.yaml
---
apiVersion: v1
kind: Namespace
metadata:
name: joomla
labels:
debug: joomla-base
Creating a helm repository for bitnami. This repo is a bit special, as the bitnami repo includes a lot of different charts. You can get the URL from https://artifacthub.io/packages/helm/bitnami/joomla.
(6) repository.yaml
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: HelmRepository
metadata:
name: joomla-repo
namespace: joomla
spec:
interval: 24h0m0s
url: https://charts.bitnami.com/bitnami
Finally, the release (For the base configuration). Helm releases can be created with "flux create hr" (https://fluxcd.io/flux/cmd/flux_create_helmrelease/).
Notice 'source': Is referring to the joomla repository just created (6). Also 'chart-version' has an option to use something like: ''--chart-version="<4.0.0"' I.e. not version 4.0.0 but anything before.
flux create helmrelease joomla \
--interval=15m \
--source=HelmRepository/joomla-repo \
--chart=joomla \
--chart-version="14.1.3" \
--release-name=joomla \
--target-namespace=joomla \
--export > joomla-release.yaml
(7) release.yaml
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: joomla
namespace: joomla
spec:
chart:
spec:
chart: joomla
reconcileStrategy: ChartVersion
sourceRef:
kind: HelmRepository
name: joomla-repo
version: 14.1.3
interval: 15m0s
releaseName: joomla
targetNamespace: joomla
# values:
Last step: Overloading the default installation with custom values for a specific cluster.
A lot of options have already been ticked off, then you install a helm chart. Some are fine as default and some you will need to change. They depend on the requirements for this specific installation or can be mandatory. For this specific bitnami chart 'joomlaPassword', 'mariadb.auth.rootPassword' and 'mariadb.auth.password' must not be empty.
Download the default values for the helm chart and go through what options this chart offers to customize. The default values for this chart can be found at Artifact Hub (https://artifacthub.io/packages/helm/bitnami/joomla).
(3) custom-values.yaml
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: joomla-customvalues
namespace: joomla
spec:
test:
enable: false
values:
joomlaUsername: "user"
##
joomlaPassword: "cGFzc3dvcmQ="
##
joomlaEmail: "This email address is being protected from spambots. You need JavaScript enabled to view it. "
##
persistence:
storageClass: "longhorn"
size: 2Gi
##
service:
loadBalancerIP: "192.168.10.60"
##
mariadb:
auth:
rootPassword: "cGFzc3dvcmQ="
database: joomla
##
username: lab
password: "cGFzc3dvcmQ="
##
primary:
persistence:
storageClass: "longhorn"
size: 1Gi
Fragrant blooms gathered,
Ordinary, until pierced,
Beauty finds its way.