infra/old/cluster/wavelog/wavelog-config-job.yaml

56 lines
No EOL
1.6 KiB
YAML

apiVersion: batch/v1
kind: Job
metadata:
name: wavelog-configure
namespace: wavelog
spec:
template:
spec:
restartPolicy: Never
containers:
- name: configure
image: ghcr.io/wavelog/wavelog:latest
command: ["/bin/bash", "-c"]
args:
- |
set -e
echo "Creating Wavelog configuration files..."
# Create database.php
cat > /config/database.php <<'EOF'
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$active_group = 'default';
$query_builder = TRUE;
$db['default'] = array(
'dsn' => '',
'hostname' => 'mariadb.data.svc.cluster.local',
'username' => 'wavelog',
'password' => 's7hDEobNpX08UQxewlSLyrMGjbdnIcuw',
'database' => 'wavelog',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => FALSE,
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8mb4',
'dbcollat' => 'utf8mb4_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
EOF
echo "Configuration complete!"
volumeMounts:
- name: wavelog-data
mountPath: /config
subPath: config
volumes:
- name: wavelog-data
persistentVolumeClaim:
claimName: wavelog-data