apiVersion: v1 kind: ConfigMap metadata: name: {{.Release.Name}}-nginx-config data: default.conf: | server { listen 8080; server_name {{ if .Values.ingress.enabled }}{{ (index .Values.ingress.hosts 0).host }}{{ else }}_{{ end }}; client_max_body_size 50m; root /app/dist; index index.html; location / { try_files $uri $uri/ /index.html; } location /health { return 200 "ok"; } location /app/uploads/ { alias /app/uploads/; autoindex off; access_log off; expires 30d; add_header Cache-Control "public, must-revalidate"; try_files $uri $uri/ =404; } location /api/ { proxy_pass http://{{.Release.Name}}-backend.{{.Release.Namespace}}.svc.cluster.local/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Authorization $http_authorization; proxy_set_header X-Forwarded-Proto $scheme; } } --- apiVersion: v1 kind: ConfigMap metadata: name: {{.Release.Name}}-application-config data: application.yml: | server: port: {{ .Values.backend.service.port }} tomcat: threads: max: 50 min-spare: 5 jwt: secret: ${JWT_SECRET} issuer: ${JWT_ISSUER} subject: ${JWT_SUBJECT} expire: ${JWT_EXPIRE} upload: dir: ${UPLOAD_DIR} spring: servlet: multipart: max-file-size: 50MB datasource: driver-class-name: org.postgresql.Driver url: jdbc:postgresql://{{.Release.Name}}-postgresql.{{.Release.Namespace}}.svc.cluster.local:5432/postgres username: ${DB_USER_NAME} password: ${DB_USER_PWD} hikari: maximum-pool-size: 5 minimum-idle: 2 jackson: time-zone: Asia/Shanghai date-format: yyyy-MM-dd HH:mm:ss mail: protocol: smtps port: ${MAIL_PORT} default-encoding: utf-8 host: ${MAIL_HOST} username: ${MAIL_USERNAME} password: ${MAIL_USER_PWD} properties: mail: smtp: auth: true ssl: enable: true required: true protocols: TLSv1.2 connectiontimeout: 5000 timeout: 5000 writetimeout: 5000 debug: true mybatis-plus: global-config: db-config: table-prefix: "" id-type: auto configuration: map-underscore-to-camel-case: false log-impl: org.apache.ibatis.logging.stdout.StdOutImpl logging: level: org: springframework: security: DEBUG --- apiVersion: v1 kind: ConfigMap metadata: name: blog-db-sql data: init.sql: | SET client_min_messages TO warning; CREATE TABLE "articles" ( "id" bigserial, "title" varchar(50) NOT NULL, "cover" varchar(255) DEFAULT '{{.Values.web.default.cover}}', "content" text, "published" date DEFAULT CURRENT_DATE, PRIMARY KEY ("id") ); CREATE TABLE "news" ( "id" bigserial, "title" varchar(50) NOT NULL, "cover" varchar(255) DEFAULT '{{.Values.web.default.cover}}', "content" text, "published" date DEFAULT CURRENT_DATE, "related" varchar(255), PRIMARY KEY ("id") ); CREATE TABLE "users" ( "id" bigserial, "name" varchar(50) NOT NULL, "profile" varchar(255) NOT NULL DEFAULT '{{.Values.web.default.avatar}}', "account" varchar(255) NOT NULL UNIQUE, "password" varchar(255) NOT NULL, "ip" varchar(50), PRIMARY KEY ("id") ); CREATE TABLE "comments" ( "id" bigserial, "content" varchar(255) NOT NULL, "published" date DEFAULT CURRENT_DATE, "u_id" int8, "a_id" int8 NOT NULL, PRIMARY KEY ("id"), CONSTRAINT fk_comments_articles FOREIGN KEY ("a_id") REFERENCES "articles" ("id"), CONSTRAINT fk_comments_users FOREIGN KEY ("u_id") REFERENCES "users" ("id") );