Skip to content

Commit 84b8e63

Browse files
authored
Merge pull request #22 from radondb/V3.0.0-resolve-conflicts
V3.0.0 resolve conflicts
2 parents 01a4a14 + 365b24a commit 84b8e63

38 files changed

+1307
-251
lines changed

.document/images/logo_radondb.png

65.4 KB
Loading

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.idea
1+
.idea

License

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
multi-platform-postgresql is released under the PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses.
2+
3+
PostgreSQL Database Management System
4+
(formerly known as Postgres, then as Postgres95)
5+
6+
Portions Copyright © 1996-2022, The PostgreSQL Global Development Group
7+
8+
Portions Copyright © 1994, The Regents of the University of California
9+
10+
Permission to use, copy, modify, and distribute this software and its documentation for any purpose, without fee, and without a written agreement is hereby granted, provided that the above copyright notice and this paragraph and the following two paragraphs appear in all copies.
11+
12+
IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
13+
14+
THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,19 @@ operator-yaml: operator-image
3333
cp operatorversions.json platforms/kubernetes/postgres-operator/deploy/versions.json
3434
cp jq-template.awk platforms/kubernetes/postgres-operator/deploy/jq-template.awk
3535
cd platforms/kubernetes/postgres-operator/deploy/; awk -f jq-template.awk postgres-operator.yaml.template > postgres-operator.yaml
36+
helm-package:
37+
cp helmversions.json platforms/kubernetes/postgres-operator/deploy/versions.json
38+
cp jq-template.awk platforms/kubernetes/postgres-operator/deploy/jq-template.awk
39+
cd platforms/kubernetes/postgres-operator/deploy/; \
40+
/bin/rm -rf platforms/kubernetes/postgres-operator/deploy/postgres-operator/; \
41+
cp -r helm_template/postgres-operator/ ./postgres-operator; \
42+
awk -f jq-template.awk postgres-operator.yaml.template > postgres-operator/templates/postgres-operator.yaml; \
43+
awk -f jq-template.awk postgres-operator/Chart.yaml.template > postgres-operator/Chart.yaml; \
44+
awk -f jq-template.awk postgres-operator/values.yaml.template > postgres-operator/values.yaml; \
45+
/bin/rm postgres-operator/Chart.yaml.template postgres-operator/values.yaml.template;
46+
helm package -d ./docs platforms/kubernetes/postgres-operator/deploy/postgres-operator/
47+
helm repo index --url https://radondb.github.io/multi-platform-postgresql/ ./docs
48+
/bin/rm -rf platforms/kubernetes/postgres-operator/deploy/postgres-operator/
3649
exporter-image:
3750
cp exporterversions.json image/exporter/versions.json
3851
cd image/exporter; ./generate_image.sh

