Generate postgresql CRD from go structs
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
This commit is contained in:
parent
06ac340fe0
commit
4e0692205b
11
Makefile
11
Makefile
|
|
@ -21,7 +21,7 @@ GITSTATUS = $(shell git status --porcelain || echo "no changes")
|
||||||
SOURCES = cmd/main.go
|
SOURCES = cmd/main.go
|
||||||
VERSION ?= $(shell git describe --tags --always --dirty)
|
VERSION ?= $(shell git describe --tags --always --dirty)
|
||||||
CRD_SOURCES = $(shell find pkg/apis/zalando.org pkg/apis/acid.zalan.do -name '*.go' -not -name '*.deepcopy.go')
|
CRD_SOURCES = $(shell find pkg/apis/zalando.org pkg/apis/acid.zalan.do -name '*.go' -not -name '*.deepcopy.go')
|
||||||
GENERATED_CRDS = manifests/postgresteam.crd.yaml
|
GENERATED_CRDS = manifests/postgresteam.crd.yaml manifests/postgresql.crd.yaml
|
||||||
GENERATED = pkg/apis/zalando.org/v1/zz_generated.deepcopy.go pkg/apis/acid.zalan.do/v1/zz_generated.deepcopy.go
|
GENERATED = pkg/apis/zalando.org/v1/zz_generated.deepcopy.go pkg/apis/acid.zalan.do/v1/zz_generated.deepcopy.go
|
||||||
DIRS := cmd pkg
|
DIRS := cmd pkg
|
||||||
PKG := `go list ./... | grep -v /vendor/`
|
PKG := `go list ./... | grep -v /vendor/`
|
||||||
|
|
@ -54,6 +54,7 @@ default: local
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf build
|
rm -rf build
|
||||||
|
rm $(GENERATED)
|
||||||
|
|
||||||
verify:
|
verify:
|
||||||
hack/verify-codegen.sh
|
hack/verify-codegen.sh
|
||||||
|
|
@ -63,9 +64,13 @@ $(GENERATED): go.mod $(CRD_SOURCES)
|
||||||
|
|
||||||
$(GENERATED_CRDS): $(GENERATED)
|
$(GENERATED_CRDS): $(GENERATED)
|
||||||
go tool controller-gen crd:crdVersions=v1,allowDangerousTypes=true paths=./pkg/apis/acid.zalan.do/... output:crd:dir=manifests
|
go tool controller-gen crd:crdVersions=v1,allowDangerousTypes=true paths=./pkg/apis/acid.zalan.do/... output:crd:dir=manifests
|
||||||
# only generate postgresteam.crd.yaml for now
|
# only generate postgresteam.crd.yaml and postgresql.crd.yaml for now
|
||||||
@rm manifests/acid.zalan.do_operatorconfigurations.yaml
|
@rm manifests/acid.zalan.do_operatorconfigurations.yaml
|
||||||
@rm manifests/acid.zalan.do_postgresqls.yaml
|
@mv manifests/acid.zalan.do_postgresqls.yaml manifests/postgresql.crd.yaml
|
||||||
|
@# hack to use lowercase kind and listKind
|
||||||
|
@sed -i -e 's/kind: Postgresql/kind: postgresql/' manifests/postgresql.crd.yaml
|
||||||
|
@sed -i -e 's/listKind: PostgresqlList/listKind: postgresqlList/' manifests/postgresql.crd.yaml
|
||||||
|
@hack/adjust_postgresql_crd.sh
|
||||||
@mv manifests/acid.zalan.do_postgresteams.yaml manifests/postgresteam.crd.yaml
|
@mv manifests/acid.zalan.do_postgresteams.yaml manifests/postgresteam.crd.yaml
|
||||||
|
|
||||||
local: ${SOURCES} $(GENERATED_CRDS)
|
local: ${SOURCES} $(GENERATED_CRDS)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Hack to adjust the generated postgresql CRD YAML file and add missing field
|
||||||
|
# settings which can not be expressed via kubebuilder markers.
|
||||||
|
#
|
||||||
|
# Injections:
|
||||||
|
#
|
||||||
|
# * oneOf: for the standby field to enforce that only one of s3_wal_path, gs_wal_path or standby_host is set.
|
||||||
|
# * This can later be done with // +kubebuilder:validation:ExactlyOneOf marker, but this requires latest Kubernetes version. (Currently the operator depends on v1.32.9)
|
||||||
|
# * type: string and pattern for the maintenanceWindows items.
|
||||||
|
|
||||||
|
file="${1:-"manifests/postgresql.crd.yaml"}"
|
||||||
|
|
||||||
|
sed -i '/^[[:space:]]*standby:$/{
|
||||||
|
# Capture the indentation
|
||||||
|
s/^\([[:space:]]*\)standby:$/\1standby:\n\1 oneOf:\n\1 - required:\n\1 - s3_wal_path\n\1 - required:\n\1 - gs_wal_path\n\1 - required:\n\1 - standby_host/
|
||||||
|
}' "$file"
|
||||||
|
|
||||||
|
sed -i '/^[[:space:]]*maintenanceWindows:$/{
|
||||||
|
# Capture the indentation
|
||||||
|
s/^\([[:space:]]*\)maintenanceWindows:$/\1maintenanceWindows:\n\1 items:\n\1 pattern: '\''^\\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\\d):([0-5]?\\d)|(2[0-3]|[01]?\\d):([0-5]?\\d))-((2[0-3]|[01]?\\d):([0-5]?\\d)|(2[0-3]|[01]?\\d):([0-5]?\\d))\\ *$'\''\n\1 type: string/
|
||||||
|
}' "$file"
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
|
---
|
||||||
apiVersion: apiextensions.k8s.io/v1
|
apiVersion: apiextensions.k8s.io/v1
|
||||||
kind: CustomResourceDefinition
|
kind: CustomResourceDefinition
|
||||||
metadata:
|
metadata:
|
||||||
|
annotations:
|
||||||
|
controller-gen.kubebuilder.io/version: v0.17.3
|
||||||
name: postgresqls.acid.zalan.do
|
name: postgresqls.acid.zalan.do
|
||||||
spec:
|
spec:
|
||||||
group: acid.zalan.do
|
group: acid.zalan.do
|
||||||
|
|
@ -40,7 +43,8 @@ spec:
|
||||||
jsonPath: .spec.resources.requests.memory
|
jsonPath: .spec.resources.requests.memory
|
||||||
name: Memory-Request
|
name: Memory-Request
|
||||||
type: string
|
type: string
|
||||||
- jsonPath: .metadata.creationTimestamp
|
- description: Age of the PostgreSQL cluster
|
||||||
|
jsonPath: .metadata.creationTimestamp
|
||||||
name: Age
|
name: Age
|
||||||
type: date
|
type: date
|
||||||
- description: Current sync status of postgresql resource
|
- description: Current sync status of postgresql resource
|
||||||
|
|
@ -50,19 +54,33 @@ spec:
|
||||||
name: v1
|
name: v1
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
|
description: Postgresql defines PostgreSQL Custom Resource Definition Object.
|
||||||
properties:
|
properties:
|
||||||
apiVersion:
|
apiVersion:
|
||||||
enum:
|
description: |-
|
||||||
- acid.zalan.do/v1
|
APIVersion defines the versioned schema of this representation of an object.
|
||||||
|
Servers should convert recognized schemas to the latest internal value, and
|
||||||
|
may reject unrecognized values.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
|
||||||
type: string
|
type: string
|
||||||
kind:
|
kind:
|
||||||
enum:
|
description: |-
|
||||||
- postgresql
|
Kind is a string value representing the REST resource this object represents.
|
||||||
|
Servers may infer this from the endpoint the client submits requests to.
|
||||||
|
Cannot be updated.
|
||||||
|
In CamelCase.
|
||||||
|
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
|
||||||
type: string
|
type: string
|
||||||
|
metadata:
|
||||||
|
type: object
|
||||||
spec:
|
spec:
|
||||||
|
description: PostgresSpec defines the specification for the PostgreSQL
|
||||||
|
TPR.
|
||||||
properties:
|
properties:
|
||||||
additionalVolumes:
|
additionalVolumes:
|
||||||
items:
|
items:
|
||||||
|
description: AdditionalVolume specs additional optional volumes
|
||||||
|
for statefulset
|
||||||
properties:
|
properties:
|
||||||
isSubPathExpr:
|
isSubPathExpr:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
@ -87,12 +105,16 @@ spec:
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
allowedSourceRanges:
|
allowedSourceRanges:
|
||||||
|
description: load balancers' source ranges are the same for master
|
||||||
|
and replica services
|
||||||
items:
|
items:
|
||||||
pattern: ^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\/(\d|[1-2]\d|3[0-2])$
|
pattern: ^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\/(\d|[1-2]\d|3[0-2])$
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
type: array
|
type: array
|
||||||
clone:
|
clone:
|
||||||
|
description: CloneDescription describes which cluster the new should
|
||||||
|
clone and up to which point in time
|
||||||
properties:
|
properties:
|
||||||
cluster:
|
cluster:
|
||||||
type: string
|
type: string
|
||||||
|
|
@ -107,11 +129,11 @@ spec:
|
||||||
s3_wal_path:
|
s3_wal_path:
|
||||||
type: string
|
type: string
|
||||||
timestamp:
|
timestamp:
|
||||||
pattern: '^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(([+-]([01][0-9]|2[0-3]):[0-5][0-9]))$'
|
description: |-
|
||||||
# The regexp matches the date-time format (RFC 3339 Section 5.6) that specifies a timezone as an offset relative to UTC
|
The regexp matches the date-time format (RFC 3339 Section 5.6) that specifies a timezone as an offset relative to UTC
|
||||||
# Example: 1996-12-19T16:39:57-08:00
|
Example: 1996-12-19T16:39:57-08:00
|
||||||
# Note: this field requires a timezone
|
Note: this field requires a timezone
|
||||||
|
pattern: ^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(([+-]([01][0-9]|2[0-3]):[0-5][0-9]))$
|
||||||
type: string
|
type: string
|
||||||
uid:
|
uid:
|
||||||
format: uuid
|
format: uuid
|
||||||
|
|
@ -120,37 +142,112 @@ spec:
|
||||||
- cluster
|
- cluster
|
||||||
type: object
|
type: object
|
||||||
connectionPooler:
|
connectionPooler:
|
||||||
|
description: |-
|
||||||
|
ConnectionPooler Options for connection pooler
|
||||||
|
|
||||||
|
pgbouncer-large (with higher resources) or odyssey-small (with smaller
|
||||||
|
resources)
|
||||||
|
Type string `json:"type,omitempty"`
|
||||||
|
|
||||||
|
makes sense to expose. E.g. pool size (min/max boundaries), max client
|
||||||
|
connections etc.
|
||||||
properties:
|
properties:
|
||||||
dockerImage:
|
dockerImage:
|
||||||
type: string
|
type: string
|
||||||
maxDBConnections:
|
maxDBConnections:
|
||||||
|
format: int32
|
||||||
type: integer
|
type: integer
|
||||||
mode:
|
mode:
|
||||||
enum:
|
enum:
|
||||||
- "session"
|
- session
|
||||||
- "transaction"
|
- transaction
|
||||||
type: string
|
type: string
|
||||||
numberOfInstances:
|
numberOfInstances:
|
||||||
|
format: int32
|
||||||
minimum: 1
|
minimum: 1
|
||||||
type: integer
|
type: integer
|
||||||
resources:
|
resources:
|
||||||
|
description: Resources describes requests and limits for the cluster
|
||||||
|
resouces.
|
||||||
properties:
|
properties:
|
||||||
limits:
|
limits:
|
||||||
|
description: ResourceDescription describes CPU and memory
|
||||||
|
resources defined for a cluster.
|
||||||
properties:
|
properties:
|
||||||
cpu:
|
cpu:
|
||||||
pattern: '^(\d+m|\d+(\.\d{1,3})?)$'
|
description: |-
|
||||||
|
Decimal natural followed by m, or decimal natural followed by
|
||||||
|
dot followed by up to three decimal digits.
|
||||||
|
|
||||||
|
This is because the Kubernetes CPU resource has millis as the
|
||||||
|
maximum precision. The actual values are checked in code
|
||||||
|
because the regular expression would be huge and horrible and
|
||||||
|
not very helpful in validation error messages; this one checks
|
||||||
|
only the format of the given number.
|
||||||
|
|
||||||
|
https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
|
||||||
|
|
||||||
|
Note: the value specified here must not be zero or be lower
|
||||||
|
than the corresponding request.
|
||||||
|
pattern: ^(\d+m|\d+(\.\d{1,3})?)$
|
||||||
|
type: string
|
||||||
|
hugepages-1Gi:
|
||||||
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
|
type: string
|
||||||
|
hugepages-2Mi:
|
||||||
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
type: string
|
type: string
|
||||||
memory:
|
memory:
|
||||||
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
|
description: |-
|
||||||
|
You can express memory as a plain integer or as a fixed-point
|
||||||
|
integer using one of these suffixes: E, P, T, G, M, k. You can
|
||||||
|
also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki
|
||||||
|
|
||||||
|
https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory
|
||||||
|
|
||||||
|
Note: the value specified here must not be zero or be higher
|
||||||
|
than the corresponding limit.
|
||||||
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
requests:
|
requests:
|
||||||
|
description: ResourceDescription describes CPU and memory
|
||||||
|
resources defined for a cluster.
|
||||||
properties:
|
properties:
|
||||||
cpu:
|
cpu:
|
||||||
pattern: '^(\d+m|\d+(\.\d{1,3})?)$'
|
description: |-
|
||||||
|
Decimal natural followed by m, or decimal natural followed by
|
||||||
|
dot followed by up to three decimal digits.
|
||||||
|
|
||||||
|
This is because the Kubernetes CPU resource has millis as the
|
||||||
|
maximum precision. The actual values are checked in code
|
||||||
|
because the regular expression would be huge and horrible and
|
||||||
|
not very helpful in validation error messages; this one checks
|
||||||
|
only the format of the given number.
|
||||||
|
|
||||||
|
https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
|
||||||
|
|
||||||
|
Note: the value specified here must not be zero or be lower
|
||||||
|
than the corresponding request.
|
||||||
|
pattern: ^(\d+m|\d+(\.\d{1,3})?)$
|
||||||
|
type: string
|
||||||
|
hugepages-1Gi:
|
||||||
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
|
type: string
|
||||||
|
hugepages-2Mi:
|
||||||
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
type: string
|
type: string
|
||||||
memory:
|
memory:
|
||||||
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
|
description: |-
|
||||||
|
You can express memory as a plain integer or as a fixed-point
|
||||||
|
integer using one of these suffixes: E, P, T, G, M, k. You can
|
||||||
|
also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki
|
||||||
|
|
||||||
|
https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory
|
||||||
|
|
||||||
|
Note: the value specified here must not be zero or be higher
|
||||||
|
than the corresponding limit.
|
||||||
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
|
|
@ -162,7 +259,9 @@ spec:
|
||||||
databases:
|
databases:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: string
|
type: string
|
||||||
# Note: usernames specified here as database owners must be declared in the users key of the spec key.
|
description: |-
|
||||||
|
Note: usernames specified here as database owners must be declared
|
||||||
|
in the users key of the spec key.
|
||||||
type: object
|
type: object
|
||||||
dockerImage:
|
dockerImage:
|
||||||
type: string
|
type: string
|
||||||
|
|
@ -171,6 +270,9 @@ spec:
|
||||||
enableLogicalBackup:
|
enableLogicalBackup:
|
||||||
type: boolean
|
type: boolean
|
||||||
enableMasterLoadBalancer:
|
enableMasterLoadBalancer:
|
||||||
|
description: |-
|
||||||
|
vars that enable load balancers are pointers because it is important to know if any of them is omitted from the Postgres manifest
|
||||||
|
in that case the var evaluates to nil and the value is taken from the operator config
|
||||||
type: boolean
|
type: boolean
|
||||||
enableMasterPoolerLoadBalancer:
|
enableMasterPoolerLoadBalancer:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
@ -183,28 +285,19 @@ spec:
|
||||||
enableShmVolume:
|
enableShmVolume:
|
||||||
type: boolean
|
type: boolean
|
||||||
env:
|
env:
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
x-kubernetes-preserve-unknown-fields: true
|
|
||||||
nullable: true
|
|
||||||
type: array
|
|
||||||
initContainers:
|
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
x-kubernetes-preserve-unknown-fields: true
|
|
||||||
nullable: true
|
nullable: true
|
||||||
type: array
|
type: array
|
||||||
init_containers:
|
init_containers:
|
||||||
description: deprecated
|
description: deprecated json tags
|
||||||
items:
|
type: object
|
||||||
type: object
|
x-kubernetes-preserve-unknown-fields: true
|
||||||
x-kubernetes-preserve-unknown-fields: true
|
initContainers:
|
||||||
nullable: true
|
nullable: true
|
||||||
type: array
|
type: array
|
||||||
logicalBackupRetention:
|
logicalBackupRetention:
|
||||||
type: string
|
type: string
|
||||||
logicalBackupSchedule:
|
logicalBackupSchedule:
|
||||||
pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$'
|
pattern: ^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$
|
||||||
type: string
|
type: string
|
||||||
maintenanceWindows:
|
maintenanceWindows:
|
||||||
items:
|
items:
|
||||||
|
|
@ -214,101 +307,214 @@ spec:
|
||||||
masterServiceAnnotations:
|
masterServiceAnnotations:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: string
|
type: string
|
||||||
|
description: MasterServiceAnnotations takes precedence over ServiceAnnotations
|
||||||
|
for master role if not empty
|
||||||
type: object
|
type: object
|
||||||
nodeAffinity:
|
nodeAffinity:
|
||||||
|
description: Node affinity is a group of node affinity scheduling
|
||||||
|
rules.
|
||||||
properties:
|
properties:
|
||||||
preferredDuringSchedulingIgnoredDuringExecution:
|
preferredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
description: |-
|
||||||
|
The scheduler will prefer to schedule pods to nodes that satisfy
|
||||||
|
the affinity expressions specified by this field, but it may choose
|
||||||
|
a node that violates one or more of the expressions. The node that is
|
||||||
|
most preferred is the one with the greatest sum of weights, i.e.
|
||||||
|
for each node that meets all of the scheduling requirements (resource
|
||||||
|
request, requiredDuringScheduling affinity expressions, etc.),
|
||||||
|
compute a sum by iterating through the elements of this field and adding
|
||||||
|
"weight" to the sum if the node matches the corresponding matchExpressions; the
|
||||||
|
node(s) with the highest sum are the most preferred.
|
||||||
items:
|
items:
|
||||||
|
description: |-
|
||||||
|
An empty preferred scheduling term matches all objects with implicit weight 0
|
||||||
|
(i.e. it's a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).
|
||||||
properties:
|
properties:
|
||||||
preference:
|
preference:
|
||||||
|
description: A node selector term, associated with the corresponding
|
||||||
|
weight.
|
||||||
properties:
|
properties:
|
||||||
matchExpressions:
|
matchExpressions:
|
||||||
|
description: A list of node selector requirements by
|
||||||
|
node's labels.
|
||||||
items:
|
items:
|
||||||
|
description: |-
|
||||||
|
A node selector requirement is a selector that contains values, a key, and an operator
|
||||||
|
that relates the key and values.
|
||||||
properties:
|
properties:
|
||||||
key:
|
key:
|
||||||
|
description: The label key that the selector applies
|
||||||
|
to.
|
||||||
type: string
|
type: string
|
||||||
operator:
|
operator:
|
||||||
|
description: |-
|
||||||
|
Represents a key's relationship to a set of values.
|
||||||
|
Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
|
||||||
type: string
|
type: string
|
||||||
values:
|
values:
|
||||||
|
description: |-
|
||||||
|
An array of string values. If the operator is In or NotIn,
|
||||||
|
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
||||||
|
the values array must be empty. If the operator is Gt or Lt, the values
|
||||||
|
array must have a single element, which will be interpreted as an integer.
|
||||||
|
This array is replaced during a strategic merge patch.
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
required:
|
required:
|
||||||
- key
|
- key
|
||||||
- operator
|
- operator
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
matchFields:
|
matchFields:
|
||||||
|
description: A list of node selector requirements by
|
||||||
|
node's fields.
|
||||||
items:
|
items:
|
||||||
|
description: |-
|
||||||
|
A node selector requirement is a selector that contains values, a key, and an operator
|
||||||
|
that relates the key and values.
|
||||||
properties:
|
properties:
|
||||||
key:
|
key:
|
||||||
|
description: The label key that the selector applies
|
||||||
|
to.
|
||||||
type: string
|
type: string
|
||||||
operator:
|
operator:
|
||||||
|
description: |-
|
||||||
|
Represents a key's relationship to a set of values.
|
||||||
|
Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
|
||||||
type: string
|
type: string
|
||||||
values:
|
values:
|
||||||
|
description: |-
|
||||||
|
An array of string values. If the operator is In or NotIn,
|
||||||
|
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
||||||
|
the values array must be empty. If the operator is Gt or Lt, the values
|
||||||
|
array must have a single element, which will be interpreted as an integer.
|
||||||
|
This array is replaced during a strategic merge patch.
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
required:
|
required:
|
||||||
- key
|
- key
|
||||||
- operator
|
- operator
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
type: object
|
type: object
|
||||||
|
x-kubernetes-map-type: atomic
|
||||||
weight:
|
weight:
|
||||||
|
description: Weight associated with matching the corresponding
|
||||||
|
nodeSelectorTerm, in the range 1-100.
|
||||||
|
format: int32
|
||||||
type: integer
|
type: integer
|
||||||
required:
|
required:
|
||||||
- preference
|
- preference
|
||||||
- weight
|
- weight
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
|
description: |-
|
||||||
|
If the affinity requirements specified by this field are not met at
|
||||||
|
scheduling time, the pod will not be scheduled onto the node.
|
||||||
|
If the affinity requirements specified by this field cease to be met
|
||||||
|
at some point during pod execution (e.g. due to an update), the system
|
||||||
|
may or may not try to eventually evict the pod from its node.
|
||||||
properties:
|
properties:
|
||||||
nodeSelectorTerms:
|
nodeSelectorTerms:
|
||||||
|
description: Required. A list of node selector terms. The
|
||||||
|
terms are ORed.
|
||||||
items:
|
items:
|
||||||
|
description: |-
|
||||||
|
A null or empty node selector term matches no objects. The requirements of
|
||||||
|
them are ANDed.
|
||||||
|
The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.
|
||||||
properties:
|
properties:
|
||||||
matchExpressions:
|
matchExpressions:
|
||||||
|
description: A list of node selector requirements by
|
||||||
|
node's labels.
|
||||||
items:
|
items:
|
||||||
|
description: |-
|
||||||
|
A node selector requirement is a selector that contains values, a key, and an operator
|
||||||
|
that relates the key and values.
|
||||||
properties:
|
properties:
|
||||||
key:
|
key:
|
||||||
|
description: The label key that the selector applies
|
||||||
|
to.
|
||||||
type: string
|
type: string
|
||||||
operator:
|
operator:
|
||||||
|
description: |-
|
||||||
|
Represents a key's relationship to a set of values.
|
||||||
|
Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
|
||||||
type: string
|
type: string
|
||||||
values:
|
values:
|
||||||
|
description: |-
|
||||||
|
An array of string values. If the operator is In or NotIn,
|
||||||
|
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
||||||
|
the values array must be empty. If the operator is Gt or Lt, the values
|
||||||
|
array must have a single element, which will be interpreted as an integer.
|
||||||
|
This array is replaced during a strategic merge patch.
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
required:
|
required:
|
||||||
- key
|
- key
|
||||||
- operator
|
- operator
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
matchFields:
|
matchFields:
|
||||||
|
description: A list of node selector requirements by
|
||||||
|
node's fields.
|
||||||
items:
|
items:
|
||||||
|
description: |-
|
||||||
|
A node selector requirement is a selector that contains values, a key, and an operator
|
||||||
|
that relates the key and values.
|
||||||
properties:
|
properties:
|
||||||
key:
|
key:
|
||||||
|
description: The label key that the selector applies
|
||||||
|
to.
|
||||||
type: string
|
type: string
|
||||||
operator:
|
operator:
|
||||||
|
description: |-
|
||||||
|
Represents a key's relationship to a set of values.
|
||||||
|
Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
|
||||||
type: string
|
type: string
|
||||||
values:
|
values:
|
||||||
|
description: |-
|
||||||
|
An array of string values. If the operator is In or NotIn,
|
||||||
|
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
||||||
|
the values array must be empty. If the operator is Gt or Lt, the values
|
||||||
|
array must have a single element, which will be interpreted as an integer.
|
||||||
|
This array is replaced during a strategic merge patch.
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
required:
|
required:
|
||||||
- key
|
- key
|
||||||
- operator
|
- operator
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
type: object
|
type: object
|
||||||
|
x-kubernetes-map-type: atomic
|
||||||
type: array
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
required:
|
required:
|
||||||
- nodeSelectorTerms
|
- nodeSelectorTerms
|
||||||
type: object
|
type: object
|
||||||
|
x-kubernetes-map-type: atomic
|
||||||
type: object
|
type: object
|
||||||
numberOfInstances:
|
numberOfInstances:
|
||||||
|
format: int32
|
||||||
minimum: 0
|
minimum: 0
|
||||||
type: integer
|
type: integer
|
||||||
patroni:
|
patroni:
|
||||||
|
description: Patroni contains Patroni-specific configuration
|
||||||
properties:
|
properties:
|
||||||
failsafe_mode:
|
failsafe_mode:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
@ -317,14 +523,17 @@ spec:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
loop_wait:
|
loop_wait:
|
||||||
|
format: int32
|
||||||
type: integer
|
type: integer
|
||||||
maximum_lag_on_failover:
|
maximum_lag_on_failover:
|
||||||
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
pg_hba:
|
pg_hba:
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
retry_timeout:
|
retry_timeout:
|
||||||
|
format: int32
|
||||||
type: integer
|
type: integer
|
||||||
slots:
|
slots:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
|
|
@ -337,20 +546,24 @@ spec:
|
||||||
synchronous_mode_strict:
|
synchronous_mode_strict:
|
||||||
type: boolean
|
type: boolean
|
||||||
synchronous_node_count:
|
synchronous_node_count:
|
||||||
|
format: int32
|
||||||
type: integer
|
type: integer
|
||||||
ttl:
|
ttl:
|
||||||
|
format: int32
|
||||||
type: integer
|
type: integer
|
||||||
type: object
|
type: object
|
||||||
|
pod_priority_class_name:
|
||||||
|
description: deprecated
|
||||||
|
type: string
|
||||||
podAnnotations:
|
podAnnotations:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
podPriorityClassName:
|
podPriorityClassName:
|
||||||
type: string
|
type: string
|
||||||
pod_priority_class_name:
|
|
||||||
description: deprecated
|
|
||||||
type: string
|
|
||||||
postgresql:
|
postgresql:
|
||||||
|
description: PostgresqlParam describes PostgreSQL version and pairs
|
||||||
|
of configuration parameter name - values.
|
||||||
properties:
|
properties:
|
||||||
parameters:
|
parameters:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
|
|
@ -358,17 +571,18 @@ spec:
|
||||||
type: object
|
type: object
|
||||||
version:
|
version:
|
||||||
enum:
|
enum:
|
||||||
- "13"
|
- 13
|
||||||
- "14"
|
- 14
|
||||||
- "15"
|
- 15
|
||||||
- "16"
|
- 16
|
||||||
- "17"
|
- 17
|
||||||
type: string
|
type: string
|
||||||
required:
|
required:
|
||||||
- version
|
- version
|
||||||
type: object
|
type: object
|
||||||
preparedDatabases:
|
preparedDatabases:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
|
description: PreparedDatabase describes elements to be bootstrapped
|
||||||
properties:
|
properties:
|
||||||
defaultUsers:
|
defaultUsers:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
@ -378,6 +592,8 @@ spec:
|
||||||
type: object
|
type: object
|
||||||
schemas:
|
schemas:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
|
description: PreparedSchema describes elements to be bootstrapped
|
||||||
|
per schema
|
||||||
properties:
|
properties:
|
||||||
defaultRoles:
|
defaultRoles:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
|
@ -395,58 +611,91 @@ spec:
|
||||||
replicaServiceAnnotations:
|
replicaServiceAnnotations:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
type: string
|
type: string
|
||||||
|
description: ReplicaServiceAnnotations takes precedence over ServiceAnnotations
|
||||||
|
for replica role if not empty
|
||||||
type: object
|
type: object
|
||||||
resources:
|
resources:
|
||||||
|
description: Resources describes requests and limits for the cluster
|
||||||
|
resouces.
|
||||||
properties:
|
properties:
|
||||||
limits:
|
limits:
|
||||||
|
description: ResourceDescription describes CPU and memory resources
|
||||||
|
defined for a cluster.
|
||||||
properties:
|
properties:
|
||||||
cpu:
|
cpu:
|
||||||
# Decimal natural followed by m, or decimal natural followed by
|
description: |-
|
||||||
# dot followed by up to three decimal digits.
|
Decimal natural followed by m, or decimal natural followed by
|
||||||
#
|
dot followed by up to three decimal digits.
|
||||||
# This is because the Kubernetes CPU resource has millis as the
|
|
||||||
# maximum precision. The actual values are checked in code
|
|
||||||
# because the regular expression would be huge and horrible and
|
|
||||||
# not very helpful in validation error messages; this one checks
|
|
||||||
# only the format of the given number.
|
|
||||||
#
|
|
||||||
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
|
|
||||||
pattern: '^(\d+m|\d+(\.\d{1,3})?)$'
|
|
||||||
# Note: the value specified here must not be zero or be lower
|
|
||||||
# than the corresponding request.
|
|
||||||
|
|
||||||
|
This is because the Kubernetes CPU resource has millis as the
|
||||||
|
maximum precision. The actual values are checked in code
|
||||||
|
because the regular expression would be huge and horrible and
|
||||||
|
not very helpful in validation error messages; this one checks
|
||||||
|
only the format of the given number.
|
||||||
|
|
||||||
|
https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
|
||||||
|
|
||||||
|
Note: the value specified here must not be zero or be lower
|
||||||
|
than the corresponding request.
|
||||||
|
pattern: ^(\d+m|\d+(\.\d{1,3})?)$
|
||||||
type: string
|
type: string
|
||||||
hugepages-1Gi:
|
hugepages-1Gi:
|
||||||
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
type: string
|
type: string
|
||||||
hugepages-2Mi:
|
hugepages-2Mi:
|
||||||
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
type: string
|
type: string
|
||||||
memory:
|
memory:
|
||||||
# You can express memory as a plain integer or as a fixed-point
|
description: |-
|
||||||
# integer using one of these suffixes: E, P, T, G, M, k. You can
|
You can express memory as a plain integer or as a fixed-point
|
||||||
# also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki
|
integer using one of these suffixes: E, P, T, G, M, k. You can
|
||||||
#
|
also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki
|
||||||
# https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory
|
|
||||||
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
|
|
||||||
# Note: the value specified here must not be zero or be higher
|
|
||||||
# than the corresponding limit.
|
|
||||||
|
|
||||||
|
https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory
|
||||||
|
|
||||||
|
Note: the value specified here must not be zero or be higher
|
||||||
|
than the corresponding limit.
|
||||||
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
requests:
|
requests:
|
||||||
|
description: ResourceDescription describes CPU and memory resources
|
||||||
|
defined for a cluster.
|
||||||
properties:
|
properties:
|
||||||
cpu:
|
cpu:
|
||||||
pattern: '^(\d+m|\d+(\.\d{1,3})?)$'
|
description: |-
|
||||||
|
Decimal natural followed by m, or decimal natural followed by
|
||||||
|
dot followed by up to three decimal digits.
|
||||||
|
|
||||||
|
This is because the Kubernetes CPU resource has millis as the
|
||||||
|
maximum precision. The actual values are checked in code
|
||||||
|
because the regular expression would be huge and horrible and
|
||||||
|
not very helpful in validation error messages; this one checks
|
||||||
|
only the format of the given number.
|
||||||
|
|
||||||
|
https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
|
||||||
|
|
||||||
|
Note: the value specified here must not be zero or be lower
|
||||||
|
than the corresponding request.
|
||||||
|
pattern: ^(\d+m|\d+(\.\d{1,3})?)$
|
||||||
type: string
|
type: string
|
||||||
hugepages-1Gi:
|
hugepages-1Gi:
|
||||||
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
type: string
|
type: string
|
||||||
hugepages-2Mi:
|
hugepages-2Mi:
|
||||||
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
type: string
|
type: string
|
||||||
memory:
|
memory:
|
||||||
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
|
description: |-
|
||||||
|
You can express memory as a plain integer or as a fixed-point
|
||||||
|
integer using one of these suffixes: E, P, T, G, M, k. You can
|
||||||
|
also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki
|
||||||
|
|
||||||
|
https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory
|
||||||
|
|
||||||
|
Note: the value specified here must not be zero or be higher
|
||||||
|
than the corresponding limit.
|
||||||
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: object
|
type: object
|
||||||
|
|
@ -457,16 +706,16 @@ spec:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
sidecars:
|
sidecars:
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
x-kubernetes-preserve-unknown-fields: true
|
|
||||||
nullable: true
|
nullable: true
|
||||||
type: array
|
type: array
|
||||||
spiloFSGroup:
|
spiloFSGroup:
|
||||||
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
spiloRunAsGroup:
|
spiloRunAsGroup:
|
||||||
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
spiloRunAsUser:
|
spiloRunAsUser:
|
||||||
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
standby:
|
standby:
|
||||||
oneOf:
|
oneOf:
|
||||||
|
|
@ -476,6 +725,8 @@ spec:
|
||||||
- gs_wal_path
|
- gs_wal_path
|
||||||
- required:
|
- required:
|
||||||
- standby_host
|
- standby_host
|
||||||
|
description: StandbyDescription contains remote primary config or
|
||||||
|
s3/gs wal path
|
||||||
properties:
|
properties:
|
||||||
gs_wal_path:
|
gs_wal_path:
|
||||||
type: string
|
type: string
|
||||||
|
|
@ -488,13 +739,16 @@ spec:
|
||||||
type: object
|
type: object
|
||||||
streams:
|
streams:
|
||||||
items:
|
items:
|
||||||
|
description: Stream defines properties for creating FabricEventStream
|
||||||
|
resources
|
||||||
properties:
|
properties:
|
||||||
applicationId:
|
applicationId:
|
||||||
type: string
|
type: string
|
||||||
batchSize:
|
batchSize:
|
||||||
|
format: int32
|
||||||
type: integer
|
type: integer
|
||||||
cpu:
|
cpu:
|
||||||
pattern: '^(\d+m|\d+(\.\d{1,3})?)$'
|
pattern: ^(\d+m|\d+(\.\d{1,3})?)$
|
||||||
type: string
|
type: string
|
||||||
database:
|
database:
|
||||||
type: string
|
type: string
|
||||||
|
|
@ -505,10 +759,12 @@ spec:
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
memory:
|
memory:
|
||||||
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
type: string
|
type: string
|
||||||
tables:
|
tables:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
|
description: StreamTable defines properties of outbox tables
|
||||||
|
for FabricEventStreams
|
||||||
properties:
|
properties:
|
||||||
eventType:
|
eventType:
|
||||||
type: string
|
type: string
|
||||||
|
|
@ -533,6 +789,7 @@ spec:
|
||||||
teamId:
|
teamId:
|
||||||
type: string
|
type: string
|
||||||
tls:
|
tls:
|
||||||
|
description: TLSDescription specs TLS properties
|
||||||
properties:
|
properties:
|
||||||
caFile:
|
caFile:
|
||||||
type: string
|
type: string
|
||||||
|
|
@ -549,31 +806,51 @@ spec:
|
||||||
type: object
|
type: object
|
||||||
tolerations:
|
tolerations:
|
||||||
items:
|
items:
|
||||||
|
description: |-
|
||||||
|
The pod this Toleration is attached to tolerates any taint that matches
|
||||||
|
the triple <key,value,effect> using the matching operator <operator>.
|
||||||
properties:
|
properties:
|
||||||
effect:
|
effect:
|
||||||
enum:
|
description: |-
|
||||||
- NoExecute
|
Effect indicates the taint effect to match. Empty means match all taint effects.
|
||||||
- NoSchedule
|
When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
|
||||||
- PreferNoSchedule
|
|
||||||
type: string
|
type: string
|
||||||
key:
|
key:
|
||||||
|
description: |-
|
||||||
|
Key is the taint key that the toleration applies to. Empty means match all taint keys.
|
||||||
|
If the key is empty, operator must be Exists; this combination means to match all values and all keys.
|
||||||
type: string
|
type: string
|
||||||
operator:
|
operator:
|
||||||
enum:
|
description: |-
|
||||||
- Equal
|
Operator represents a key's relationship to the value.
|
||||||
- Exists
|
Valid operators are Exists and Equal. Defaults to Equal.
|
||||||
|
Exists is equivalent to wildcard for value, so that a pod can
|
||||||
|
tolerate all taints of a particular category.
|
||||||
type: string
|
type: string
|
||||||
tolerationSeconds:
|
tolerationSeconds:
|
||||||
|
description: |-
|
||||||
|
TolerationSeconds represents the period of time the toleration (which must be
|
||||||
|
of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
|
||||||
|
it is not set, which means tolerate the taint forever (do not evict). Zero and
|
||||||
|
negative values will be treated as 0 (evict immediately) by the system.
|
||||||
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
value:
|
value:
|
||||||
|
description: |-
|
||||||
|
Value is the taint value the toleration matches to.
|
||||||
|
If the operator is Exists, the value should be empty, otherwise just a regular string.
|
||||||
type: string
|
type: string
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
useLoadBalancer:
|
useLoadBalancer:
|
||||||
description: deprecated
|
description: |-
|
||||||
|
deprecated load balancer settings maintained for backward compatibility
|
||||||
|
see "Load balancers" operator docs
|
||||||
type: boolean
|
type: boolean
|
||||||
users:
|
users:
|
||||||
additionalProperties:
|
additionalProperties:
|
||||||
|
description: UserFlags defines flags (such as superuser, nologin)
|
||||||
|
that could be assigned to individual users
|
||||||
items:
|
items:
|
||||||
enum:
|
enum:
|
||||||
- bypassrls
|
- bypassrls
|
||||||
|
|
@ -605,7 +882,6 @@ spec:
|
||||||
- nosuperuser
|
- nosuperuser
|
||||||
- NOSUPERUSER
|
- NOSUPERUSER
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
|
||||||
type: array
|
type: array
|
||||||
type: object
|
type: object
|
||||||
usersIgnoringSecretRotation:
|
usersIgnoringSecretRotation:
|
||||||
|
|
@ -624,65 +900,94 @@ spec:
|
||||||
nullable: true
|
nullable: true
|
||||||
type: array
|
type: array
|
||||||
volume:
|
volume:
|
||||||
|
description: Volume describes a single volume in the manifest.
|
||||||
properties:
|
properties:
|
||||||
iops:
|
iops:
|
||||||
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
isSubPathExpr:
|
isSubPathExpr:
|
||||||
type: boolean
|
type: boolean
|
||||||
selector:
|
selector:
|
||||||
|
description: |-
|
||||||
|
A label selector is a label query over a set of resources. The result of matchLabels and
|
||||||
|
matchExpressions are ANDed. An empty label selector matches all objects. A null
|
||||||
|
label selector matches no objects.
|
||||||
properties:
|
properties:
|
||||||
matchExpressions:
|
matchExpressions:
|
||||||
|
description: matchExpressions is a list of label selector
|
||||||
|
requirements. The requirements are ANDed.
|
||||||
items:
|
items:
|
||||||
|
description: |-
|
||||||
|
A label selector requirement is a selector that contains values, a key, and an operator that
|
||||||
|
relates the key and values.
|
||||||
properties:
|
properties:
|
||||||
key:
|
key:
|
||||||
|
description: key is the label key that the selector
|
||||||
|
applies to.
|
||||||
type: string
|
type: string
|
||||||
operator:
|
operator:
|
||||||
enum:
|
description: |-
|
||||||
- DoesNotExist
|
operator represents a key's relationship to a set of values.
|
||||||
- Exists
|
Valid operators are In, NotIn, Exists and DoesNotExist.
|
||||||
- In
|
|
||||||
- NotIn
|
|
||||||
type: string
|
type: string
|
||||||
values:
|
values:
|
||||||
|
description: |-
|
||||||
|
values is an array of string values. If the operator is In or NotIn,
|
||||||
|
the values array must be non-empty. If the operator is Exists or DoesNotExist,
|
||||||
|
the values array must be empty. This array is replaced during a strategic
|
||||||
|
merge patch.
|
||||||
items:
|
items:
|
||||||
type: string
|
type: string
|
||||||
type: array
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
required:
|
required:
|
||||||
- key
|
- key
|
||||||
- operator
|
- operator
|
||||||
type: object
|
type: object
|
||||||
type: array
|
type: array
|
||||||
|
x-kubernetes-list-type: atomic
|
||||||
matchLabels:
|
matchLabels:
|
||||||
|
additionalProperties:
|
||||||
|
type: string
|
||||||
|
description: |-
|
||||||
|
matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels
|
||||||
|
map is equivalent to an element of matchExpressions, whose key field is "key", the
|
||||||
|
operator is "In", and the values array contains only "value". The requirements are ANDed.
|
||||||
type: object
|
type: object
|
||||||
x-kubernetes-preserve-unknown-fields: true
|
|
||||||
type: object
|
type: object
|
||||||
|
x-kubernetes-map-type: atomic
|
||||||
size:
|
size:
|
||||||
pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$'
|
pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$
|
||||||
# Note: the value specified here must not be zero.
|
|
||||||
|
|
||||||
type: string
|
type: string
|
||||||
storageClass:
|
storageClass:
|
||||||
type: string
|
type: string
|
||||||
subPath:
|
subPath:
|
||||||
type: string
|
type: string
|
||||||
throughput:
|
throughput:
|
||||||
|
format: int64
|
||||||
type: integer
|
type: integer
|
||||||
|
type:
|
||||||
|
type: string
|
||||||
required:
|
required:
|
||||||
- size
|
- size
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- numberOfInstances
|
- numberOfInstances
|
||||||
- teamId
|
|
||||||
- postgresql
|
- postgresql
|
||||||
|
- teamId
|
||||||
- volume
|
- volume
|
||||||
type: object
|
type: object
|
||||||
status:
|
status:
|
||||||
additionalProperties:
|
description: PostgresStatus contains status of the PostgreSQL cluster
|
||||||
type: string
|
(running, creation failed etc.)
|
||||||
|
properties:
|
||||||
|
PostgresClusterStatus:
|
||||||
|
type: string
|
||||||
|
required:
|
||||||
|
- PostgresClusterStatus
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- kind
|
- metadata
|
||||||
- apiVersion
|
|
||||||
- spec
|
- spec
|
||||||
type: object
|
type: object
|
||||||
served: true
|
served: true
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,25 @@ import (
|
||||||
|
|
||||||
// +genclient
|
// +genclient
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
// +kubebuilder:object:root=true
|
||||||
|
|
||||||
// Postgresql defines PostgreSQL Custom Resource Definition Object.
|
// Postgresql defines PostgreSQL Custom Resource Definition Object.
|
||||||
|
// +kubebuilder:resource:categories=all,shortName=pg,scope=Namespaced
|
||||||
|
// +kubebuilder:printcolumn:name="Team",type=string,JSONPath=`.spec.teamId`,description="Team responsible for Postgres cluster"
|
||||||
|
// +kubebuilder:printcolumn:name="Version",type=string,JSONPath=`.spec.postgresql.version`,description="PostgreSQL version"
|
||||||
|
// +kubebuilder:printcolumn:name="Pods",type=integer,JSONPath=`.spec.numberOfInstances`,description="Number of Pods per Postgres cluster"
|
||||||
|
// +kubebuilder:printcolumn:name="Volume",type=string,JSONPath=`.spec.volume.size`,description="Size of the bound volume"
|
||||||
|
// +kubebuilder:printcolumn:name="CPU-Request",type=string,JSONPath=`.spec.resources.requests.cpu`,description="Requested CPU for Postgres containers"
|
||||||
|
// +kubebuilder:printcolumn:name="Memory-Request",type=string,JSONPath=`.spec.resources.requests.memory`,description="Requested memory for Postgres containers"
|
||||||
|
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`,description="Age of the PostgreSQL cluster"
|
||||||
|
// +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.PostgresClusterStatus`,description="Current sync status of postgresql resource"
|
||||||
|
// +kubebuilder:subresource:status
|
||||||
type Postgresql struct {
|
type Postgresql struct {
|
||||||
metav1.TypeMeta `json:",inline"`
|
metav1.TypeMeta `json:",inline"`
|
||||||
metav1.ObjectMeta `json:"metadata,omitempty"`
|
metav1.ObjectMeta `json:"metadata"`
|
||||||
|
|
||||||
Spec PostgresSpec `json:"spec"`
|
Spec PostgresSpec `json:"spec"`
|
||||||
|
// +optional
|
||||||
Status PostgresStatus `json:"status"`
|
Status PostgresStatus `json:"status"`
|
||||||
Error string `json:"-"`
|
Error string `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
@ -25,9 +37,10 @@ type Postgresql struct {
|
||||||
// PostgresSpec defines the specification for the PostgreSQL TPR.
|
// PostgresSpec defines the specification for the PostgreSQL TPR.
|
||||||
type PostgresSpec struct {
|
type PostgresSpec struct {
|
||||||
PostgresqlParam `json:"postgresql"`
|
PostgresqlParam `json:"postgresql"`
|
||||||
Volume `json:"volume,omitempty"`
|
Volume `json:"volume"`
|
||||||
Patroni `json:"patroni,omitempty"`
|
// +optional
|
||||||
*Resources `json:"resources,omitempty"`
|
Patroni `json:"patroni"`
|
||||||
|
*Resources `json:"resources,omitempty"`
|
||||||
|
|
||||||
EnableConnectionPooler *bool `json:"enableConnectionPooler,omitempty"`
|
EnableConnectionPooler *bool `json:"enableConnectionPooler,omitempty"`
|
||||||
EnableReplicaConnectionPooler *bool `json:"enableReplicaConnectionPooler,omitempty"`
|
EnableReplicaConnectionPooler *bool `json:"enableReplicaConnectionPooler,omitempty"`
|
||||||
|
|
@ -52,35 +65,59 @@ type PostgresSpec struct {
|
||||||
|
|
||||||
// deprecated load balancer settings maintained for backward compatibility
|
// deprecated load balancer settings maintained for backward compatibility
|
||||||
// see "Load balancers" operator docs
|
// see "Load balancers" operator docs
|
||||||
UseLoadBalancer *bool `json:"useLoadBalancer,omitempty"`
|
UseLoadBalancer *bool `json:"useLoadBalancer,omitempty"`
|
||||||
|
// deprecated
|
||||||
ReplicaLoadBalancer *bool `json:"replicaLoadBalancer,omitempty"`
|
ReplicaLoadBalancer *bool `json:"replicaLoadBalancer,omitempty"`
|
||||||
|
|
||||||
// load balancers' source ranges are the same for master and replica services
|
// load balancers' source ranges are the same for master and replica services
|
||||||
|
// +nullable
|
||||||
|
// +kubebuilder:validation:items:Pattern=`^(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\/(\d|[1-2]\d|3[0-2])$`
|
||||||
|
// +optional
|
||||||
AllowedSourceRanges []string `json:"allowedSourceRanges"`
|
AllowedSourceRanges []string `json:"allowedSourceRanges"`
|
||||||
|
|
||||||
Users map[string]UserFlags `json:"users,omitempty"`
|
Users map[string]UserFlags `json:"users,omitempty"`
|
||||||
UsersIgnoringSecretRotation []string `json:"usersIgnoringSecretRotation,omitempty"`
|
// +nullable
|
||||||
UsersWithSecretRotation []string `json:"usersWithSecretRotation,omitempty"`
|
UsersIgnoringSecretRotation []string `json:"usersIgnoringSecretRotation,omitempty"`
|
||||||
UsersWithInPlaceSecretRotation []string `json:"usersWithInPlaceSecretRotation,omitempty"`
|
// +nullable
|
||||||
|
UsersWithSecretRotation []string `json:"usersWithSecretRotation,omitempty"`
|
||||||
|
// +nullable
|
||||||
|
UsersWithInPlaceSecretRotation []string `json:"usersWithInPlaceSecretRotation,omitempty"`
|
||||||
|
|
||||||
NumberOfInstances int32 `json:"numberOfInstances"`
|
// +kubebuilder:validation:Minimum=0
|
||||||
MaintenanceWindows []MaintenanceWindow `json:"maintenanceWindows,omitempty"`
|
NumberOfInstances int32 `json:"numberOfInstances"`
|
||||||
Clone *CloneDescription `json:"clone,omitempty"`
|
// +kubebuilder:validation:Schemaless
|
||||||
Databases map[string]string `json:"databases,omitempty"`
|
// +kubebuilder:validation:Type=array
|
||||||
PreparedDatabases map[string]PreparedDatabase `json:"preparedDatabases,omitempty"`
|
// +kubebuilde:validation:items:Type=string
|
||||||
SchedulerName *string `json:"schedulerName,omitempty"`
|
MaintenanceWindows []MaintenanceWindow `json:"maintenanceWindows,omitempty"`
|
||||||
NodeAffinity *v1.NodeAffinity `json:"nodeAffinity,omitempty"`
|
Clone *CloneDescription `json:"clone,omitempty"`
|
||||||
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
|
// Note: usernames specified here as database owners must be declared
|
||||||
Sidecars []Sidecar `json:"sidecars,omitempty"`
|
// in the users key of the spec key.
|
||||||
InitContainers []v1.Container `json:"initContainers,omitempty"`
|
Databases map[string]string `json:"databases,omitempty"`
|
||||||
PodPriorityClassName string `json:"podPriorityClassName,omitempty"`
|
PreparedDatabases map[string]PreparedDatabase `json:"preparedDatabases,omitempty"`
|
||||||
ShmVolume *bool `json:"enableShmVolume,omitempty"`
|
SchedulerName *string `json:"schedulerName,omitempty"`
|
||||||
EnableLogicalBackup bool `json:"enableLogicalBackup,omitempty"`
|
NodeAffinity *v1.NodeAffinity `json:"nodeAffinity,omitempty"`
|
||||||
LogicalBackupRetention string `json:"logicalBackupRetention,omitempty"`
|
Tolerations []v1.Toleration `json:"tolerations,omitempty"`
|
||||||
LogicalBackupSchedule string `json:"logicalBackupSchedule,omitempty"`
|
// +kubebuilder:validation:Type=array
|
||||||
StandbyCluster *StandbyDescription `json:"standby,omitempty"`
|
// +kubebuilder:validation:Items:Type=object
|
||||||
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
|
// +kubebuilder:validation:Items:XPreserveUnknownFields
|
||||||
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
|
// +kubebuilder:validation:Schemaless
|
||||||
|
// +nullable
|
||||||
|
Sidecars []Sidecar `json:"sidecars,omitempty"`
|
||||||
|
// +kubebuilder:validation:Type=array
|
||||||
|
// +kubebuilder:validation:Items:Type=object
|
||||||
|
// +kubebuilder:validation:Items:XPreserveUnknownFields
|
||||||
|
// +kubebuilder:validation:Schemaless
|
||||||
|
// +nullable
|
||||||
|
InitContainers []v1.Container `json:"initContainers,omitempty"`
|
||||||
|
PodPriorityClassName string `json:"podPriorityClassName,omitempty"`
|
||||||
|
ShmVolume *bool `json:"enableShmVolume,omitempty"`
|
||||||
|
EnableLogicalBackup bool `json:"enableLogicalBackup,omitempty"`
|
||||||
|
LogicalBackupRetention string `json:"logicalBackupRetention,omitempty"`
|
||||||
|
// +kubebuilder:validation:Pattern=`^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$`
|
||||||
|
LogicalBackupSchedule string `json:"logicalBackupSchedule,omitempty"`
|
||||||
|
StandbyCluster *StandbyDescription `json:"standby,omitempty"`
|
||||||
|
PodAnnotations map[string]string `json:"podAnnotations,omitempty"`
|
||||||
|
ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"`
|
||||||
// MasterServiceAnnotations takes precedence over ServiceAnnotations for master role if not empty
|
// MasterServiceAnnotations takes precedence over ServiceAnnotations for master role if not empty
|
||||||
MasterServiceAnnotations map[string]string `json:"masterServiceAnnotations,omitempty"`
|
MasterServiceAnnotations map[string]string `json:"masterServiceAnnotations,omitempty"`
|
||||||
// ReplicaServiceAnnotations takes precedence over ServiceAnnotations for replica role if not empty
|
// ReplicaServiceAnnotations takes precedence over ServiceAnnotations for replica role if not empty
|
||||||
|
|
@ -88,11 +125,20 @@ type PostgresSpec struct {
|
||||||
TLS *TLSDescription `json:"tls,omitempty"`
|
TLS *TLSDescription `json:"tls,omitempty"`
|
||||||
AdditionalVolumes []AdditionalVolume `json:"additionalVolumes,omitempty"`
|
AdditionalVolumes []AdditionalVolume `json:"additionalVolumes,omitempty"`
|
||||||
Streams []Stream `json:"streams,omitempty"`
|
Streams []Stream `json:"streams,omitempty"`
|
||||||
Env []v1.EnvVar `json:"env,omitempty"`
|
// +kubebuilder:validation:Type=array
|
||||||
|
// +kubebuilder:validation:Items:Type=object
|
||||||
|
// +kubebuilder:validation:Items:XPreserveUnknownFields
|
||||||
|
// +kubebuilder:validation:Schemaless
|
||||||
|
// +nullable
|
||||||
|
Env []v1.EnvVar `json:"env,omitempty"`
|
||||||
|
|
||||||
// deprecated json tags
|
// deprecated json tags
|
||||||
InitContainersOld []v1.Container `json:"init_containers,omitempty"`
|
// +kubebuilder:validation:XPreserveUnknownFields
|
||||||
PodPriorityClassNameOld string `json:"pod_priority_class_name,omitempty"`
|
// +kubebuilder:validation:Type=object
|
||||||
|
// +kubebuilder:validation:Schemaless
|
||||||
|
InitContainersOld []v1.Container `json:"init_containers,omitempty"`
|
||||||
|
// deprecated
|
||||||
|
PodPriorityClassNameOld string `json:"pod_priority_class_name,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||||
|
|
@ -123,50 +169,84 @@ type PreparedSchema struct {
|
||||||
type MaintenanceWindow struct {
|
type MaintenanceWindow struct {
|
||||||
Everyday bool `json:"everyday,omitempty"`
|
Everyday bool `json:"everyday,omitempty"`
|
||||||
Weekday time.Weekday `json:"weekday,omitempty"`
|
Weekday time.Weekday `json:"weekday,omitempty"`
|
||||||
StartTime metav1.Time `json:"startTime,omitempty"`
|
StartTime metav1.Time `json:"startTime"`
|
||||||
EndTime metav1.Time `json:"endTime,omitempty"`
|
EndTime metav1.Time `json:"endTime"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Volume describes a single volume in the manifest.
|
// Volume describes a single volume in the manifest.
|
||||||
type Volume struct {
|
type Volume struct {
|
||||||
Selector *metav1.LabelSelector `json:"selector,omitempty"`
|
Selector *metav1.LabelSelector `json:"selector,omitempty"`
|
||||||
Size string `json:"size"`
|
// +kubebuilder:validation:Pattern=`^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$`
|
||||||
StorageClass string `json:"storageClass,omitempty"`
|
Size string `json:"size"`
|
||||||
SubPath string `json:"subPath,omitempty"`
|
StorageClass string `json:"storageClass,omitempty"`
|
||||||
IsSubPathExpr *bool `json:"isSubPathExpr,omitempty"`
|
SubPath string `json:"subPath,omitempty"`
|
||||||
Iops *int64 `json:"iops,omitempty"`
|
IsSubPathExpr *bool `json:"isSubPathExpr,omitempty"`
|
||||||
Throughput *int64 `json:"throughput,omitempty"`
|
Iops *int64 `json:"iops,omitempty"`
|
||||||
VolumeType string `json:"type,omitempty"`
|
Throughput *int64 `json:"throughput,omitempty"`
|
||||||
|
VolumeType string `json:"type,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// AdditionalVolume specs additional optional volumes for statefulset
|
// AdditionalVolume specs additional optional volumes for statefulset
|
||||||
type AdditionalVolume struct {
|
type AdditionalVolume struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
MountPath string `json:"mountPath"`
|
MountPath string `json:"mountPath"`
|
||||||
SubPath string `json:"subPath,omitempty"`
|
SubPath string `json:"subPath,omitempty"`
|
||||||
IsSubPathExpr *bool `json:"isSubPathExpr,omitempty"`
|
IsSubPathExpr *bool `json:"isSubPathExpr,omitempty"`
|
||||||
TargetContainers []string `json:"targetContainers"`
|
// +nullable
|
||||||
VolumeSource v1.VolumeSource `json:"volumeSource"`
|
// +optional
|
||||||
|
TargetContainers []string `json:"targetContainers"`
|
||||||
|
// +kubebuilder:validation:XPreserveUnknownFields
|
||||||
|
// +kubebuilder:validation:Type=object
|
||||||
|
// +kubebuilder:validation:Schemaless
|
||||||
|
VolumeSource v1.VolumeSource `json:"volumeSource"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PostgresqlParam describes PostgreSQL version and pairs of configuration parameter name - values.
|
// PostgresqlParam describes PostgreSQL version and pairs of configuration parameter name - values.
|
||||||
type PostgresqlParam struct {
|
type PostgresqlParam struct {
|
||||||
|
// +kubebuilder:validation:Enum=13;14;15;16;17
|
||||||
PgVersion string `json:"version"`
|
PgVersion string `json:"version"`
|
||||||
Parameters map[string]string `json:"parameters,omitempty"`
|
Parameters map[string]string `json:"parameters,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResourceDescription describes CPU and memory resources defined for a cluster.
|
// ResourceDescription describes CPU and memory resources defined for a cluster.
|
||||||
type ResourceDescription struct {
|
type ResourceDescription struct {
|
||||||
CPU *string `json:"cpu,omitempty"`
|
// Decimal natural followed by m, or decimal natural followed by
|
||||||
Memory *string `json:"memory,omitempty"`
|
// dot followed by up to three decimal digits.
|
||||||
|
//
|
||||||
|
// This is because the Kubernetes CPU resource has millis as the
|
||||||
|
// maximum precision. The actual values are checked in code
|
||||||
|
// because the regular expression would be huge and horrible and
|
||||||
|
// not very helpful in validation error messages; this one checks
|
||||||
|
// only the format of the given number.
|
||||||
|
//
|
||||||
|
// https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-cpu
|
||||||
|
//
|
||||||
|
// Note: the value specified here must not be zero or be lower
|
||||||
|
// than the corresponding request.
|
||||||
|
// +kubebuilder:validation:Pattern=`^(\d+m|\d+(\.\d{1,3})?)$`
|
||||||
|
CPU *string `json:"cpu,omitempty"`
|
||||||
|
// You can express memory as a plain integer or as a fixed-point
|
||||||
|
// integer using one of these suffixes: E, P, T, G, M, k. You can
|
||||||
|
// also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki
|
||||||
|
//
|
||||||
|
// https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#meaning-of-memory
|
||||||
|
//
|
||||||
|
// Note: the value specified here must not be zero or be higher
|
||||||
|
// than the corresponding limit.
|
||||||
|
// +kubebuilder:validation:Pattern=`^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$`
|
||||||
|
Memory *string `json:"memory,omitempty"`
|
||||||
|
// +kubebuilder:validation:Pattern=`^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$`
|
||||||
HugePages2Mi *string `json:"hugepages-2Mi,omitempty"`
|
HugePages2Mi *string `json:"hugepages-2Mi,omitempty"`
|
||||||
|
// +kubebuilder:validation:Pattern=`^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$`
|
||||||
HugePages1Gi *string `json:"hugepages-1Gi,omitempty"`
|
HugePages1Gi *string `json:"hugepages-1Gi,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resources describes requests and limits for the cluster resouces.
|
// Resources describes requests and limits for the cluster resouces.
|
||||||
type Resources struct {
|
type Resources struct {
|
||||||
ResourceRequests ResourceDescription `json:"requests,omitempty"`
|
// +optional
|
||||||
ResourceLimits ResourceDescription `json:"limits,omitempty"`
|
ResourceRequests ResourceDescription `json:"requests"`
|
||||||
|
// +optional
|
||||||
|
ResourceLimits ResourceDescription `json:"limits"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Patroni contains Patroni-specific configuration
|
// Patroni contains Patroni-specific configuration
|
||||||
|
|
@ -176,7 +256,7 @@ type Patroni struct {
|
||||||
TTL uint32 `json:"ttl,omitempty"`
|
TTL uint32 `json:"ttl,omitempty"`
|
||||||
LoopWait uint32 `json:"loop_wait,omitempty"`
|
LoopWait uint32 `json:"loop_wait,omitempty"`
|
||||||
RetryTimeout uint32 `json:"retry_timeout,omitempty"`
|
RetryTimeout uint32 `json:"retry_timeout,omitempty"`
|
||||||
MaximumLagOnFailover float32 `json:"maximum_lag_on_failover,omitempty"` // float32 because https://github.com/kubernetes/kubernetes/issues/30213
|
MaximumLagOnFailover int64 `json:"maximum_lag_on_failover,omitempty"`
|
||||||
Slots map[string]map[string]string `json:"slots,omitempty"`
|
Slots map[string]map[string]string `json:"slots,omitempty"`
|
||||||
SynchronousMode bool `json:"synchronous_mode,omitempty"`
|
SynchronousMode bool `json:"synchronous_mode,omitempty"`
|
||||||
SynchronousModeStrict bool `json:"synchronous_mode_strict,omitempty"`
|
SynchronousModeStrict bool `json:"synchronous_mode_strict,omitempty"`
|
||||||
|
|
@ -185,6 +265,7 @@ type Patroni struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// StandbyDescription contains remote primary config or s3/gs wal path
|
// StandbyDescription contains remote primary config or s3/gs wal path
|
||||||
|
// +kubebuilder:validation:ExactlyOneOf=s3_wal_path;gs_wal_path;standby_host
|
||||||
type StandbyDescription struct {
|
type StandbyDescription struct {
|
||||||
S3WalPath string `json:"s3_wal_path,omitempty"`
|
S3WalPath string `json:"s3_wal_path,omitempty"`
|
||||||
GSWalPath string `json:"gs_wal_path,omitempty"`
|
GSWalPath string `json:"gs_wal_path,omitempty"`
|
||||||
|
|
@ -194,6 +275,7 @@ type StandbyDescription struct {
|
||||||
|
|
||||||
// TLSDescription specs TLS properties
|
// TLSDescription specs TLS properties
|
||||||
type TLSDescription struct {
|
type TLSDescription struct {
|
||||||
|
// +required
|
||||||
SecretName string `json:"secretName,omitempty"`
|
SecretName string `json:"secretName,omitempty"`
|
||||||
CertificateFile string `json:"certificateFile,omitempty"`
|
CertificateFile string `json:"certificateFile,omitempty"`
|
||||||
PrivateKeyFile string `json:"privateKeyFile,omitempty"`
|
PrivateKeyFile string `json:"privateKeyFile,omitempty"`
|
||||||
|
|
@ -203,8 +285,14 @@ type TLSDescription struct {
|
||||||
|
|
||||||
// CloneDescription describes which cluster the new should clone and up to which point in time
|
// CloneDescription describes which cluster the new should clone and up to which point in time
|
||||||
type CloneDescription struct {
|
type CloneDescription struct {
|
||||||
ClusterName string `json:"cluster,omitempty"`
|
// +required
|
||||||
UID string `json:"uid,omitempty"`
|
ClusterName string `json:"cluster,omitempty"`
|
||||||
|
// +kubebuilder:validation:Format=uuid
|
||||||
|
UID string `json:"uid,omitempty"`
|
||||||
|
// The regexp matches the date-time format (RFC 3339 Section 5.6) that specifies a timezone as an offset relative to UTC
|
||||||
|
// Example: 1996-12-19T16:39:57-08:00
|
||||||
|
// Note: this field requires a timezone
|
||||||
|
// +kubebuilder:validation:Pattern=`^([0-9]+)-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60)(\.[0-9]+)?(([+-]([01][0-9]|2[0-3]):[0-5][0-9]))$`
|
||||||
EndTimestamp string `json:"timestamp,omitempty"`
|
EndTimestamp string `json:"timestamp,omitempty"`
|
||||||
S3WalPath string `json:"s3_wal_path,omitempty"`
|
S3WalPath string `json:"s3_wal_path,omitempty"`
|
||||||
S3Endpoint string `json:"s3_endpoint,omitempty"`
|
S3Endpoint string `json:"s3_endpoint,omitempty"`
|
||||||
|
|
@ -224,6 +312,8 @@ type Sidecar struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
// UserFlags defines flags (such as superuser, nologin) that could be assigned to individual users
|
// UserFlags defines flags (such as superuser, nologin) that could be assigned to individual users
|
||||||
|
// +kubebuilder:validation:items:Enum=bypassrls;BYPASSRLS;nobypassrls;NOBYPASSRLS;createdb;CREATEDB;nocreatedb;NOCREATEDB;createrole;CREATEROLE;nocreaterole;NOCREATEROLE;inherit;INHERIT;noinherit;NOINHERIT;login;LOGIN;nologin;NOLOGIN;replication;REPLICATION;noreplication;NOREPLICATION;superuser;SUPERUSER;nosuperuser;NOSUPERUSER
|
||||||
|
// +nullable
|
||||||
type UserFlags []string
|
type UserFlags []string
|
||||||
|
|
||||||
// PostgresStatus contains status of the PostgreSQL cluster (running, creation failed etc.)
|
// PostgresStatus contains status of the PostgreSQL cluster (running, creation failed etc.)
|
||||||
|
|
@ -242,26 +332,30 @@ type PostgresStatus struct {
|
||||||
// makes sense to expose. E.g. pool size (min/max boundaries), max client
|
// makes sense to expose. E.g. pool size (min/max boundaries), max client
|
||||||
// connections etc.
|
// connections etc.
|
||||||
type ConnectionPooler struct {
|
type ConnectionPooler struct {
|
||||||
|
// +kubebuilder:validation:Minimum=1
|
||||||
NumberOfInstances *int32 `json:"numberOfInstances,omitempty"`
|
NumberOfInstances *int32 `json:"numberOfInstances,omitempty"`
|
||||||
Schema string `json:"schema,omitempty"`
|
Schema string `json:"schema,omitempty"`
|
||||||
User string `json:"user,omitempty"`
|
User string `json:"user,omitempty"`
|
||||||
Mode string `json:"mode,omitempty"`
|
// +kubebuilder:validation:Enum=session;transaction
|
||||||
DockerImage string `json:"dockerImage,omitempty"`
|
Mode string `json:"mode,omitempty"`
|
||||||
MaxDBConnections *int32 `json:"maxDBConnections,omitempty"`
|
DockerImage string `json:"dockerImage,omitempty"`
|
||||||
|
MaxDBConnections *int32 `json:"maxDBConnections,omitempty"`
|
||||||
|
|
||||||
*Resources `json:"resources,omitempty"`
|
*Resources `json:"resources,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stream defines properties for creating FabricEventStream resources
|
// Stream defines properties for creating FabricEventStream resources
|
||||||
type Stream struct {
|
type Stream struct {
|
||||||
ApplicationId string `json:"applicationId"`
|
ApplicationId string `json:"applicationId"`
|
||||||
Database string `json:"database"`
|
Database string `json:"database"`
|
||||||
Tables map[string]StreamTable `json:"tables"`
|
Tables map[string]StreamTable `json:"tables"`
|
||||||
Filter map[string]*string `json:"filter,omitempty"`
|
Filter map[string]*string `json:"filter,omitempty"`
|
||||||
BatchSize *uint32 `json:"batchSize,omitempty"`
|
BatchSize *uint32 `json:"batchSize,omitempty"`
|
||||||
CPU *string `json:"cpu,omitempty"`
|
// +kubebuilder:validation:Pattern=`^(\d+m|\d+(\.\d{1,3})?)$`
|
||||||
Memory *string `json:"memory,omitempty"`
|
CPU *string `json:"cpu,omitempty"`
|
||||||
EnableRecovery *bool `json:"enableRecovery,omitempty"`
|
// +kubebuilder:validation:Pattern=`^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$`
|
||||||
|
Memory *string `json:"memory,omitempty"`
|
||||||
|
EnableRecovery *bool `json:"enableRecovery,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// StreamTable defines properties of outbox tables for FabricEventStreams
|
// StreamTable defines properties of outbox tables for FabricEventStreams
|
||||||
|
|
|
||||||
|
|
@ -412,7 +412,7 @@ PatroniInitDBParams:
|
||||||
}
|
}
|
||||||
|
|
||||||
if patroni.MaximumLagOnFailover >= 0 {
|
if patroni.MaximumLagOnFailover >= 0 {
|
||||||
config.Bootstrap.DCS.MaximumLagOnFailover = patroni.MaximumLagOnFailover
|
config.Bootstrap.DCS.MaximumLagOnFailover = float32(patroni.MaximumLagOnFailover)
|
||||||
}
|
}
|
||||||
if patroni.LoopWait != 0 {
|
if patroni.LoopWait != 0 {
|
||||||
config.Bootstrap.DCS.LoopWait = patroni.LoopWait
|
config.Bootstrap.DCS.LoopWait = patroni.LoopWait
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue