feat(infrastructure): add cloudflare, argocd

This commit is contained in:
2025-09-22 18:51:52 +02:00
parent ec3017929e
commit 5de64c5b1f
19 changed files with 340 additions and 23 deletions

View File

@@ -1,4 +1,4 @@
apiVersion: v2
name: maxscale-helm
version: 0.1.9
version: 1.0.2
description: Helm chart for MaxScale related Kubernetes manifests

View File

@@ -0,0 +1,14 @@
apiVersion: networking.cfargotunnel.com/v1alpha1
kind: TunnelBinding
metadata:
name: maxscale-tunnel-binding
namespace: mariadb-operator
subjects:
- name: mariadb-repl-maxscale
spec:
target: https://mariadb-repl-maxscale-internal.mariadb-operator.svc.cluster.local:8989
fqdn: maxscale.{{ .Values.base_domain }}
noTlsVerify: true
tunnelRef:
kind: ClusterTunnel
name: cluster-tunnel

View File

@@ -10,23 +10,23 @@ data:
echo "
/* Maximum number of databases displayed on one page */
$cfg['MaxDbList'] = 300;
$cfg['MaxNavigationItems'] = 300;
\$cfg['MaxDbList'] = 300;
\$cfg['MaxNavigationItems'] = 300;
/* Additional servers */
$servers = [
\$servers = [
{{- range $i, $e := until (int (3)) }}
'mariadb-repl-{{ $i }}',
{{- end }}
];
foreach ($servers as $server) {
$i++;
foreach (\$servers as \$server) {
\$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'cookie';
\$cfg['Servers'][\$i]['auth_type'] = 'cookie';
/* Server parameters */
$cfg['Servers'][$i]['host'] = $server;
$cfg['Servers'][$i]['port'] = '3306';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;
\$cfg['Servers'][\$i]['host'] = \$server;
\$cfg['Servers'][\$i]['port'] = '3306';
\$cfg['Servers'][\$i]['compress'] = false;
\$cfg['Servers'][\$i]['AllowNoPassword'] = false;
}
" >> /opt/bitnami/phpmyadmin/config.inc.php
{{- end }}

View File

@@ -0,0 +1,14 @@
apiVersion: networking.cfargotunnel.com/v1alpha1
kind: TunnelBinding
metadata:
name: phpmyadmin-tunnel-binding
namespace: mariadb-operator
subjects:
- name: mariadb-repl-maxscale
spec:
target: http://phpmyadmin.mariadb-operator.svc.cluster.local:8080
fqdn: mysql.{{ .Values.base_domain }}
noTlsVerify: true
tunnelRef:
kind: ClusterTunnel
name: cluster-tunnel

View File

@@ -13,3 +13,5 @@ metallb:
phpmyadmin:
enabled: true
base_domain: example.com

View File

@@ -58,7 +58,7 @@ resource "helm_release" "mariadb-operator" {
resource "helm_release" "maxscale_helm" {
name = "maxscale-helm"
chart = "${path.module}/charts/maxscale-helm"
version = "0.1.9"
version = "1.0.2"
depends_on = [ helm_release.mariadb-operator-crds, kubectl_manifest.secrets ]
timeout = 3600
@@ -70,5 +70,6 @@ resource "helm_release" "maxscale_helm" {
{ name = "metallb.primary_ip", value = var.primary_ip },
{ name = "metallb.secondary_ip", value = var.secondary_ip },
{ name = "phpmyadmin.enabled", value = tostring(var.phpmyadmin_enabled) },
{ name = "base_domain", value = var.cloudflare_domain }
]
}

View File

@@ -50,3 +50,9 @@ variable "mariadb_user_password" {
type = string
sensitive = true
}
variable "cloudflare_domain" {
type = string
default = "Base cloudflare domain, e.g. example.com"
nullable = false
}