Kubernetes部署luckysheet在线表格系统2-postgresql

  sre




🚀Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。
文档
docker-compose.yml
在线例子
luckysheet系列

Kubernetes部署luckysheet在线表格系统1-redis
Kubernetes部署luckysheet在线表格系统2-postgresql
Kubernetes部署luckysheet在线表格系统3-java web server
Kubernetes部署luckysheet在线表格系统4-前端页面
Kubernetes部署luckysheet在线表格系统5-nginx配置

postgres on kubernetes

pvc luckysheet-postgresql-pvc

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: luckysheet-postgresql-pvc
  namespace: sre
spec:
  accessModes:
  - ReadWriteMany
  resources:
    requests:
      storage: "250Gi"
  volumeName: 
  storageClassName: nfs


dp luckysheet-postgresql

apiVersion: apps/v1
kind: Deployment
metadata:
  name: luckysheet-postgresql
  namespace: sre
  labels:
    name: postgresql-luckysheet
spec:
  selector:
    matchLabels:
      name: postgresql-luckysheet
  template:
    metadata:
      name: postgresql
      labels:
        name: postgresql-luckysheet
    spec:
      containers:
      - name: postgresql
        image: registry.cn-hangzhou.aliyuncs.com/sre_pub/postgresql:10
        #image: sameersbn/postgresql:10
        imagePullPolicy: IfNotPresent
        env:
        - name: DB_USER
          value: luckysheet
        - name: DB_PASS
          value: '123456'
        - name: DB_NAME
          value: luckysheet
        - name: DB_EXTENSION
          value: pg_trgm
        ports:
        - name: postgres
          containerPort: 5432
        volumeMounts:
        - mountPath: /var/lib/postgresql
          name: data
        livenessProbe:
          exec:
            command:
            - pg_isready
            - -h
            - localhost
            - -U
            - postgres
          initialDelaySeconds: 30
          timeoutSeconds: 5
        readinessProbe:
          exec:
            command:
            - pg_isready
            - -h
            - localhost
            - -U
            - postgres
          initialDelaySeconds: 5
          timeoutSeconds: 1
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: luckysheet-postgresql-pvc


svc luckysheet-postgresql

apiVersion: v1
kind: Service
metadata:
  name: luckysheet-postgresql
  namespace: sre
  labels:
    name: postgresql-luckysheet
    namespace: sre
spec:
  type: NodePort
  ports:
    - name: postgres
      port: 5432
      nodePort: 30009
      targetPort: postgres
  selector:
    name: postgresql-luckysheet


sql

Create database

CREATE DATABASE luckysheet

Create sequence

DROP SEQUENCE IF EXISTS "public"."luckysheet_id_seq";
CREATE SEQUENCE "public"."luckysheet_id_seq"
INCREMENT 1
MINVALUE  1
MAXVALUE 9999999999999
START 1
CACHE 10;

Create table

DROP TABLE IF EXISTS "public"."luckysheet";
CREATE TABLE "luckysheet" (
  "id" int8 NOT NULL,
  "block_id" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "index" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "list_id" varchar(200) COLLATE "pg_catalog"."default" NOT NULL,
  "status" int2 NOT NULL,
  "json_data" jsonb,
  "order" int2,
  "is_delete" int2
);
CREATE INDEX "block_id" ON "public"."luckysheet" USING btree (
  "block_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "list_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "index" ON "public"."luckysheet" USING btree (
  "index" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "list_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "is_delete" ON "public"."luckysheet" USING btree (
  "is_delete" "pg_catalog"."int2_ops" ASC NULLS LAST
);
CREATE INDEX "list_id" ON "public"."luckysheet" USING btree (
  "list_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST
);
CREATE INDEX "order" ON "public"."luckysheet" USING btree (
  "list_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "order" "pg_catalog"."int2_ops" ASC NULLS LAST
);
CREATE INDEX "status" ON "public"."luckysheet" USING btree (
  "list_id" COLLATE "pg_catalog"."default" "pg_catalog"."text_ops" ASC NULLS LAST,
  "status" "pg_catalog"."int2_ops" ASC NULLS LAST
);
ALTER TABLE "public"."luckysheet" ADD CONSTRAINT "luckysheet_pkey" PRIMARY KEY ("id");

Insert initialization statement

INSERT INTO "public"."luckysheet" VALUES (nextval('luckysheet_id_seq'), 'fblock', '1', '1079500#-8803#7c45f52b7d01486d88bc53cb17dcd2c3', 1, '{"row":84,"name":"Sheet1","chart":[],"color":"","index":"1","order":0,"column":60,"config":{},"status":0,"celldata":[],"ch_width":4748,"rowsplit":[],"rh_height":1790,"scrollTop":0,"scrollLeft":0,"visibledatarow":[],"visibledatacolumn":[],"jfgird_select_save":[],"jfgrid_selection_range":{}}', 0, 0);
INSERT INTO "public"."luckysheet" VALUES (nextval('luckysheet_id_seq'), 'fblock', '2', '1079500#-8803#7c45f52b7d01486d88bc53cb17dcd2c3', 0, '{"row":84,"name":"Sheet2","chart":[],"color":"","index":"2","order":1,"column":60,"config":{},"status":0,"celldata":[],"ch_width":4748,"rowsplit":[],"rh_height":1790,"scrollTop":0,"scrollLeft":0,"visibledatarow":[],"visibledatacolumn":[],"jfgird_select_save":[],"jfgrid_selection_range":{}}', 1, 0);
INSERT INTO "public"."luckysheet" VALUES (nextval('luckysheet_id_seq'), 'fblock', '3', '1079500#-8803#7c45f52b7d01486d88bc53cb17dcd2c3', 0, '{"row":84,"name":"Sheet3","chart":[],"color":"","index":"3","order":2,"column":60,"config":{},"status":0,"celldata":[],"ch_width":4748,"rowsplit":[],"rh_height":1790,"scrollTop":0,"scrollLeft":0,"visibledatarow":[],"visibledatacolumn":[],"jfgird_select_save":[],"jfgrid_selection_range":{}}', 2, 0);

4 thoughts on - Kubernetes部署luckysheet在线表格系统2-postgresql

LEAVE A COMMENT

Captcha Code