Skip to content

Commit 3debecb

Browse files
authored
Merge pull request #81 from cybertec-postgresql/addHugoDoc
optimize docs
2 parents b1cdcf3 + 92417cc commit 3debecb

File tree

379 files changed

+400985
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

379 files changed

+400985
-0
lines changed

.github/workflows/hugo.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: 'Release(hugo): GitHub Pages'
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
HUGO_DIR: 'docs/hugo'
9+
10+
jobs:
11+
gh-pages:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 10
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
defaults:
17+
run:
18+
working-directory: ${{ env.HUGO_DIR }}
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
lfs: true
24+
fetch-depth: 0
25+
26+
- uses: actions/setup-go@v5
27+
with:
28+
go-version: '^1.23'
29+
30+
- name: Setup Hugo
31+
uses: peaceiris/actions-hugo@v3
32+
with:
33+
hugo-version: '0.143.1'
34+
extended: true
35+
36+
- name: Get hugo dependencies (theme)
37+
run: hugo mod get
38+
39+
- name: Build
40+
run: hugo --minify
41+
42+
- name: Deploy to gh-pages
43+
uses: peaceiris/actions-gh-pages@v4
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
publish_branch: gh-pages
47+
publish_dir: docs/hugo/public

docs/hugo/.hugo_build.lock

Whitespace-only changes.

docs/hugo/content/__to_do__/_index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
title: "How to use"
3+
date: 2023-03-07T14:26:51+01:00
4+
draft: false
5+
weight: 320
6+
---
7+