README.md

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
![LOGO](.document/images/logo_radondb.png)
2+
3+
> English | [中文](README_zh.md)
4+
5+
## What is RadonDB PostgreSQL
6+
7+
[PostgreSQL](https://www.postgresql.org/) The World's Most Advanced Open Source Relational Database.
8+
9+
[RadonDB PostgreSQL](https://github.com/radondb/multi-platform-postgresql) High availability, High scalability, QingCloud Publish Open Source, PostgreSQL Operator On K8s and Machine.
10+
11+
RadonDB PostgreSQL Kubernetes supports [Kubernetes](https://kubernetes.io) or machine platforms.
12+
13+
## QuickStarts
14+
15+
👀 This tutorial demonstrates how to deploy a RadonDB PostgreSQL cluster (Operator) on Kubernetes.
16+
17+
## Preparation
18+
19+
📦 Prepare a Kubernetes cluster.
20+
21+
## Steps
22+
23+
### Step 1: Deploy RadonDB PostgreSQL Operator
24+
25+
Please select a method to deploy RadonDB PostgreSQL Operator.
26+
1. By Helm
27+
2. By Kubectl
28+
29+
#### a. By Helm
30+
31+
##### 1) Add a Helm repository.
32+
33+
```plain
34+
helm repo add radondb-postgresql https://radondb.github.io/multi-platform-postgresql/
35+
```
36+
37+
##### 2) Install Operator.
38+
39+
Create a [Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) named `radondb-postgres-operator`.
40+
41+
```plain
42+
helm install demo radondb-postgresql/postgres-operator
43+
```
44+
> **Notice**
45+
46+
> This step also creates the [CRD](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) required by the cluster.
47+
48+
#### b. By Kubectl
49+
50+
##### 1) Create `radondb-postgres-operator` namespace
51+
52+
```plain
53+
kubectl create ns radondb-postgres-operator
54+
```
55+
56+
##### 2) Install Operator.
57+
58+
```plain
59+
kubectl apply -f https://raw.githubusercontent.com/radondb/multi-platform-postgresql/V3.0.0/platforms/kubernetes/postgres-operator/deploy/postgres-operator.yaml
60+
```
61+
62+
### Step 2: Deploy a RadonDB PostgreSQL Cluster.
63+
64+
Run the following command to create an instance of the `postgresqls.postgres.radondb.io` CRD and thereby create a RadonDB PostgreSQL cluster by using the default parameters.
65+
66+
```plain
67+
curl https://raw.githubusercontent.com/radondb/multi-platform-postgresql/V3.0.0/platforms/kubernetes/postgres-operator/deploy/postgresql.yaml | sed -e "s/image: /image: radondb\//g" > postgresql.yaml
68+
kubectl apply -f postgresql.yaml
69+
```
70+
71+
## License
72+
73+
See [LICENSE](License) for more information.
74+
75+
## Welcome to join us ❤️
76+
77+
😊 Website: [https://radondb.com/](https://radondb.com/en/)
78+
79+
😁 Forum: Please join the [RadonDB](https://kubesphere.com.cn/forum/t/RadonDB) section of kubesphere Developer Forum.
80+
81+
🦉 Community WeChat group: Please add the group assistant **radondb** to invite you into the group.
82+
83+
For any bugs, questions, or suggestions about RadonDB multi-platform-postgresql, please create an [issue](https://github.com/radondb/multi-platform-postgresql/issues) on GitHub or feedback on the [forum](https://kubesphere.com.cn/forum/t/RadonDB).
84+

README_zh.md

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
![LOGO](.document/images/logo_radondb.png)
2+
3+
> [English](README.md) | 中文
4+
5+
## 什么是 RadonDB PostgreSQL
6+
7+
[PostgreSQL](https://www.postgresql.org/) 世界上最先进的开源关系数据库。
8+
9+
[RadonDB PostgreSQL](https://github.com/radondb/multi-platform-postgresql) 具备高可用、高扩展性、QingCloud 推出的开源的支持在 kubernetes/物理机/虚拟机 上部署的 PostgreSQL Operator。
10+
11+
## 快速开始
12+
13+
👀 本教程主要演示如何在 Kubernetes 上部署 RadonDB PostgreSQL 集群(Operator)。
14+
15+
## 部署准备
16+
17+
📦 已准备可用 Kubernetes 集群。
18+
19+
## 部署步骤
20+
21+
### 步骤 1: 部署 RadonDB PostgreSQL Operator
22+
23+
请从以下两种方式种选择一种部署 Radondb PostgreSQL Operator.
24+
1. 通过 helm 部署
25+
2. 通过 Kubectl 部署
26+
27+
#### a. 通过 helm 部署
28+
29+
##### 1) 添加 Helm 仓库
30+
31+
```plain
32+
helm repo add radondb-postgresql https://radondb.github.io/multi-platform-postgresql/
33+
```
34+
35+
##### 2) 部署 Operator
36+
37+
创建一个名为 `radondb-postgres-operator`[Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/)
38+
39+
```plain
40+
helm install demo radondb-postgresql/postgres-operator
41+
```
42+
> **说明**
43+
44+
> 在这一步骤中默认将同时创建集群所需的 [CRD](https://kubernetes.io/zh/docs/concepts/extend-kubernetes/api-extension/custom-resources/)
45+
46+
#### b. 通过 Kubectl 部署
47+
48+
##### 1) 创建一个名为 `radondb-postgres-operator` 的 namespace
49+
50+
```plain
51+
kubectl create ns radondb-postgres-operator
52+
```
53+
54+
##### 2) 部署 Operator
55+
56+
```plain
57+
kubectl apply -f https://raw.githubusercontent.com/radondb/multi-platform-postgresql/V3.0.0/platforms/kubernetes/postgres-operator/deploy/postgres-operator.yaml
58+
```
59+
60+
### 步骤 2: 部署 RadonDB PostgreSQL 集群
61+
62+
执行以下指令,以默认参数为 CRD `postgresqls.postgres.radondb.io` 创建一个实例,即创建 RadonDB PostgreSQL 集群。
63+
64+
```plain
65+
curl https://raw.githubusercontent.com/radondb/multi-platform-postgresql/V3.0.0/platforms/kubernetes/postgres-operator/deploy/postgresql.yaml | sed -e "s/image: /image: radondb\//g" > postgresql.yaml
66+
kubectl apply -f postgresql.yaml
67+
```
68+
69+
## 协议
70+
71+
查看 [LICENSE](License) 获取更多信息。
72+
73+
## 欢迎加入社区话题互动 ❤️
74+
75+
😊 社区官网:[https://radondb.com](https://radondb.com)
76+
77+
😁 社区论坛:请加入 KubeSphere 开发者论坛 [RadonDB](https://kubesphere.com.cn/forum/t/RadonDB) 板块。
78+
79+
😆 社区公众号:RadonDB 开源社区
80+
81+
🦉 社区微信群:请添加群助手 radondb 邀请进群
82+
83+
如有任何关于 RadonDB PostgreSQL 的 Bug、问题或建议,请在 GitHub 提交 [issue](https://github.com/radondb/multi-platform-postgresql/issues)[论坛](https://kubesphere.com.cn/forum/t/RadonDB)反馈。
84+

docs/index.html

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<html>
2+
<head>
3+
<title>PostgreSQL Cluster Chart repo</title>
4+
</head>
5+
<body>
6+
<h1>PostgreSQL Cluster Charts Repo</h1>
7+
<p>Point Helm at this repo to see charts.</p>
8+
</body>
9+
</html>

docs/index.yaml

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
apiVersion: v1
2+
entries:
3+
postgres-operator:
4+
- apiVersion: v2
5+
appVersion: v1.1.1
6+
created: "2022-11-30T22:42:38.579460016+08:00"
7+
description: A Helm chart for Kubernetes
8+
digest: bc8af40659a8054b0c1717c80779164acb070fd6c9ee38b39e2f06661be1d13a
9+
home: https://github.com/radondb/multi-platform-postgresql
10+
keywords:
11+
- operator
12+
- postgresql
13+
- database
14+
maintainers:
15+
16+
name: lzzhang
17+
url: https://lzzhang.github.io/
18+
19+
name: yanboer
20+
url: https://yanboer.github.io/
21+
name: postgres-operator
22+
sources:
23+
- https://github.com/radondb/multi-platform-postgresql
24+
type: application
25+
urls:
26+
- https://radondb.github.io/multi-platform-postgresql/postgres-operator-v1.0.1.tgz
27+
version: v1.0.1
28+
- apiVersion: v2
29+
appVersion: v1.1.0
30+
created: "2022-11-30T22:42:38.578975325+08:00"
31+
description: A Helm chart for Kubernetes
32+
digest: 1f6593413ae373c5caa7b8c41a3cd3697fbb164ba417260a3fefa6d32a1852e8
33+
home: https://github.com/radondb/multi-platform-postgresql
34+
keywords:
35+
- operator
36+
- postgresql
37+
- database
38+
maintainers:
39+
40+
name: lzzhang
41+
url: https://lzzhang.github.io/
42+
43+
name: yanboer
44+
url: https://yanboer.github.io/
45+
name: postgres-operator
46+
sources:
47+
- https://github.com/radondb/multi-platform-postgresql
48+
type: application
49+
urls:
50+
- https://radondb.github.io/multi-platform-postgresql/postgres-operator-v1.0.0.tgz
51+
version: v1.0.0
52+
generated: "2022-11-30T22:42:38.578229422+08:00"

docs/postgres-operator-v1.0.0.tgz

3.25 KB
Binary file not shown.

docs/postgres-operator-v1.0.1.tgz

3.45 KB
Binary file not shown.

exporterversions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"image": "radondb-postgres-exporter:v0.9.0"
2+
"image": "radondb-postgres-exporter:v1.1.0"
33
}

helmversions.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"appVersion": "v1.1.1",
3+
"version": "v1.0.1",
4+
5+
"template_name": "radondb-postgres-operator",
6+
"template_image": "radondb/radondb-postgres-operator:v1.1.1",
7+
"template_enablePrometheusMonitor": "false",
8+
"template_imageRegistry": "",
9+
"template_namespaceOverride": "",
10+
11+
"namespace": "{{ .Release.Namespace }}",
12+
"account": "radondb-postgres-operator-account",
13+
"clusterrole": "radondb-postgres-operator-cluster",
14+
"role": "radondb-postgres-operator-role",
15+
"clusterrolebinding": "radondb-postgres-operator-rolebinding-cluster",
16+
"rolebinding": "radondb-postgres-operator-rolebinding-role",
17+
"name": "{{ .Values.operator.name }}",
18+
"image": "{{ .Values.operator.image }}",
19+
"datapath": "/data",
20+
"imageRegistry": "{{ .Values.localRegistry | default \"\" }}",
21+
"namespaceOverride": "{{ .Values.namespaceOverride | default \"\" }}"
22+
}
23+

image/exporter/Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ FROM prometheuscommunity/postgres-exporter
33

44
COPY autofailover_queries.yaml /etc/autofailover_queries.yaml
55
COPY queries.yaml /etc/queries.yaml
6+
7+
ENV TZ=Asia/Shanghai
8+
USER root

image/exporter/generate_image.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ build_image()
1717
fi
1818

1919
echo "build docker image $image ..."
20-
docker buildx build --no-cache -t $image --platform $platform .
20+
docker builder build --no-cache -t $image --platform $platform .
2121
}
2222

2323
image=$(jq -r '.image' versions.json)

image/postgres-operator/Dockerfile

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Build container
22
FROM python:3.10-slim
33

4+
ENV TZ=Asia/Shanghai
45
RUN mkdir -pv /src
56

67
WORKDIR /src
@@ -13,5 +14,5 @@ RUN python -m pip install --trusted-host mirrors.aliyun.com --no-cache-dir \
1314
Kubernetes==21.7.0 kopf==1.35.5 wrapt paramiko \
1415
-i http://mirrors.aliyun.com/pypi/simple/
1516

16-
ENTRYPOINT ["kopf", "run", "--standalone", "-A"]
17+
ENTRYPOINT ["kopf", "run", "--standalone", "-A", "--liveness=http://0.0.0.0:8080/healthz"]
1718
CMD ["postgres.py"]

image/postgres-operator/generate_image.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ build_image()
2020
cp -r ../../platforms/kubernetes/postgres-operator/postgres .
2121

2222
echo "build docker image $image ..."
23-
docker buildx build --no-cache -t $image --platform $platform .
23+
docker builder build --no-cache -t $image --platform $platform .
2424
}
2525

2626
image=$(jq -r '.image' versions.json)

0 commit comments

Comments
 (0)