initial commit

This commit is contained in:
allard
2025-11-23 18:58:51 +01:00
commit 376a944abc
1553 changed files with 314731 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
# https://github.com/golangci/golangci/wiki/Configuration
service:
prepare:
- make deps

View File

@@ -0,0 +1,22 @@
Installatie:
============
helm repo add postgres-operator-charts https://opensource.zalando.com/postgres-operator/charts/postgres-operator
helm install postgres-operator postgres-operator-charts/postgres-operator
helm repo add postgres-operator-ui-charts https://opensource.zalando.com/postgres-operator/charts/postgres-operator-ui
helm install postgres-operator-ui postgres-operator-ui-charts/postgres-operator-ui -f postgres-operator-values.yaml
Password:
---------
echo "Password: $(kubectl -n default get secret \
postgres.postgres-cluster-1.credentials.postgresql.acid.zalan.do -o \
jsonpath="{.data.password}" | base64 -d)"
External access:
----------------
exposen via loadbalancer!
Let op bij installatie UI wel de postgres-operator-values.yaml meenemen i.v.m. URL!
b.v. appUrl: "http://pgzalando.alldcs.online:8081"

View File

@@ -0,0 +1,11 @@
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: odroid-postgres-operator-zalando
title: Postgres-operator-zalando (odroid)
spec:
type: service
lifecycle: production
owner: platform-team
partOf:
- ../catalog-info.yaml

View File

@@ -0,0 +1,2 @@
echo User: $(microk8s kubectl get secret postgres.postgres-cluster-2.credentials.postgresql.acid.zalan.do -o jsonpath="{.data.username}" | base64 -d)
echo Password: $(microk8s kubectl get secret postgres.postgres-cluster-2.credentials.postgresql.acid.zalan.do -o jsonpath="{.data.password}" | base64 -d)

View File

@@ -0,0 +1,15 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: postgres-operator-tls-alldcs
spec:
entryPoints:
- websecure
routes:
- match: Host(`pgzalando.alldcs.nl`)
kind: Rule
services:
- name: postgres-operator-ui
port: 8081
tls:
certResolver: letsencrypt

View File

@@ -0,0 +1,2 @@
microk8s helm install postgres-operator postgres-operator-charts/postgres-operator
microk8s helm install postgres-operator-ui postgres-operator-ui-charts/postgres-operator-ui -f postgres-operator-ui-values.yaml

View File

@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: postgres-cluster-2-lb
namespace: default
spec:
ports:
- port: 5432
protocol: TCP
targetPort: 5432
selector:
# app: postgres-cluster-1-0
statefulset.kubernetes.io/pod-name: postgres-cluster-2-0
type: LoadBalancer

View File

@@ -0,0 +1,30 @@
kind: "postgresql"
apiVersion: "acid.zalan.do/v1"
metadata:
name: "postgres-cluster"
namespace: "default"
labels:
team: acid
spec:
teamId: "acid"
postgresql:
version: "15"
numberOfInstances: 3
enableMasterLoadBalancer: true
enableLogicalBackup: true
volume:
size: "2Gi"
allowedSourceRanges:
# IP ranges to access your cluster go here
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 500m
memory: 500Mi

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: postgres-operator-ui-lb
spec:
ports:
- name: http
targetPort: 8081
port: 8081
selector:
app: postgres-operator-ui
type: LoadBalancer

View File

@@ -0,0 +1,25 @@
apiVersion: v1
kind: Service
metadata:
annotations:
meta.helm.sh/release-name: postgres-operator-ui
meta.helm.sh/release-namespace: default
labels:
app.kubernetes.io/instance: postgres-operator-ui
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: postgres-operator-ui
helm.sh/chart: postgres-operator-ui-1.10.0
name: postgres-operator-ui
namespace: default
spec:
ports:
- port: 8081
protocol: TCP
targetPort: 8081
selector:
app.kubernetes.io/instance: postgres-operator-ui
app.kubernetes.io/name: postgres-operator-ui
sessionAffinity: None
type: NodePort
status:
loadBalancer: {}

View File