docs/hugo/content/__to_do__/clone.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
title: "Single Cluster"
3+
date: 2023-12-28T14:26:51+01:00
4+
draft: true
5+
---
6+
7+
Setting up a basic Cluster is pretty easy, we just need the minimum Definiton of a cluster-manifest which can also be find in the operator-tutorials repo on github.
8+
We need the following Definitions for the basic cluster.
9+
## minimal Single Cluster
10+
```
11+
apiVersion: cpo.opensource.cybertec.at/v1
12+
kind: postgresql
13+
metadata:
14+
name: cluster-1
15+
spec:
16+
dockerImage: "docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.1-6-dev"
17+
numberOfInstances: 1
18+
postgresql:
19+
version: "16"
20+
resources:
21+
limits:
22+
cpu: 500m
23+
memory: 500Mi
24+
requests:
25+
cpu: 500m
26+
memory: 500Mi
27+
volume:
28+
size: 5Gi
29+
```
30+
Based on this Manifest the Operator will deploy a single-Node-Cluster based on the defined dockerImage and start the included Postgres-16-Server.
31+
Also created is a volume based on your default-storage Class. The Ressource-Definiton means, that we reserve a half cpu and a half GB Memory for this Cluster with the same Definition as limit.
32+
33+
After some seconds we should see, that the operator creates our cluster based on the declared definitions.
34+
```
35+
kubectl get pods
36+
-----------------------------------------------------------------------------
37+
NAME | READY | STATUS | RESTARTS | AGE
38+
cluster-1-0 | 1/1 | Running | 0 | 50s
39+
40+
```
41+
42+
We can now starting to modify our cluster with some more Definitons.
43+
### Use a specific Storageclass
44+
```
45+
spec:
46+
...
47+
volume:
48+
size: 5Gi
49+
storageClass: default-provisioner
50+
...
51+
```
52+
Using the storageClass-Definiton allows us to define a specific storageClass for this Cluster. Please ensure, that the storageClass exists and is usable. If a Volume cannot provide the Volume will stand in the pending-State as like the Database-Pod.
53+
54+
### Expanding Volume
55+
The Operator allows to you expand your volume if the storage-System is able to do this.
56+
```
57+
spec:
58+
...
59+
volume:
60+
size: 10Gi
61+
storageClass: default-provisioner
62+
...
63+
```
64+
This will trigger the expand of your Cluster-Volumes. It will need some time and you can check the current state inside the pvc.
65+
```
66+
kubectl get pvc pgdata-cluster-1-0 -o yaml
67+
-------------------------------------------------------
68+
spec:
69+
accessModes:
70+
- ReadWriteOnce
71+
resources:
72+
requests:
73+
storage: 10Gi
74+
storageClassName: crc-csi-hostpath-provisioner
75+
volumeMode: Filesystem
76+
volumeName: pvc-800d7ecc-2d5f-4ef4-af83-1cd94c766d37
77+
status:
78+
accessModes:
79+
- ReadWriteOnce
80+
capacity:
81+
storage: 5Gi
82+
phase: Bound
83+
84+
```
85+
86+
### Creating additonal Volumes
87+
The Operator allows you to modify your cluster with additonal Volumes.
88+
```
89+
spec:
90+
...
91+
additionalVolumes:
92+
- name: empty
93+
mountPath: /opt/empty
94+
targetContainers:
95+
- all
96+
volumeSource:
97+
emptyDir: {}
98+
```
99+
This example will create an emptyDir and mount it to all Containers inside the Database-Pod.
100+
101+
102+
### Specific Settings for aws gp3 Storage
103+
For the gp3 Storage aws you can define more informations
104+
```
105+
volume:
106+
size: 1Gi
107+
storageClass: gp3
108+
iops: 1000 # for EBS gp3
109+
throughput: 250 # in MB/s for EBS gp3
110+
111+
```
112+
The defined IOPS and Throughput will include in the PersistentVolumeClaim and send to the storage-Provisioner.
113+
Please keep in Mind, that on aws there is a CoolDown-Time as a limitation defined. For new Changes you need to wait 6 hours.
114+
Please also ensure to check the default and allowed values for IOPS and Throughput [AWS docs](https://aws.amazon.com/ebs/general-purpose/).
115+
116+
To ensure that the settings are updates properly please define the Operator-Configuration 'storage_resize_mode' from default to 'mixed'
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
title: "Single Cluster"
3+
date: 2023-12-28T14:26:51+01:00
4+
draft: true
5+
---
6+
7+
Setting up a basic Cluster is pretty easy, we just need the minimum Definiton of a cluster-manifest which can also be find in the operator-tutorials repo on github.
8+
We need the following Definitions for the basic cluster.
9+
## minimal Single Cluster
10+
```
11+
apiVersion: cpo.opensource.cybertec.at/v1
12+
kind: postgresql
13+
metadata:
14+
name: cluster-1
15+
spec:
16+
dockerImage: "docker.io/cybertecpostgresql/cybertec-pg-container:postgres-16.1-6-dev"
17+
numberOfInstances: 1
18+
postgresql:
19+
version: "16"
20+
resources:
21+
limits:
22+
cpu: 500m
23+
memory: 500Mi
24+
requests:
25+
cpu: 500m
26+
memory: 500Mi
27+
volume:
28+
size: 5Gi
29+
```
30+
Based on this Manifest the Operator will deploy a single-Node-Cluster based on the defined dockerImage and start the included Postgres-16-Server.
31+
Also created is a volume based on your default-storage Class. The Ressource-Definiton means, that we reserve a half cpu and a half GB Memory for this Cluster with the same Definition as limit.
32+
33+
After some seconds we should see, that the operator creates our cluster based on the declared definitions.
34+
```
35+
kubectl get pods
36+
-----------------------------------------------------------------------------
37+
NAME | READY | STATUS | RESTARTS | AGE
38+
cluster-1-0 | 1/1 | Running | 0 | 50s
39+
40+
```
41+
42+
We can now starting to modify our cluster with some more Definitons.
43+
### Use a specific Storageclass
44+
```
45+
spec:
46+
...
47+
volume:
48+
size: 5Gi
49+
storageClass: default-provisioner
50+
...
51+
```
52+
Using the storageClass-Definiton allows us to define a specific storageClass for this Cluster. Please ensure, that the storageClass exists and is usable. If a Volume cannot provide the Volume will stand in the pending-State as like the Database-Pod.
53+
54+
### Expanding Volume
55+
The Operator allows to you expand your volume if the storage-System is able to do this.
56+
```
57+
spec:
58+
...
59+
volume:
60+
size: 10Gi
61+
storageClass: default-provisioner
62+
...
63+
```
64+
This will trigger the expand of your Cluster-Volumes. It will need some time and you can check the current state inside the pvc.
65+
```
66+
kubectl get pvc pgdata-cluster-1-0 -o yaml
67+
-------------------------------------------------------
68+
spec:
69+
accessModes:
70+
- ReadWriteOnce
71+
resources:
72+
requests:
73+
storage: 10Gi
74+
storageClassName: crc-csi-hostpath-provisioner
75+
volumeMode: Filesystem
76+
volumeName: pvc-800d7ecc-2d5f-4ef4-af83-1cd94c766d37
77+
status:
78+
accessModes:
79+
- ReadWriteOnce
80+
capacity:
81+
storage: 5Gi
82+
phase: Bound
83+
84+
```
85+
86+
### Creating additonal Volumes
87+
The Operator allows you to modify your cluster with additonal Volumes.
88+
```
89+
spec:
90+
...
91+
additionalVolumes:
92+
- name: empty
93+
mountPath: /opt/empty
94+
targetContainers:
95+
- all
96+
volumeSource:
97+
emptyDir: {}
98+
```
99+
This example will create an emptyDir and mount it to all Containers inside the Database-Pod.
100+
101+
102+
### Specific Settings for aws gp3 Storage
103+
For the gp3 Storage aws you can define more informations
104+
```
105+
volume:
106+
size: 1Gi
107+
storageClass: gp3
108+
iops: 1000 # for EBS gp3
109+
throughput: 250 # in MB/s for EBS gp3
110+
111+
```
112+
The defined IOPS and Throughput will include in the PersistentVolumeClaim and send to the storage-Provisioner.
113+
Please keep in Mind, that on aws there is a CoolDown-Time as a limitation defined. For new Changes you need to wait 6 hours.
114+
Please also ensure to check the default and allowed values for IOPS and Throughput [AWS docs](https://aws.amazon.com/ebs/general-purpose/).
115+
116+
To ensure that the settings are updates properly please define the Operator-Configuration 'storage_resize_mode' from default to 'mixed'

0 commit comments

Comments
 (0)