diff --git a/setup/helm/operator/crds/postgresql.crd.yaml b/setup/helm/operator/crds/postgresql.crd.yaml index b30932a..b162a9c 100644 --- a/setup/helm/operator/crds/postgresql.crd.yaml +++ b/setup/helm/operator/crds/postgresql.crd.yaml @@ -3,191 +3,315 @@ kind: CustomResourceDefinition metadata: name: postgresqls.cpo.opensource.cybertec.at spec: + conversion: + strategy: None group: cpo.opensource.cybertec.at names: + categories: + - all kind: postgresql listKind: postgresqlList plural: postgresqls - singular: postgresql shortNames: - pg - categories: - - all + singular: postgresql scope: Namespaced versions: - - name: v1 - served: true - storage: true - subresources: - status: {} - additionalPrinterColumns: - - name: Team - type: string - description: Team responsible for Postgres cluster + - additionalPrinterColumns: + - description: Team responsible for Postgres cluster jsonPath: .spec.teamId - - name: Version + name: Team type: string - description: PostgreSQL version + - description: PostgreSQL version jsonPath: .spec.postgresql.version - - name: Pods - type: integer - description: Number of Pods per Postgres cluster - jsonPath: .spec.numberOfInstances - - name: Volume + name: Version type: string - description: Size of the bound volume + - description: Number of Pods per Postgres cluster + jsonPath: .spec.numberOfInstances + name: Pods + type: integer + - description: Size of the bound volume jsonPath: .spec.volume.size - - name: CPU-Request + name: Volume type: string - description: Requested CPU for Postgres containers + - description: Requested CPU for Postgres containers jsonPath: .spec.resources.requests.cpu - - name: Memory-Request + name: CPU-Request type: string - description: Requested memory for Postgres containers + - description: Requested memory for Postgres containers jsonPath: .spec.resources.requests.memory - - name: Age - type: date - jsonPath: .metadata.creationTimestamp - - name: Status + name: Memory-Request type: string - description: Current sync status of postgresql resource + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - description: Current sync status of postgresql resource jsonPath: .status.PostgresClusterStatus + name: Status + type: string + name: v1 schema: openAPIV3Schema: - type: object - required: - - kind - - apiVersion - - spec properties: - kind: - type: string - enum: - - postgresql apiVersion: + enum: + - cpo.opensource.cybertec.at/v1 type: string + kind: enum: - - cpo.opensource.cybertec.at/v1 + - postgresql + type: string spec: - type: object - required: - - numberOfInstances - - teamId - - postgresql - - volume properties: additionalVolumes: - type: array items: - type: object - required: - - name - - mountPath - - volumeSource properties: + mountPath: + type: string name: type: string - mountPath: + subPath: type: string targetContainers: - type: array - nullable: true items: type: string + nullable: true + type: array volumeSource: type: object x-kubernetes-preserve-unknown-fields: true - subPath: - type: string - allowedSourceRanges: + required: + - name + - mountPath + - volumeSource + type: object type: array - nullable: true + allowedSourceRanges: 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])$ type: string - 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])$' - clone: + nullable: true + type: array + backup: + properties: + pgbackrest: + properties: + configuration: + properties: + protection: + properties: + restore: + type: boolean + type: object + secret: + type: string + type: object + global: + additionalProperties: + type: string + type: object + image: + type: string + repos: + items: + properties: + endpoint: + type: string + name: + pattern: ^repo[1-4]$ + type: string + pvcsize: + type: string + region: + type: string + resource: + type: string + schedule: + properties: + diff: + type: string + full: + type: string + incr: + type: string + type: object + storage: + enum: + - s3 + - gcs + - azure + - pvc + type: string + volume: + properties: + iops: + type: integer + selector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + enum: + - DoesNotExist + - Exists + - In + - NotIn + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + type: object + x-kubernetes-preserve-unknown-fields: true + type: object + size: + pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$ + type: string + storageClass: + type: string + subPath: + type: string + throughput: + type: integer + required: + - size + type: object + required: + - name + - storage + type: object + minItems: 1 + nullable: true + type: array + x-kubernetes-list-map-keys: + - name + x-kubernetes-list-type: map + resources: + properties: + limits: + properties: + cpu: + pattern: ^(\d+m|\d+(\.\d{1,3})?)$ + type: string + memory: + pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$ + type: string + type: object + requests: + properties: + cpu: + pattern: ^(\d+m|\d+(\.\d{1,3})?)$ + type: string + memory: + pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$ + type: string + type: object + type: object + restore: + properties: + id: + type: string + options: + additionalProperties: + type: string + type: object + repo: + pattern: ^repo[1-4]$ + type: string + type: object + required: + - image + - repos + type: object type: object - required: - - cluster + clone: properties: cluster: type: string - s3_endpoint: - type: string s3_access_key_id: type: string - s3_secret_access_key: + s3_endpoint: type: string s3_force_path_style: type: boolean + s3_secret_access_key: + type: string s3_wal_path: type: string 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]))$ type: string - 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]))$' - # 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 uid: format: uuid type: string - connectionPooler: + required: + - cluster type: object + connectionPooler: properties: dockerImage: type: string maxDBConnections: type: integer mode: - type: string enum: - - "session" - - "transaction" + - session + - transaction + type: string numberOfInstances: - type: integer minimum: 1 + type: integer resources: - type: object properties: limits: - type: object properties: cpu: + pattern: ^(\d+m|\d+(\.\d{1,3})?)$ type: string - pattern: '^(\d+m|\d+(\.\d{1,3})?)$' memory: + pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$ type: string - pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$' - requests: type: object + requests: properties: cpu: + pattern: ^(\d+m|\d+(\.\d{1,3})?)$ type: string - pattern: '^(\d+m|\d+(\.\d{1,3})?)$' memory: + pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$ type: string - pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$' + type: object + type: object schema: type: string user: type: string - databases: type: object + databases: additionalProperties: type: string - # Note: usernames specified here as database owners must be declared in the users key of the spec key. + type: object dockerImage: type: string enableConnectionPooler: type: boolean - enableReplicaConnectionPooler: - type: boolean enableLogicalBackup: type: boolean enableMasterLoadBalancer: type: boolean enableMasterPoolerLoadBalancer: type: boolean + enableReplicaConnectionPooler: + type: boolean enableReplicaLoadBalancer: type: boolean enableReplicaPoolerLoadBalancer: @@ -195,270 +319,161 @@ spec: enableShmVolume: type: boolean env: - type: array - nullable: true items: type: object x-kubernetes-preserve-unknown-fields: true - init_containers: + nullable: true type: array + init_containers: description: deprecated - nullable: true items: type: object x-kubernetes-preserve-unknown-fields: true - initContainers: - type: array nullable: true + type: array + initContainers: items: type: object x-kubernetes-preserve-unknown-fields: true - topologySpreadConstraints: - description: 'Topology spread constraints of a Dedicated - repo host pod. Changing this value causes the repo host - to restart. More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/' - items: - description: TopologySpreadConstraint specifies how - to spread matching pods among the given topology. - properties: - labelSelector: - description: LabelSelector is used to find matching - pods. Pods that match this label selector are - counted to determine the number of pods in their - corresponding topology domain. - properties: - matchExpressions: - description: matchExpressions is a list of label - selector requirements. The requirements are - ANDed. - items: - description: A label selector requirement - is a selector that contains values, a key, - and an operator that relates the key and - values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - 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: - type: string - type: array - required: - - key - - operator - type: object - type: array - 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 - maxSkew: - description: 'MaxSkew describes the degree to which - pods may be unevenly distributed. When `whenUnsatisfiable=DoNotSchedule`, - it is the maximum permitted difference between - the number of matching pods in the target topology - and the global minimum. For example, in a 3-zone - cluster, MaxSkew is set to 1, and pods with the - same labelSelector spread as 1/1/0: | zone1 | - zone2 | zone3 | | P | P | | - if - MaxSkew is 1, incoming pod can only be scheduled - to zone3 to become 1/1/1; scheduling it onto zone1(zone2) - would make the ActualSkew(2-0) on zone1(zone2) - violate MaxSkew(1). - if MaxSkew is 2, incoming - pod can be scheduled onto any zone. When `whenUnsatisfiable=ScheduleAnyway`, - it is used to give higher precedence to topologies - that satisfy it. It''s a required field. Default - value is 1 and 0 is not allowed.' - format: int32 - type: integer - topologyKey: - description: TopologyKey is the key of node labels. - Nodes that have a label with this key and identical - values are considered to be in the same topology. - We consider each as a "bucket", and - try to put balanced number of pods into each bucket. - It's a required field. - type: string - whenUnsatisfiable: - description: 'WhenUnsatisfiable indicates how to - deal with a pod if it doesn''t satisfy the spread - constraint. - DoNotSchedule (default) tells the - scheduler not to schedule it. - ScheduleAnyway - tells the scheduler to schedule the pod in any - location, but giving higher precedence to topologies - that would help reduce the skew. A constraint - is considered "Unsatisfiable" for an incoming - pod if and only if every possible node assigment - for that pod would violate "MaxSkew" on some topology. - For example, in a 3-zone cluster, MaxSkew is set - to 1, and pods with the same labelSelector spread - as 3/1/1: | zone1 | zone2 | zone3 | | P P P | P | P | - If WhenUnsatisfiable is set to DoNotSchedule, - incoming pod can only be scheduled to zone2(zone3) - to become 3/2/1(3/1/2) as ActualSkew(2-1) on zone2(zone3) - satisfies MaxSkew(1). In other words, the cluster - can still be imbalanced, but scheduler won''t - make it *more* imbalanced. It''s a required field.' - type: string - required: - - maxSkew - - topologyKey - - whenUnsatisfiable - type: object + nullable: true type: array logicalBackupSchedule: + pattern: ^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$ type: string - pattern: '^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$' maintenanceWindows: - type: array items: + pattern: ^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ + *$ type: string - pattern: '^\ *((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))-((Mon|Tue|Wed|Thu|Fri|Sat|Sun):(2[0-3]|[01]?\d):([0-5]?\d)|(2[0-3]|[01]?\d):([0-5]?\d))\ *$' + type: array masterServiceAnnotations: - type: object additionalProperties: type: string - nodeAffinity: type: object + monitor: + nullable: true + properties: + image: + type: string + type: object + nodeAffinity: properties: preferredDuringSchedulingIgnoredDuringExecution: - type: array items: - type: object - required: - - preference - - weight properties: preference: - type: object properties: matchExpressions: - type: array items: - type: object - required: - - key - - operator properties: key: type: string operator: type: string values: - type: array items: type: string - matchFields: - type: array - items: - type: object + type: array required: - key - operator + type: object + type: array + matchFields: + items: properties: key: type: string operator: type: string values: - type: array items: type: string + type: array + required: + - key + - operator + type: object + type: array + type: object weight: format: int32 type: integer + required: + - preference + - weight + type: object + type: array requiredDuringSchedulingIgnoredDuringExecution: - type: object - required: - - nodeSelectorTerms properties: nodeSelectorTerms: - type: array items: - type: object properties: matchExpressions: - type: array items: - type: object - required: - - key - - operator properties: key: type: string operator: type: string values: - type: array items: type: string - matchFields: - type: array - items: - type: object + type: array required: - key - operator + type: object + type: array + matchFields: + items: properties: key: type: string operator: type: string values: - type: array items: type: string + type: array + required: + - key + - operator + type: object + type: array + type: object + type: array + required: + - nodeSelectorTerms + type: object + type: object numberOfInstances: - type: integer minimum: 0 + type: integer patroni: - type: object properties: failsafe_mode: type: boolean initdb: - type: object additionalProperties: type: string + type: object loop_wait: type: integer maximum_lag_on_failover: type: integer pg_hba: - type: array items: type: string + type: array retry_timeout: type: integer slots: - type: object additionalProperties: - type: object additionalProperties: type: string + type: object + type: object synchronous_mode: type: boolean synchronous_mode_strict: @@ -467,129 +482,102 @@ spec: type: integer ttl: type: integer - podAnnotations: type: object - additionalProperties: - type: string pod_priority_class_name: - type: string description: deprecated + type: string + podAnnotations: + additionalProperties: + type: string + type: object podPriorityClassName: type: string postgresql: - type: object - required: - - version properties: - version: - type: string - enum: - - "13" - - "14" - - "15" - - "16" parameters: - type: object additionalProperties: type: string - preparedDatabases: + type: object + version: + enum: + - "12" + - "13" + - "14" + - "15" + - "16" + type: string + required: + - version type: object + preparedDatabases: additionalProperties: - type: object properties: defaultUsers: type: boolean extensions: - type: object additionalProperties: type: string - schemas: type: object + schemas: additionalProperties: - type: object properties: - defaultUsers: - type: boolean defaultRoles: type: boolean + defaultUsers: + type: boolean + type: object + type: object secretNamespace: type: string + type: object + type: object replicaLoadBalancer: - type: boolean description: deprecated + type: boolean replicaServiceAnnotations: - type: object additionalProperties: type: string - resources: type: object + resources: properties: limits: - type: object properties: cpu: + pattern: ^(\d+m|\d+(\.\d{1,3})?)$ type: string - # 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. memory: + pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$ type: string - # 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 - 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. - requests: type: object + requests: properties: cpu: + pattern: ^(\d+m|\d+(\.\d{1,3})?)$ type: string - pattern: '^(\d+m|\d+(\.\d{1,3})?)$' memory: + pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$ type: string - pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$' + type: object + type: object schedulerName: type: string serviceAnnotations: - type: object additionalProperties: type: string + type: object sidecars: - type: array - nullable: true items: type: object x-kubernetes-preserve-unknown-fields: true - spiloRunAsUser: + nullable: true + type: array + spiloFSGroup: type: integer spiloRunAsGroup: type: integer - spiloFSGroup: + spiloRunAsUser: type: integer standby: - type: object - properties: - s3_wal_path: - type: string - gs_wal_path: - type: string - standby_host: - type: string - standby_port: - type: string oneOf: - required: - s3_wal_path @@ -597,14 +585,18 @@ spec: - gs_wal_path - required: - standby_host + properties: + gs_wal_path: + type: string + s3_wal_path: + type: string + standby_host: + type: string + standby_port: + type: string + type: object streams: - type: array items: - type: object - required: - - applicationId - - database - - tables properties: applicationId: type: string @@ -615,15 +607,11 @@ spec: enableRecovery: type: boolean filter: - type: object additionalProperties: type: string - tables: type: object + tables: additionalProperties: - type: object - required: - - eventType properties: eventType: type: string @@ -633,55 +621,73 @@ spec: type: string recoveryEventType: type: string + required: + - eventType + type: object + type: object + required: + - applicationId + - database + - tables + type: object + type: array + tde: + nullable: true + properties: + enable: + type: boolean + type: object teamId: type: string tls: - type: object - required: - - secretName properties: - secretName: + caFile: + type: string + caSecretName: type: string certificateFile: type: string privateKeyFile: type: string - caFile: - type: string - caSecretName: + secretName: type: string + required: + - secretName + type: object tolerations: - type: array items: - type: object properties: + effect: + enum: + - NoExecute + - NoSchedule + - PreferNoSchedule + type: string key: type: string operator: - type: string enum: - - Equal - - Exists - value: - type: string - effect: + - Equal + - Exists type: string - enum: - - NoExecute - - NoSchedule - - PreferNoSchedule tolerationSeconds: type: integer + value: + type: string + type: object + type: array + topologySpreadConstraints: + items: + type: object + x-kubernetes-preserve-unknown-fields: true + nullable: true + type: array useLoadBalancer: - type: boolean description: deprecated + type: boolean users: - type: object additionalProperties: - type: array - nullable: true items: - type: string enum: - bypassrls - BYPASSRLS @@ -711,159 +717,79 @@ spec: - SUPERUSER - nosuperuser - NOSUPERUSER + type: string + nullable: true + type: array + type: object usersWithInPlaceSecretRotation: - type: array - nullable: true items: type: string - usersWithSecretRotation: - type: array nullable: true + type: array + usersWithSecretRotation: items: type: string + nullable: true + type: array volume: - type: object - required: - - size properties: iops: type: integer selector: - type: object properties: matchExpressions: - type: array items: - type: object - required: - - key - - operator properties: key: type: string operator: - type: string enum: - - DoesNotExist - - Exists - - In - - NotIn + - DoesNotExist + - Exists + - In + - NotIn + type: string values: - type: array items: type: string + type: array + required: + - key + - operator + type: object + type: array matchLabels: type: object x-kubernetes-preserve-unknown-fields: true + type: object size: + pattern: ^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$ type: string - pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$' - # Note: the value specified here must not be zero. storageClass: type: string subPath: type: string throughput: type: integer - backup: + required: + - size type: object - properties: - pgbackrest: - type: object - properties: - image: - type: string - configuration: - type: object - properties: - secret: - type: string - protection: - type: object - properties: - restore: - type: boolean - global: - type: object - additionalProperties: - type: string - repos: - type: array - items: - properties: - name: - type: string - pattern: ^repo[1-4]$ - storage: - type: string - enum: - - "s3" - - "gcs" - - "azure" - - "pvc" - resource: - type: string - endpoint: - type: string - region: - type: string - schedule: - type: object - properties: - full: - type: string - incr: - type: string - diff: - type: string - Pvcsize: - type: string - required: - - name - - storage - - resource - type: object - minItems: 1 - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map - restore: - type: object - properties: - id: - type: string - repo: - type: string - pattern: ^repo[1-4]$ - options: - type: object - additionalProperties: - type: string - resources: - type: object - properties: - limits: - type: object - properties: - cpu: - type: string - pattern: '^(\d+m|\d+(\.\d{1,3})?)$' - memory: - type: string - pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$' - requests: - type: object - properties: - cpu: - type: string - pattern: '^(\d+m|\d+(\.\d{1,3})?)$' - memory: - type: string - pattern: '^(\d+(e\d+)?|\d+(\.\d+)?(e\d+)?[EPTGMK]i?)$' - required: - - image - - repos - status: + required: + - numberOfInstances + - teamId + - postgresql + - volume type: object + status: additionalProperties: type: string + type: object + required: + - kind + - apiVersion + - spec + type: object + served: true + storage: true + subresources: + status: {}