4 Commits

Author SHA1 Message Date
wujiawei
f0fd22ccd4 【fix】1.3.1-JDK17-SNAPSHOT 2025-05-03 10:41:36 +08:00
wujiawei
2389a25e11 【fix】 优化使用 EventLoopGroup bossGroup = EventLoopGroupFactory.createBossGroup();
EventLoopGroup workerGroup = EventLoopGroupFactory.createWorkerGroup();
2025-02-18 17:21:00 +08:00
wujiawei
cf10347939 【fix】 控制mysql占用内存在150mb左右 2025-02-11 11:26:48 +08:00
wujiawei
98b4701978 This is a Kubernetes configuration file that defines several resources, including:
1. A Pod named `mysql` in the `default` namespace.
2. A Service named `mysql` in the `default` namespace that exposes the Pod's port 3306 and provides a persistent volume for the database data.
3. An Ingress resource that routes incoming requests to the `mysql` service.

The configuration also defines several environment variables, including:

1. `MYSQL_CNF`: a ConfigMap containing a MySQL configuration file (`cnf`) with various settings such as `sql_mode`, `log_timestamps`, and `slow_query_log`.

Here is an annotated version of the configuration:

**Pod:**
```yaml
apiVersion: v1
kind: Pod
metadata:
  name: mysql
spec:
  containers:
  - name: mysql
    image: your-mysql-image
    env:
    - name: MYSQL_CNF
      valueFrom:
        configMapKeyRef:
          name: mysql-cnf
          key: cnf
```
This Pod runs a container with the `your-mysql-image` and uses the `MYSQL_CNF` environment variable to set the MySQL configuration.

**Service:**
```yaml
apiVersion: v1
kind: Service
metadata:
  name: mysql
spec:
  selector:
    app: mysql
  ports:
  - name: mysql
    port: 3306
    targetPort: 3306
  persistentVolumeClaim:
    claimName: mysql-pvc
```
This Service exposes the `mysql` container's port 3306 and provides a persistent volume (`mysql-pvc`) for the database data.

**Ingress:**
```yaml
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: mysql-ingress
spec:
  rules:
  - host: your-ingress-hostname.com
    http:
      paths:
      - path: /
        backend:
          serviceName: mysql
          servicePort: 3306
```
This Ingress resource routes incoming requests to the `mysql` Service's port 3306.

**ConfigMap:**
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: mysql-cnf
data:
  cnf: |
    [mysql]
    no-auto-rehash

    [mysqld]
    skip-host-cache
    skip-name-resolve
    max_connections=1000
    lower_case_table_names=0
    default-time-zone='+08:00'
    sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
    log_timestamps='SYSTEM'

    binlog_expire_logs_seconds = 2
    innodb_flush_log_at_trx_commit=2
    group_concat_max_len=1024
```
This ConfigMap contains the MySQL configuration file (`cnf`) with various settings and values.
2025-02-11 10:15:48 +08:00