@@ -0,0 +1,110 @@
# Default values for postgres-operator-ui.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
# configure ui image
image:
registry: registry.opensource.zalan.do
repository: acid/postgres-operator-ui
tag: v1.9.0
pullPolicy: "IfNotPresent"
# Optionally specify an array of imagePullSecrets.
# Secrets must be manually created in the namespace.
# ref: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
# imagePullSecrets:
# - name:
rbac:
# Specifies whether RBAC resources should be created
create: true
serviceAccount:
# Specifies whether a ServiceAccount should be created
create: true
# The name of the ServiceAccount to use.
# If not set and create is true, a name is generated using the fullname template
name:
# configure UI pod resources
resources:
limits:
cpu: 200m
memory: 200Mi
requests:
cpu: 100m
memory: 100Mi
# configure UI ENVs
envs:
# IMPORTANT: While operator chart and UI chart are independent, this is the interface between
# UI and operator API. Insert the service name of the operator API here!
appUrl: "http://pgzalando.alldcs.online:8081"
operatorApiUrl: "http://postgres-operator:8080"
operatorClusterNameLabel: "cluster-name"
resourcesVisible: "False"
targetNamespace: "default"
teams:
- "acid"
# Extra pod annotations
podAnnotations:
{}
# configure extra UI ENVs
# Extra ENVs are writen in kubenertes format and added "as is" to the pod's env variables
# https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/
# https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#environment-variables
# UI specific env variables can be found here: https://github.com/zalando/postgres-operator/blob/master/ui/operator_ui/main.py
extraEnvs:
[]
# Exemple of settings to make snapshot view working in the ui when using AWS
# - name: WALE_S3_ENDPOINT
# value: https+path://s3.us-east-1.amazonaws.com:443
# - name: SPILO_S3_BACKUP_PREFIX
# value: spilo/
# - name: AWS_ACCESS_KEY_ID
# valueFrom:
# secretKeyRef:
# name: <postgres operator secret with AWS token>
# key: AWS_ACCESS_KEY_ID
# - name: AWS_SECRET_ACCESS_KEY
# valueFrom:
# secretKeyRef:
# name: <postgres operator secret with AWS token>
# key: AWS_SECRET_ACCESS_KEY
# - name: AWS_DEFAULT_REGION
# valueFrom:
# secretKeyRef:
# name: <postgres operator secret with AWS token>
# key: AWS_DEFAULT_REGION
# - name: SPILO_S3_BACKUP_BUCKET
# value: <s3 bucket used by the operator>
# configure UI service
service:
type: "NodePort"
port: "8081"
# If the type of the service is NodePort a port can be specified using the nodePort field
# If the nodePort field is not specified, or if it has no value, then a random port is used
# nodePort: 32521
annotations:
{}
# configure UI ingress. If needed: "enabled: true"
ingress:
enabled: false
annotations:
{}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
ingressClassName: ""
hosts:
- host: ui.example.org
paths: [""]
tls: []
# - secretName: ui-tls
# hosts:
# - ui.exmaple.org

View File

@@ -0,0 +1,33 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: postgres-pv
spec:
storageClassName: ""
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
mountOptions:
- hard
- nfsvers=4.1
nfs:
server: 192.168.50.101
path: /nfs_share/postgres-operator-zalando
readOnly: false
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
spec:
storageClassName: ""
volumeName: postgres-pv
accessModes:
- ReadWriteMany
volumeMode: Filesystem
resources:
requests:
storage: 2Gi

View File

@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: external-postgres-operator-ui
spec:
ports:
- protocol: TCP
port: 80
targetPort: 8081
---
apiVersion: v1
kind: Endpoints
metadata:
name: external-postgres-operator-ui
subsets:
- addresses:
- ip: 192.168.80.81
ports:
- port: 8081

View File

@@ -0,0 +1,13 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: postgres-operator-ui-http-alldcs
spec:
entryPoints:
- web
routes:
- match: Host(`postgres-operator.alldcs.nl`)
kind: Rule
services:
- name: external-postgres-operator-ui
port: 80

View File

@@ -0,0 +1,15 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: odroid-tls-alldcs
spec:
entryPoints:
- websecure
routes:
- match: Host(`odroid.alldcs.nl`)
kind: Rule
services:
- name: external-nginx
port: 80
tls:
certResolver: letsencrypt