|
| 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 | + |
| 15 | + rootPasswordSecretKeyRef: |
| 16 | + name: mariadb |
| 17 | + key: mariadb-root-password |
| 18 | + username: mariadb |
| 19 | + passwordSecretKeyRef: |
| 20 | + name: mariadb |
| 21 | + key: mariadb-root-password |
| 22 | + database: mariadb |
| 23 | + |
| 24 | + image: docker.io/library/mariadb:11.4.5 |
| 25 | + imagePullPolicy: IfNotPresent |
| 26 | + imagePullSecrets: |
| 27 | + - name: dockerhub-secret |
| 28 | + |
| 29 | + storage: |
| 30 | + size: 100Gi |
| 31 | + storageClassName: rook-ceph-block |
| 32 | + |
| 33 | + connection: |
| 34 | + secretName: connection-mariadb |
| 35 | + secretTemplate: |
| 36 | + key: dsn |
| 37 | + healthCheck: |
| 38 | + interval: 10s |
| 39 | + retryInterval: 3s |
| 40 | + params: |
| 41 | + parseTime: "true" |
| 42 | + |
| 43 | + myCnf: | |
| 44 | + [mariadb] |
| 45 | + bind-address=* |
| 46 | + skip-name-resolve |
| 47 | + connect_timeout=30 |
| 48 | + wait_timeout=28800 |
| 49 | + interactive_timeout=28800 |
| 50 | + net_read_timeout=60 |
| 51 | + net_write_timeout=60 |
| 52 | + max_connections=500 |
| 53 | + max_allowed_packet=64M |
| 54 | + thread_cache_size=100 |
| 55 | + table_open_cache=2048 |
| 56 | + open_files_limit=65535 |
| 57 | + default_storage_engine=InnoDB |
| 58 | + binlog_format=row |
| 59 | + innodb_autoinc_lock_mode=2 |
| 60 | + innodb_buffer_pool_size=1024M |
| 61 | +
|
| 62 | + livenessProbe: |
| 63 | + exec: |
| 64 | + command: |
| 65 | + - bash |
| 66 | + - -c |
| 67 | + - mysqladmin ping -u root -p"$MARIADB_ROOT_PASSWORD" --silent |
| 68 | + periodSeconds: 10 |
| 69 | + timeoutSeconds: 5 |
| 70 | + |
| 71 | + readinessProbe: |
| 72 | + exec: |
| 73 | + command: |
| 74 | + - bash |
| 75 | + - -c |
| 76 | + - > |
| 77 | + mariadb -u root -p"$MARIADB_ROOT_PASSWORD" -e " |
| 78 | + SHOW STATUS LIKE 'wsrep_ready'; |
| 79 | + SHOW STATUS LIKE 'wsrep_local_state_comment';" | |
| 80 | + grep -q 'ON' && grep -q 'Synced' |
| 81 | + periodSeconds: 10 |
| 82 | + timeoutSeconds: 5 |
| 83 | + |
| 84 | + service: |
| 85 | + type: ClusterIP |
| 86 | + primaryService: |
| 87 | + type: LoadBalancer |
| 88 | + metadata: |
| 89 | + annotations: |
| 90 | + metallb.universe.tf/address-pool: openvpndb |
| 91 | + loadBalancerIP: 139.229.144.10 |
| 92 | + secondaryService: |
| 93 | + type: ClusterIP |
| 94 | + |
| 95 | + affinity: |
| 96 | + podAntiAffinity: |
| 97 | + requiredDuringSchedulingIgnoredDuringExecution: |
| 98 | + - labelSelector: |
| 99 | + matchLabels: |
| 100 | + app.kubernetes.io/name: mariadb |
| 101 | + topologyKey: kubernetes.io/hostname |
| 102 | + topologySpreadConstraints: |
| 103 | + - maxSkew: 1 |
| 104 | + topologyKey: kubernetes.io/hostname |
| 105 | + whenUnsatisfiable: DoNotSchedule |
| 106 | + labelSelector: |
| 107 | + matchLabels: |
| 108 | + app.kubernetes.io/name: mariadb |
| 109 | + |
| 110 | + podDisruptionBudget: |
| 111 | + minAvailable: 2 |
| 112 | + |
| 113 | + terminationGracePeriodSeconds: 180 |
| 114 | + |
| 115 | + podSecurityContext: |
| 116 | + runAsUser: 0 |
| 117 | + securityContext: |
| 118 | + allowPrivilegeEscalation: false |
| 119 | + |
| 120 | + metrics: |
| 121 | + enabled: true |
0 commit comments