| 
 | 1 | +apiVersion: k8s.mariadb.com/v1alpha1  | 
 | 2 | +kind: MariaDB  | 
 | 3 | +metadata:  | 
 | 4 | +  name: mariadb  | 
 | 5 | +  namespace: openvpn-db  | 
 | 6 | +spec:  | 
 | 7 | +  replicas: 3  | 
 | 8 | +  galera:  | 
 | 9 | +    enabled: true  | 
 | 10 | +    primary:  | 
 | 11 | +      podIndex: 0  | 
 | 12 | +      automaticFailover: true  | 
 | 13 | +    sst: mariabackup  | 
 | 14 | +  rootPasswordSecretKeyRef:  | 
 | 15 | +    name: mariadb  | 
 | 16 | +    key: mariadb-root-password  | 
 | 17 | +  username: mariadb  | 
 | 18 | +  passwordSecretKeyRef:  | 
 | 19 | +    name: mariadb  | 
 | 20 | +    key: mariadb-root-password  | 
 | 21 | +  database: mariadb  | 
 | 22 | +  image: docker.io/library/mariadb:11.4.5  | 
 | 23 | +  imagePullPolicy: IfNotPresent  | 
 | 24 | +  imagePullSecrets:  | 
 | 25 | +    - name: dockerhub-secret  | 
 | 26 | +  storage:  | 
 | 27 | +    size: 100Gi  | 
 | 28 | +    storageClassName: rook-ceph-block  | 
 | 29 | +  connection:  | 
 | 30 | +    secretName: connection-mariadb  | 
 | 31 | +    secretTemplate:  | 
 | 32 | +      key: dsn  | 
 | 33 | +    healthCheck:  | 
 | 34 | +      interval: 10s  | 
 | 35 | +      retryInterval: 3s  | 
 | 36 | +    params:  | 
 | 37 | +      parseTime: "true"  | 
 | 38 | +  myCnf: |  | 
 | 39 | +    [mariadb]  | 
 | 40 | +    bind-address=*  | 
 | 41 | +    default_storage_engine=InnoDB  | 
 | 42 | +    binlog_format=row  | 
 | 43 | +    innodb_autoinc_lock_mode=2  | 
 | 44 | +    innodb_buffer_pool_size=1024M  | 
 | 45 | +    max_allowed_packet=256M  | 
 | 46 | +    [galera]  | 
 | 47 | +    wsrep_on=ON  | 
 | 48 | +    wsrep_provider=/usr/lib/galera/libgalera_smm.so  | 
 | 49 | +    wsrep_cluster_name=mariadb-galera  | 
 | 50 | +    wsrep_sst_method=mariabackup  | 
 | 51 | +    wsrep_cluster_address=gcomm://mariadb-galera.openvpn-db.svc.cluster.local  | 
 | 52 | +  resources:  | 
 | 53 | +    requests:  | 
 | 54 | +      cpu: 100m  | 
 | 55 | +      memory: 128Mi  | 
 | 56 | +    limits:  | 
 | 57 | +      cpu: 500m  | 
 | 58 | +      memory: 1Gi  | 
 | 59 | +  env:  | 
 | 60 | +    - name: MARIADB_ROOT_PASSWORD  | 
 | 61 | +      valueFrom:  | 
 | 62 | +        secretKeyRef:  | 
 | 63 | +          name: mariadb  | 
 | 64 | +          key: mariadb-root-password  | 
 | 65 | +  podSecurityContext:  | 
 | 66 | +    runAsUser: 0  | 
 | 67 | +  securityContext:  | 
 | 68 | +    allowPrivilegeEscalation: false  | 
 | 69 | +  livenessProbe:  | 
 | 70 | +    exec:  | 
 | 71 | +      command: ["bash", "-c", 'mariadb -u root -p"$MARIADB_ROOT_PASSWORD" -e "SELECT 1;"']  | 
 | 72 | +    periodSeconds: 10  | 
 | 73 | +    timeoutSeconds: 5  | 
 | 74 | +  readinessProbe:  | 
 | 75 | +    exec:  | 
 | 76 | +      command: ["bash", "-c", 'mariadb -u root -p"$MARIADB_ROOT_PASSWORD" -e "SELECT 1;"']  | 
 | 77 | +    periodSeconds: 10  | 
 | 78 | +    timeoutSeconds: 5  | 
 | 79 | +  startupProbe:  | 
 | 80 | +    exec:  | 
 | 81 | +      command: ["bash", "-c", 'mariadb -u root -p"$MARIADB_ROOT_PASSWORD" -e "SELECT 1;"']  | 
 | 82 | +    failureThreshold: 30  | 
 | 83 | +    periodSeconds: 10  | 
 | 84 | +    timeoutSeconds: 5  | 
 | 85 | +  podDisruptionBudget:  | 
 | 86 | +    maxUnavailable: 50%  | 
 | 87 | +  updateStrategy:  | 
 | 88 | +    type: ReplicasFirstPrimaryLast  | 
 | 89 | +  service:  | 
 | 90 | +    type: LoadBalancer  | 
 | 91 | +    metadata:  | 
 | 92 | +      annotations:  | 
 | 93 | +        metallb.universe.tf/address-pool: openvpndb  | 
 | 94 | +    loadBalancerIP: 139.229.134.140  | 
 | 95 | +  primaryService:  | 
 | 96 | +    type: LoadBalancer  | 
 | 97 | +    metadata:  | 
 | 98 | +      annotations:  | 
 | 99 | +        metallb.universe.tf/address-pool: openvpndb  | 
 | 100 | +    loadBalancerIP: 139.229.134.145  | 
 | 101 | +  secondaryService:  | 
 | 102 | +    type: LoadBalancer  | 
 | 103 | +    metadata:  | 
 | 104 | +      annotations:  | 
 | 105 | +        metallb.universe.tf/address-pool: openvpndb  | 
 | 106 | +    loadBalancerIP: 139.229.134.146  | 
 | 107 | +  affinity:  | 
 | 108 | +    podAntiAffinity:  | 
 | 109 | +      preferredDuringSchedulingIgnoredDuringExecution:  | 
 | 110 | +        - weight: 100  | 
 | 111 | +          podAffinityTerm:  | 
 | 112 | +            labelSelector:  | 
 | 113 | +              matchLabels:  | 
 | 114 | +                app.kubernetes.io/name: mariadb  | 
 | 115 | +            topologyKey: kubernetes.io/hostname  | 
 | 116 | +  metrics:  | 
 | 117 | +    enabled: true  | 
 | 118 | +  suspend: false  | 
0 commit comments