Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pgpool Complete Docs #650

Merged
merged 16 commits into from
Aug 14, 2024
Merged
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
# helm install kubedb-crds appscode/kubedb-crds
# helm install kmodules-crds appscode/kmodules-crds
kubectl create -f https://github.com/cert-manager/cert-manager/releases/download/v1.11.0/cert-manager.crds.yaml
kubectl create -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.60.1/stripped-down-crds.yaml
kubectl create -f https://github.com/prometheus-operator/prometheus-operator/releases/download/v0.75.0/stripped-down-crds.yaml
kubectl create -f https://github.com/kmodules/custom-resources/raw/release-1.25/crds/appcatalog.appscode.com_appbindings.yaml
kubectl create -f https://github.com/kmodules/custom-resources/raw/release-1.25/crds/metrics.appscode.com_metricsconfigurations.yaml
kubectl create -f https://github.com/stashed/installer/raw/master/crds/stash-crds.yaml
Expand Down
23 changes: 23 additions & 0 deletions docs/examples/pgpool/autoscaling/compute/pgpool-autoscale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pgpool-autoscale
namespace: demo
spec:
version: "4.5.0"
replicas: 1
postgresRef:
name: ha-postgres
namespace: demo
podTemplate:
spec:
containers:
- name: pgpool
resources:
requests:
cpu: "200m"
memory: "300Mi"
limits:
cpu: "200m"
memory: "300Mi"
deletionPolicy: WipeOut
21 changes: 21 additions & 0 deletions docs/examples/pgpool/autoscaling/compute/pgpool-autoscaler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: autoscaling.kubedb.com/v1alpha1
kind: PgpoolAutoscaler
metadata:
name: pgpool-autoscale-ops
namespace: demo
spec:
databaseRef:
name: pgpool-autoscale
compute:
pgpool:
trigger: "On"
podLifeTimeThreshold: 5m
resourceDiffPercentage: 20
minAllowed:
cpu: 400m
memory: 400Mi
maxAllowed:
cpu: 1
memory: 1Gi
controlledResources: ["cpu", "memory"]
containerControlledValues: "RequestsAndLimits"
14 changes: 14 additions & 0 deletions docs/examples/pgpool/configuration/pgpool-config-file.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pp-custom-config
namespace: demo
spec:
version: "4.4.5"
replicas: 1
configSecret:
name: pp-configuration
postgresRef:
name: ha-postgres
namespace: demo
deletionPolicy: WipeOut
39 changes: 39 additions & 0 deletions docs/examples/pgpool/configuration/pgpool-config-sidecar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pgpool-custom-sidecar
namespace: demo
spec:
version: "4.4.5"
replicas: 1
postgresRef:
name: ha-postgres
namespace: demo
podTemplate:
spec:
containers:
- name: pgpool
volumeMounts:
- mountPath: /tmp/pgpool_log
name: data
readOnly: false
- name: filebeat
image: repository_name/custom_filebeat:latest
volumeMounts:
- mountPath: /tmp/pgpool_log
name: data
readOnly: true
volumes:
- name: data
emptyDir: {}
initConfig:
pgpoolConfig:
log_destination : 'stderr'
logging_collector : on
log_directory : '/tmp/pgpool_log'
log_filename : 'pgpool-%Y-%m-%d_%H%M%S.log'
log_file_mode : 0777
log_truncate_on_rotation : off
log_rotation_age : 1d
log_rotation_size : 10MB
deletionPolicy: WipeOut
17 changes: 17 additions & 0 deletions docs/examples/pgpool/configuration/pgpool-init-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pp-init-config
namespace: demo
spec:
version: "4.4.5"
replicas: 1
postgresRef:
name: ha-postgres
namespace: demo
initConfig:
pgpoolConfig:
num_init_children : 6
max_pool : 65
child_life_time : 400
deletionPolicy: WipeOut
16 changes: 16 additions & 0 deletions docs/examples/pgpool/configuration/pgpool-node-selector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pgpool-node-selector
namespace: demo
spec:
version: "4.4.5"
replicas: 1
postgresRef:
name: ha-postgres
namespace: demo
podTemplate:
spec:
nodeSelector:
disktype: ssd
deletionPolicy: WipeOut
19 changes: 19 additions & 0 deletions docs/examples/pgpool/configuration/pgpool-with-tolerations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pgpool-with-tolerations
namespace: demo
spec:
version: "4.4.5"
replicas: 1
postgresRef:
name: ha-postgres
namespace: demo
podTemplate:
spec:
tolerations:
- key: "key1"
operator: "Equal"
value: "node1"
effect: "NoSchedule"
deletionPolicy: WipeOut
12 changes: 12 additions & 0 deletions docs/examples/pgpool/configuration/pgpool-without-tolerations.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pgpool-without-tolerations
namespace: demo
spec:
version: "4.4.5"
replicas: 1
postgresRef:
name: ha-postgres
namespace: demo
deletionPolicy: WipeOut
3 changes: 3 additions & 0 deletions docs/examples/pgpool/configuration/pgpool.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
num_init_children = 6
max_pool = 65
child_life_time = 400
25 changes: 25 additions & 0 deletions docs/examples/pgpool/configuration/pp-misc-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pgpool
namespace: demo
spec:
version: "4.4.5"
replicas: 1
postgresRef:
name: ha-postgres
namespace: demo
podTemplate:
spec:
containers:
- name: pgpool
env:
- name: "ALICE_USERNAME"
value: alice
- name: "ALICE_PASSWORD"
value: '123'
- name: "BOB_USERNAME"
value: bob
- name: "BOB_PASSWORD"
value: '456'
deletionPolicy: WipeOut
14 changes: 14 additions & 0 deletions docs/examples/pgpool/custom-rbac/mg-custom-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: my-custom-role
namespace: demo
rules:
- apiGroups:
- policy
resourceNames:
- mongodb-db
resources:
- podsecuritypolicies
verbs:
- use
15 changes: 15 additions & 0 deletions docs/examples/pgpool/custom-rbac/pgpool-new.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pgpool-new
namespace: demo
spec:
version: "4.5.0"
replicas: 1
postgresRef:
name: ha-postgres
namespace: demo
podTemplate:
spec:
serviceAccountName: my-custom-serviceaccount
deletionPolicy: WipeOut
15 changes: 15 additions & 0 deletions docs/examples/pgpool/custom-rbac/pp-custom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pgpool
namespace: demo
spec:
version: "4.5.0"
replicas: 1
postgresRef:
name: ha-postgres
namespace: demo
podTemplate:
spec:
serviceAccountName: my-custom-serviceaccount
deletionPolicy: WipeOut
13 changes: 13 additions & 0 deletions docs/examples/pgpool/monitroing/builtin-prom-pp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: builtin-prom-pp
namespace: demo
spec:
version: "4.5.0"
deletionPolicy: WipeOut
postgresRef:
name: ha-postgres
namespace: demo
monitor:
agent: prometheus.io/builtin
18 changes: 18 additions & 0 deletions docs/examples/pgpool/monitroing/coreos-prom-pp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: coreos-prom-pp
namespace: demo
spec:
version: "4.5.0"
postgresRef:
name: ha-postgres
namespace: demo
deletionPolicy: WipeOut
monitor:
agent: prometheus.io/operator
prometheus:
serviceMonitor:
labels:
release: prometheus
interval: 10s
14 changes: 14 additions & 0 deletions docs/examples/pgpool/reconfiguration/pp-custom-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pp-custom
namespace: demo
spec:
version: "4.5.0"
replicas: 1
configSecret:
name: pp-custom-config
postgresRef:
name: ha-postgres
namespace: demo
deletionPolicy: WipeOut
15 changes: 15 additions & 0 deletions docs/examples/pgpool/reconfiguration/ppops-reconfigure-apply.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: PgpoolOpsRequest
metadata:
name: ppops-reconfigure-apply
namespace: demo
spec:
type: Reconfigure
databaseRef:
name: pp-custom
configuration:
applyConfig:
pgpool.conf: |-
max_pool = 75
timeout: 5m
apply: IfReady
13 changes: 13 additions & 0 deletions docs/examples/pgpool/reconfiguration/ppops-reconfigure-remove.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: PgpoolOpsRequest
metadata:
name: ppops-reconfigure-remove
namespace: demo
spec:
type: Reconfigure
databaseRef:
name: pp-custom
configuration:
removeCustomConfig: true
timeout: 5m
apply: IfReady
14 changes: 14 additions & 0 deletions docs/examples/pgpool/reconfiguration/ppops-reconfigure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: PgpoolOpsRequest
metadata:
name: ppops-reconfigure
namespace: demo
spec:
type: Reconfigure
databaseRef:
name: pp-custom
configuration:
configSecret:
name: new-custom-config
timeout: 5m
apply: IfReady
8 changes: 8 additions & 0 deletions docs/examples/pgpool/reconfigure-tls/issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: pgpool-issuer
namespace: demo
spec:
ca:
secretName: pgpool-ca
8 changes: 8 additions & 0 deletions docs/examples/pgpool/reconfigure-tls/new-issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: pp-new-issuer
namespace: demo
spec:
ca:
secretName: pgpool-new-ca
12 changes: 12 additions & 0 deletions docs/examples/pgpool/reconfigure-tls/pgpool.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: kubedb.com/v1alpha2
kind: Pgpool
metadata:
name: pgpool
namespace: demo
spec:
version: "4.5.0"
replicas: 1
postgresRef:
name: ha-postgres
namespace: demo
deletionPolicy: WipeOut
Loading
Loading