SGDbOps.yaml 94 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045
  1. apiVersion: apiextensions.k8s.io/v1
  2. kind: CustomResourceDefinition
  3. metadata:
  4. name: sgdbops.stackgres.io
  5. spec:
  6. group: stackgres.io
  7. scope: Namespaced
  8. names:
  9. kind: SGDbOps
  10. listKind: SGDbOpsList
  11. plural: sgdbops
  12. singular: sgdbops
  13. shortNames:
  14. - sgdo
  15. versions:
  16. - name: v1
  17. served: true
  18. storage: true
  19. additionalPrinterColumns:
  20. - name: cluster
  21. type: string
  22. jsonPath: .spec.sgCluster
  23. - name: operation
  24. type: string
  25. jsonPath: .spec.op
  26. - name: status
  27. type: string
  28. jsonPath: .status.conditions[?(@.status=="True")].reason
  29. - name: started-at
  30. type: string
  31. jsonPath: .status.opStarted
  32. priority: 1
  33. - name: retries
  34. type: string
  35. jsonPath: .status.opRetries
  36. priority: 1
  37. schema:
  38. openAPIV3Schema:
  39. required: ["metadata", "spec"]
  40. type: object
  41. properties:
  42. metadata:
  43. type: object
  44. properties:
  45. name:
  46. type: string
  47. maxLength: 57
  48. pattern: "^[a-z]([-a-z0-9]*[a-z0-9])?$"
  49. description: |
  50. Name of the Database Operation. A database operation represents a ""kind"" of operation on a StackGres cluster, classified by a given name. The operation reference one SGCluster by its name. Following [Kubernetes naming conventions](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/architecture/identifiers.md), it must be an rfc1035/rfc1123 `label`, an alphanumeric (a-z, and 0-9) string, with the '-' character allowed anywhere except the first or last character.
  51. The name must be unique across all database operations in the same namespace."
  52. spec:
  53. type: object
  54. properties:
  55. sgCluster:
  56. type: string
  57. description: |
  58. The name of SGCluster on which the operation will be performed.
  59. scheduling:
  60. type: object
  61. description: Pod custom node scheduling and affinity configuration
  62. properties:
  63. nodeSelector:
  64. type: object
  65. additionalProperties:
  66. type: string
  67. description: |
  68. NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. More info: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/
  69. tolerations: &tolerations #!jq_placeholder .definitions["io.k8s.api.core.v1.PodSpec"].properties.tolerations #toleration-v1-core
  70. {"description":"If specified, the pod's tolerations.\n\nSee https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#toleration-v1-core","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":{"effect":{"description":"Effect indicates the taint effect to match. Empty means match all taint effects. When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.","type":"string"},"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"},"operator":{"description":"Operator represents a key's relationship to the value. 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"},"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"},"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":"object"},"type":"array"}
  71. nodeAffinity: &node-affinity #!jq_placeholder .definitions["io.k8s.api.core.v1.PodSpec"].properties.affinity.properties.nodeAffinity #nodeaffinity-v1-core
  72. {"description":"Node affinity is a group of node affinity scheduling rules.\n\nSee https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#nodeaffinity-v1-core","properties":{"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":{"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":{"preference":{"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":{"matchExpressions":{"description":"A list of node selector requirements by node's labels.","items":{"description":"A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","properties":{"key":{"description":"The label key that the selector applies to.","type":"string"},"operator":{"description":"Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.","type":"string"},"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":{"type":"string"},"type":"array"}},"required":["key","operator"],"type":"object"},"type":"array"},"matchFields":{"description":"A list of node selector requirements by node's fields.","items":{"description":"A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","properties":{"key":{"description":"The label key that the selector applies to.","type":"string"},"operator":{"description":"Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.","type":"string"},"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":{"type":"string"},"type":"array"}},"required":["key","operator"],"type":"object"},"type":"array"}},"type":"object"},"weight":{"description":"Weight associated with matching the corresponding nodeSelectorTerm, in the range 1-100.","format":"int32","type":"integer"}},"required":["weight","preference"],"type":"object"},"type":"array"},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.","properties":{"nodeSelectorTerms":{"description":"Required. A list of node selector terms. The terms are ORed.","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":{"matchExpressions":{"description":"A list of node selector requirements by node's labels.","items":{"description":"A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","properties":{"key":{"description":"The label key that the selector applies to.","type":"string"},"operator":{"description":"Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.","type":"string"},"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":{"type":"string"},"type":"array"}},"required":["key","operator"],"type":"object"},"type":"array"},"matchFields":{"description":"A list of node selector requirements by node's fields.","items":{"description":"A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.","properties":{"key":{"description":"The label key that the selector applies to.","type":"string"},"operator":{"description":"Represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.","type":"string"},"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":{"type":"string"},"type":"array"}},"required":["key","operator"],"type":"object"},"type":"array"}},"type":"object"},"type":"array"}},"required":["nodeSelectorTerms"],"type":"object"}},"type":"object"}
  73. priorityClassName: &priority-class-name #!jq_placeholder .definitions["io.k8s.api.core.v1.PodSpec"].properties.priorityClassName
  74. {"description":"If specified, indicates the pod's priority. \"system-node-critical\" and \"system-cluster-critical\" are two special keywords which indicate the highest priorities with the former being the highest priority. Any other name must be defined by creating a PriorityClass object with that name. If not specified, the pod priority will be default or zero if there is no default.","type":"string"}
  75. podAffinity: &pod-affinity #!jq_placeholder .definitions["io.k8s.api.core.v1.PodSpec"].properties.affinity.properties.podAffinity #podaffinity-v1-core
  76. {"description":"Pod affinity is a group of inter pod affinity scheduling rules.\n\nSee https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#podaffinity-v1-core","properties":{"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 has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","items":{"description":"The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)","properties":{"podAffinityTerm":{"description":"Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key <topologyKey> matches that of any node on which a pod of the set of pods is running","properties":{"labelSelector":{"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":{"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"},"matchLabelKeys":{"description":"MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. Also, MatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.","items":{"type":"string"},"type":"array"},"mismatchLabelKeys":{"description":"MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector. Also, MismatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.","items":{"type":"string"},"type":"array"},"namespaceSelector":{"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":{"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"},"namespaces":{"description":"namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\".","items":{"type":"string"},"type":"array"},"topologyKey":{"description":"This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.","type":"string"}},"required":["topologyKey"],"type":"object"},"weight":{"description":"weight associated with matching the corresponding podAffinityTerm, in the range 1-100.","format":"int32","type":"integer"}},"required":["weight","podAffinityTerm"],"type":"object"},"type":"array"},"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 a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","items":{"description":"Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key <topologyKey> matches that of any node on which a pod of the set of pods is running","properties":{"labelSelector":{"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":{"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"},"matchLabelKeys":{"description":"MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. Also, MatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.","items":{"type":"string"},"type":"array"},"mismatchLabelKeys":{"description":"MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector. Also, MismatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.","items":{"type":"string"},"type":"array"},"namespaceSelector":{"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":{"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"},"namespaces":{"description":"namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\".","items":{"type":"string"},"type":"array"},"topologyKey":{"description":"This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.","type":"string"}},"required":["topologyKey"],"type":"object"},"type":"array"}},"type":"object"}
  77. podAntiAffinity: &pod-anti-affinity #!jq_placeholder .definitions["io.k8s.api.core.v1.PodSpec"].properties.affinity.properties.podAntiAffinity #podantiaffinity-v1-core
  78. {"description":"Pod anti affinity is a group of inter pod anti affinity scheduling rules.\n\nSee https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#podantiaffinity-v1-core","properties":{"preferredDuringSchedulingIgnoredDuringExecution":{"description":"The scheduler will prefer to schedule pods to nodes that satisfy the anti-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 anti-affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node has pods which matches the corresponding podAffinityTerm; the node(s) with the highest sum are the most preferred.","items":{"description":"The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)","properties":{"podAffinityTerm":{"description":"Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key <topologyKey> matches that of any node on which a pod of the set of pods is running","properties":{"labelSelector":{"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":{"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"},"matchLabelKeys":{"description":"MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. Also, MatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.","items":{"type":"string"},"type":"array"},"mismatchLabelKeys":{"description":"MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector. Also, MismatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.","items":{"type":"string"},"type":"array"},"namespaceSelector":{"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":{"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"},"namespaces":{"description":"namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\".","items":{"type":"string"},"type":"array"},"topologyKey":{"description":"This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.","type":"string"}},"required":["topologyKey"],"type":"object"},"weight":{"description":"weight associated with matching the corresponding podAffinityTerm, in the range 1-100.","format":"int32","type":"integer"}},"required":["weight","podAffinityTerm"],"type":"object"},"type":"array"},"requiredDuringSchedulingIgnoredDuringExecution":{"description":"If the anti-affinity requirements specified by this field are not met at scheduling time, the pod will not be scheduled onto the node. If the anti-affinity requirements specified by this field cease to be met at some point during pod execution (e.g. due to a pod label update), the system may or may not try to eventually evict the pod from its node. When there are multiple elements, the lists of nodes corresponding to each podAffinityTerm are intersected, i.e. all terms must be satisfied.","items":{"description":"Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key <topologyKey> matches that of any node on which a pod of the set of pods is running","properties":{"labelSelector":{"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":{"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"},"matchLabelKeys":{"description":"MatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key in (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MatchLabelKeys and LabelSelector. Also, MatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.","items":{"type":"string"},"type":"array"},"mismatchLabelKeys":{"description":"MismatchLabelKeys is a set of pod label keys to select which pods will be taken into consideration. The keys are used to lookup values from the incoming pod labels, those key-value labels are merged with `LabelSelector` as `key notin (value)` to select the group of existing pods which pods will be taken into consideration for the incoming pod's pod (anti) affinity. Keys that don't exist in the incoming pod labels will be ignored. The default value is empty. The same key is forbidden to exist in both MismatchLabelKeys and LabelSelector. Also, MismatchLabelKeys cannot be set when LabelSelector isn't set. This is an alpha field and requires enabling MatchLabelKeysInPodAffinity feature gate.","items":{"type":"string"},"type":"array"},"namespaceSelector":{"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":{"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"},"namespaces":{"description":"namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means \"this pod's namespace\".","items":{"type":"string"},"type":"array"},"topologyKey":{"description":"This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. Empty topologyKey is not allowed.","type":"string"}},"required":["topologyKey"],"type":"object"},"type":"array"}},"type":"object"}
  79. op:
  80. type: string
  81. description: |
  82. The kind of operation that will be performed on the SGCluster. Available operations are:
  83. * `benchmark`: run a benchmark on the specified SGCluster and report the results in the status.
  84. * `vacuum`: perform a [vacuum](https://www.postgresql.org/docs/current/sql-vacuum.html) operation on the specified SGCluster.
  85. * `repack`: run [`pg_repack`](https://github.com/reorg/pg_repack) command on the specified SGCluster.
  86. * `majorVersionUpgrade`: perform a major version upgrade of PostgreSQL using [`pg_upgrade`](https://www.postgresql.org/docs/current/pgupgrade.html) command.
  87. * `restart`: perform a restart of the cluster.
  88. * `minorVersionUpgrade`: perform a minor version upgrade of PostgreSQL.
  89. * `securityUpgrade`: perform a security upgrade of the cluster.
  90. runAt:
  91. type: string
  92. description: |
  93. An ISO 8601 date, that holds UTC scheduled date of the operation execution.
  94. If not specified or if the date it's in the past, it will be interpreted ASAP.
  95. timeout:
  96. type: string
  97. description: |
  98. An ISO 8601 duration in the format `PnDTnHnMn.nS`, that specifies a timeout after which the operation execution will be canceled.
  99. If the operation can not be performed due to timeout expiration, the condition `Failed` will have a status of `True` and the reason will be `OperationTimedOut`.
  100. If not specified the operation will never fail for timeout expiration.
  101. maxRetries:
  102. type: integer
  103. description: |
  104. The maximum number of retries the operation is allowed to do after a failure.
  105. A value of `0` (zero) means no retries are made. Defaults to: `0`.
  106. benchmark:
  107. type: object
  108. description: |
  109. Configuration of the benchmark
  110. properties:
  111. type:
  112. type: string
  113. description: |
  114. The type of benchmark that will be performed on the SGCluster. Available benchmarks are:
  115. * `pgbench`: run [pgbench](https://www.postgresql.org/docs/current/pgbench.html) on the specified SGCluster and report the results in the status.
  116. * `sampling`: samples real queries and store them in the SGDbOps status in order to be used by a `pgbench` benchmark using `replay` mode.
  117. database:
  118. type: string
  119. description: |
  120. When specified will indicate the database where the benchmark will run upon.
  121. If not specified a target database with a random name will be created and removed after the benchmark completes.
  122. credentials:
  123. type: object
  124. description: The credentials of the user that will be used by the benchmark
  125. required: ["username","password"]
  126. properties:
  127. username:
  128. type: object
  129. description: |
  130. The username that will be used by the benchmark.
  131. If not specified the default superuser username (by default postgres) will be used.
  132. required: ["name", "key"]
  133. properties:
  134. name:
  135. type: string
  136. description: |
  137. The Secret name where the username is stored.
  138. key:
  139. type: string
  140. description: |
  141. The Secret key where the username is stored.
  142. password:
  143. type: object
  144. description: |
  145. The password that will be used by the benchmark
  146. If not specified the default superuser password will be used.
  147. required: ["name", "key"]
  148. properties:
  149. name:
  150. type: string
  151. description: |
  152. The Secret name where the password is stored.
  153. key:
  154. type: string
  155. description: |
  156. The Secret key where the password is stored.
  157. sampling:
  158. type: object
  159. description: |
  160. Configuration of sampling benchmark.
  161. required: [ targetDatabase, topQueriesCollectDuration, samplingDuration ]
  162. properties:
  163. targetDatabase:
  164. type: string
  165. description: |
  166. The target database to be sampled. By default `postgres`.
  167. The benchmark database will be used to store the sampled queries but user must specify a target database to be sampled in the `sampling` section.
  168. topQueriesCollectDuration:
  169. type: string
  170. description: An ISO 8601 duration in the format `PnDTnHnMn.nS`, that specifies how long the to wait before selecting top queries in order to collect enough stats.
  171. samplingDuration:
  172. type: string
  173. description: An ISO 8601 duration in the format `PnDTnHnMn.nS`, that specifies how long will last the sampling of real queries that will be replayed later.
  174. mode:
  175. type: string
  176. description: |
  177. The mode used to select the top queries used for sampling:
  178. * `time`: The top queries will be selected among the most slow queries.
  179. * `calls`: The top queries will be selected among the most called queries.
  180. * `custom`: The `customTopQueriesQuery` will be used to select top queries.
  181. topQueriesFilter:
  182. type: string
  183. description: Regular expression for filtering representative statements when selecting top queries. Will be ignored if `mode` is set to `custom`. By default is `^ *(with|select) `. See https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP
  184. topQueriesPercentile:
  185. type: integer
  186. description: Percentile of queries to consider as part of the top queries. Will be ignored if `mode` is set to `custom`. By default `95`.
  187. topQueriesMin:
  188. type: integer
  189. description: Minimum number of queries to consider as part of the top queries. By default `5`.
  190. customTopQueriesQuery:
  191. type: string
  192. description: |
  193. The query used to select top queries. Will be ignored if `mode` is not set to `custom`.
  194. The query must return at most 2 columns:
  195. * First column returned by the query must be a column holding the query identifier, also available in pg_stat_activity (column `query_id`) and pg_stat_statements (column `queryid`).
  196. * Second column is optional and, if returned, must hold a json object containing only text keys and values stat will be used to generate the stats.
  197. See also:
  198. * https://www.postgresql.org/docs/current/monitoring-stats.html#MONITORING-PG-STAT-ACTIVITY-VIEW
  199. * https://www.postgresql.org/docs/current/pgstatstatements.html#PGSTATSTATEMENTS-PG-STAT-STATEMENTS
  200. queries:
  201. type: integer
  202. description: Number of sampled queries to include in the result. By default `10`.
  203. omitTopQueriesInStatus:
  204. type: boolean
  205. description: When `true` omit to include the top queries stats in the SGDbOps status. By default `false`.
  206. samplingMinInterval:
  207. type: integer
  208. description: Minimum number of microseconds the sampler will wait between each sample is taken. By default `10000` (10 milliseconds).
  209. pgbench:
  210. type: object
  211. description: |
  212. Configuration of [pgbench](https://www.postgresql.org/docs/current/pgbench.html) benchmark
  213. properties:
  214. mode:
  215. type: string
  216. description: |
  217. The pgbench benchmark type:
  218. * `tpcb-like`: The benchmark is inspired by the [TPC-B benchmark](https://www.tpc.org/TPC_Documents_Latest_Versions/TPC-B_v2.0.0.pdf). It is the default mode when `connectionType` is set to `primary-service`.
  219. * `select-only`: The `tpcb-like` but only using SELECTs commands. It is the default mode when `connectionType` is set to `replicas-service`.
  220. * `custom`: will use the scripts in the `custom` section to initialize and and run commands for the benchmark.
  221. * `replay`: will replay the sampled queries of a sampling benchmark SGDbOps. If the `custom` section is specified it will be used instead. Queries can be referenced setting `custom.scripts.replay` to the index of the query in the sampling benchmark SGDbOps's status (index start from 0).
  222. See also https://www.postgresql.org/docs/current/pgbench.html#TRANSACTIONS-AND-SCRIPTS
  223. databaseSize:
  224. type: string
  225. pattern: '^[0-9]+(\.[0-9]+)?(Mi|Gi|Ti)$'
  226. description: |
  227. Size of the database to generate. This size is specified either in Mebibytes, Gibibytes or Tebibytes (multiples of 2^20, 2^30 or 2^40, respectively).
  228. duration:
  229. type: string
  230. description: |
  231. An ISO 8601 duration in the format `PnDTnHnMn.nS`, that specifies how long the benchmark will run.
  232. usePreparedStatements:
  233. type: boolean
  234. description: |
  235. **Deprecated** this field is ignored, use `queryMode` instead.
  236. Use extended query protocol with prepared statements. Defaults to: `false`.
  237. queryMode:
  238. type: string
  239. description: |
  240. Protocol to use for submitting queries to the server:
  241. * `simple`: use simple query protocol.
  242. * `extended`: use extended query protocol.
  243. * `prepared`: use extended query protocol with prepared statements.
  244. In the prepared mode, pgbench reuses the parse analysis result starting from the second query iteration, so pgbench runs faster than in other modes.
  245. The default is `simple` query protocol. See also https://www.postgresql.org/docs/current/protocol.html
  246. concurrentClients:
  247. type: integer
  248. description: |
  249. Number of clients simulated, that is, number of concurrent database sessions. Defaults to: `1`.
  250. threads:
  251. type: integer
  252. description: |
  253. Number of worker threads within pgbench. Using more than one thread can be helpful on multi-CPU machines. Clients are distributed as evenly as possible among available threads. Default is `1`.
  254. samplingRate:
  255. type: number
  256. description: |
  257. Sampling rate, used when collecting data, to reduce the amount of collected data. If this option is given, only the specified fraction of transactions are collected. 1.0 means all transactions will be logged, 0.05 means only 5% of the transactions will be logged.
  258. foreignKeys:
  259. type: boolean
  260. description: |
  261. Create foreign key constraints between the standard tables. (This option only take effect if `custom.initiailization` is not specified).
  262. unloggedTables:
  263. type: boolean
  264. description: |
  265. Create all tables as unlogged tables, rather than permanent tables. (This option only take effect if `custom.initiailization` is not specified).
  266. partitionMethod:
  267. type: string
  268. description: |
  269. Create a partitioned pgbench_accounts table with the specified method. Expected values are `range` or `hash`. This option requires that partitions is set to non-zero. If unspecified, default is `range`. (This option only take effect if `custom.initiailization` is not specified).
  270. partitions:
  271. type: integer
  272. description: |
  273. Create a partitioned pgbench_accounts table with the specified number of partitions of nearly equal size for the scaled number of accounts. Default is 0, meaning no partitioning. (This option only take effect if `custom.initiailization` is not specified).
  274. initSteps:
  275. type: string
  276. description: |
  277. Perform just a selected set of the normal initialization steps. init_steps specifies the initialization steps to be performed, using one character per step. Each step is invoked in the specified order. The default is dtgvp. The available steps are:
  278. * `d` (Drop): Drop any existing pgbench tables.
  279. * `t` (create Tables): Create the tables used by the standard pgbench scenario, namely pgbench_accounts, pgbench_branches, pgbench_history, and pgbench_tellers.
  280. * `g` or `G` (Generate data, client-side or server-side): Generate data and load it into the standard tables, replacing any data already present.
  281. With `g` (client-side data generation), data is generated in pgbench client and then sent to the server. This uses the client/server bandwidth extensively through a COPY. pgbench uses the FREEZE option with version 14 or later of PostgreSQL to speed up subsequent VACUUM, unless partitions are enabled. Using g causes logging to print one message every 100,000 rows while generating data for the pgbench_accounts table.
  282. With `G` (server-side data generation), only small queries are sent from the pgbench client and then data is actually generated in the server. No significant bandwidth is required for this variant, but the server will do more work. Using G causes logging not to print any progress message while generating data.
  283. The default initialization behavior uses client-side data generation (equivalent to g).
  284. * `v` (Vacuum): Invoke VACUUM on the standard tables.
  285. * `p` (create Primary keys): Create primary key indexes on the standard tables.
  286. * `f` (create Foreign keys): Create foreign key constraints between the standard tables. (Note that this step is not performed by default.)
  287. fillfactor:
  288. type: integer
  289. description: |
  290. Create the pgbench_accounts, pgbench_tellers and pgbench_branches tables with the given fillfactor. Default is 100.
  291. noVacuum:
  292. type: boolean
  293. description: |
  294. Perform no vacuuming during initialization. (This option suppresses the `v` initialization step, even if it was specified in `initSteps`.)
  295. samplingSGDbOps:
  296. type: string
  297. description: benchmark SGDbOps of type sampling that will be used to replay sampled queries.
  298. custom:
  299. type: object
  300. description: This section allow to configure custom SQL for initialization and scripts used by pgbench.
  301. properties:
  302. initialization:
  303. type: object
  304. description: |
  305. The custom SQL for initialization that will be executed in place of pgbench default initialization.
  306. If not specified the default pgbench initialization will be performed instead.
  307. properties: &script-properties
  308. script:
  309. type: string
  310. description: |
  311. Raw SQL script to execute. This field is mutually exclusive with `scriptFrom` field.
  312. scriptFrom:
  313. type: object
  314. description: |
  315. Reference to either a Kubernetes [Secret](https://kubernetes.io/docs/concepts/configuration/secret/) or a [ConfigMap](https://kubernetes.io/docs/concepts/configuration/configmap/) that contains the SQL script to execute. This field is mutually exclusive with `script` field.
  316. Fields `secretKeyRef` and `configMapKeyRef` are mutually exclusive, and one of them is required.
  317. properties:
  318. secretKeyRef:
  319. type: object
  320. description: |
  321. A Kubernetes [SecretKeySelector](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#secretkeyselector-v1-core) that contains the SQL script to execute. This field is mutually exclusive with `configMapKeyRef` field.
  322. properties:
  323. name:
  324. type: string
  325. description: Name of the referent. [More information](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
  326. key:
  327. type: string
  328. description: The key of the secret to select from. Must be a valid secret key.
  329. configMapKeyRef:
  330. type: object
  331. description: |
  332. A [ConfigMap](https://kubernetes.io/docs/concepts/configuration/configmap/) reference that contains the SQL script to execute. This field is mutually exclusive with `secretKeyRef` field.
  333. properties:
  334. name:
  335. type: string
  336. description: |
  337. The name of the ConfigMap that contains the SQL script to execute.
  338. key:
  339. type: string
  340. description: |
  341. The key name within the ConfigMap that contains the SQL script to execute.
  342. scripts:
  343. type: array
  344. description: The custom SQL scripts that will be executed by pgbench during the benchmark instead of default pgbench scripts
  345. minItems: 1
  346. items:
  347. type: object
  348. description: A custom SQL script that will be executed by pgbench during the benchmark instead of default pgbench scripts
  349. properties:
  350. <<: *script-properties
  351. builtin:
  352. type: string
  353. description: |
  354. The name of the builtin script to use. See https://www.postgresql.org/docs/current/pgbench.html#PGBENCH-OPTION-BUILTIN
  355. When specified fields `replay`, `script` and `scriptFrom` must not be set.
  356. replay:
  357. type: integer
  358. description: |
  359. The index of the query in the sampling benchmark SGDbOps's status (index start from 0).
  360. When specified fields `builtin`, `script` and `scriptFrom` must not be set.
  361. weight:
  362. type: integer
  363. description: The weight of this custom SQL script.
  364. required: [ "databaseSize", "duration" ]
  365. connectionType:
  366. type: string
  367. description: |
  368. Specify the service where the benchmark will connect to:
  369. * `primary-service`: Connect to the primary service
  370. * `replicas-service`: Connect to the replicas service
  371. required: [ "type" ]
  372. vacuum:
  373. type: object
  374. description: |
  375. Configuration of [vacuum](https://www.postgresql.org/docs/current/sql-vacuum.html) operation
  376. properties:
  377. full:
  378. type: boolean
  379. description: |
  380. If true selects "full" vacuum, which can reclaim more space, but takes much longer and exclusively locks the table.
  381. This method also requires extra disk space, since it writes a new copy of the table and doesn't release the old copy
  382. until the operation is complete. Usually this should only be used when a significant amount of space needs to be
  383. reclaimed from within the table. Defaults to: `false`.
  384. freeze:
  385. type: boolean
  386. description: |
  387. If true selects aggressive "freezing" of tuples. Specifying FREEZE is equivalent to performing VACUUM with the
  388. vacuum_freeze_min_age and vacuum_freeze_table_age parameters set to zero. Aggressive freezing is always performed
  389. when the table is rewritten, so this option is redundant when FULL is specified. Defaults to: `false`.
  390. analyze:
  391. type: boolean
  392. description: |
  393. If true, updates statistics used by the planner to determine the most efficient way to execute a query. Defaults to: `true`.
  394. disablePageSkipping:
  395. type: boolean
  396. description: |
  397. Normally, VACUUM will skip pages based on the visibility map. Pages where all tuples are known to be frozen can always be
  398. skipped, and those where all tuples are known to be visible to all transactions may be skipped except when performing an
  399. aggressive vacuum. Furthermore, except when performing an aggressive vacuum, some pages may be skipped in order to avoid
  400. waiting for other sessions to finish using them. This option disables all page-skipping behavior, and is intended to be
  401. used only when the contents of the visibility map are suspect, which should happen only if there is a hardware or
  402. software issue causing database corruption. Defaults to: `false`.
  403. databases:
  404. type: array
  405. description: |
  406. List of databases to vacuum or repack, don't specify to select all databases
  407. items:
  408. type: object
  409. required: [ "name" ]
  410. properties:
  411. name:
  412. type: string
  413. description: the name of the database
  414. full:
  415. type: boolean
  416. description: |
  417. If true selects "full" vacuum, which can reclaim more space, but takes much longer and exclusively locks the table.
  418. This method also requires extra disk space, since it writes a new copy of the table and doesn't release the old copy
  419. until the operation is complete. Usually this should only be used when a significant amount of space needs to be
  420. reclaimed from within the table. Defaults to: `false`.
  421. freeze:
  422. type: boolean
  423. description: |
  424. If true selects aggressive "freezing" of tuples. Specifying FREEZE is equivalent to performing VACUUM with the
  425. vacuum_freeze_min_age and vacuum_freeze_table_age parameters set to zero. Aggressive freezing is always performed
  426. when the table is rewritten, so this option is redundant when FULL is specified. Defaults to: `false`.
  427. analyze:
  428. type: boolean
  429. description: |
  430. If true, updates statistics used by the planner to determine the most efficient way to execute a query. Defaults to: `true`.
  431. disablePageSkipping:
  432. type: boolean
  433. description: |
  434. Normally, VACUUM will skip pages based on the visibility map. Pages where all tuples are known to be frozen can always be
  435. skipped, and those where all tuples are known to be visible to all transactions may be skipped except when performing an
  436. aggressive vacuum. Furthermore, except when performing an aggressive vacuum, some pages may be skipped in order to avoid
  437. waiting for other sessions to finish using them. This option disables all page-skipping behavior, and is intended to be
  438. used only when the contents of the visibility map are suspect, which should happen only if there is a hardware or
  439. software issue causing database corruption. Defaults to: `false`.
  440. repack:
  441. type: object
  442. description: |
  443. Configuration of [`pg_repack`](https://github.com/reorg/pg_repack) command
  444. properties:
  445. noOrder:
  446. type: boolean
  447. description: |
  448. If true do vacuum full instead of cluster. Defaults to: `false`.
  449. waitTimeout:
  450. type: string
  451. description: |
  452. If specified, an ISO 8601 duration format `PnDTnHnMn.nS` to set a timeout to cancel other backends on conflict.
  453. noKillBackend:
  454. type: boolean
  455. description: |
  456. If true don't kill other backends when timed out. Defaults to: `false`.
  457. noAnalyze:
  458. type: boolean
  459. description: |
  460. If true don't analyze at end. Defaults to: `false`.
  461. excludeExtension:
  462. type: boolean
  463. description: |
  464. If true don't repack tables which belong to specific extension. Defaults to: `false`.
  465. databases:
  466. type: array
  467. description: |
  468. List of database to vacuum or repack, don't specify to select all databases
  469. items:
  470. type: object
  471. required: [ "name" ]
  472. properties:
  473. name:
  474. type: string
  475. description: the name of the database
  476. noOrder:
  477. type: boolean
  478. description: |
  479. If true do vacuum full instead of cluster. Defaults to: `false`.
  480. waitTimeout:
  481. type: string
  482. description: |
  483. If specified, an ISO 8601 duration format `PnDTnHnMn.nS` to set a timeout to cancel other backends on conflict.
  484. noKillBackend:
  485. type: boolean
  486. description: |
  487. If true don't kill other backends when timed out. Defaults to: `false`.
  488. noAnalyze:
  489. type: boolean
  490. description: |
  491. If true don't analyze at end. Defaults to: `false`.
  492. excludeExtension:
  493. type: boolean
  494. description: |
  495. If true don't repack tables which belong to specific extension. Defaults to: `false`.
  496. majorVersionUpgrade:
  497. type: object
  498. description: |
  499. Configuration of major version upgrade (see also [`pg_upgrade`](https://www.postgresql.org/docs/current/pgupgrade.html) command)
  500. properties:
  501. postgresVersion:
  502. type: string
  503. description: |
  504. The target postgres version that must have the same major version of the target SGCluster.
  505. postgresExtensions:
  506. type: array
  507. description: |
  508. A major version upgrade can not be performed if a required extension is not present for the target major version of the upgrade.
  509. In those cases you will have to provide the target extension version of the extension for the target major version of postgres.
  510. Beware that in some cases it is not possible to upgrade an extension alongside postgres. This is the case for PostGIS or timescaledb.
  511. In such cases you will have to upgrade the extension before or after the major version upgrade. Please make sure you read the
  512. documentation of each extension in order to understand if it is possible to upgrade it during a major version upgrade of postgres.
  513. items:
  514. type: object
  515. properties:
  516. name:
  517. type: string
  518. description: The name of the extension to deploy.
  519. publisher:
  520. type: string
  521. description: The id of the publisher of the extension to deploy. If not specified `com.ongres` will be used by default.
  522. default: com.ongres
  523. version:
  524. type: string
  525. description: The version of the extension to deploy. If not specified version of `stable` channel will be used by default and if only a version is available that one will be used.
  526. repository:
  527. type: string
  528. description: |
  529. The repository base URL from where to obtain the extension to deploy.
  530. **This section is filled by the operator.**
  531. required: ["name"]
  532. sgPostgresConfig:
  533. type: string
  534. description: |
  535. The postgres config that must have the same major version of the target postgres version.
  536. backupPath:
  537. type: string
  538. description: |
  539. The path were the backup is stored. If not set this field is filled up by the operator.
  540. When provided will indicate were the backups and WAL files will be stored.
  541. The path should be different from the current `.spec.configurations.backups[].path` value for the target `SGCluster`
  542. in order to avoid mixing WAL files of two distinct major versions of postgres.
  543. link:
  544. type: boolean
  545. description: |
  546. If true use hard links instead of copying files to the new cluster. This option is mutually exclusive with `clone`. Defaults to: `false`.
  547. clone:
  548. type: boolean
  549. description: |
  550. If true use efficient file cloning (also known as "reflinks" on some systems) instead of copying files to the new cluster.
  551. This can result in near-instantaneous copying of the data files, giving the speed advantages of `link` while leaving the old
  552. cluster untouched. This option is mutually exclusive with `link`. Defaults to: `false`.
  553. File cloning is only supported on some operating systems and file systems. If it is selected but not supported, the pg_upgrade
  554. run will error. At present, it is supported on Linux (kernel 4.5 or later) with Btrfs and XFS (on file systems created with
  555. reflink support), and on macOS with APFS.
  556. check:
  557. type: boolean
  558. description: |
  559. If true does some checks to see if the cluster can perform a major version upgrade without changing any data. Defaults to: `false`.
  560. toInstallPostgresExtensions:
  561. type: array
  562. description: |
  563. The list of Postgres extensions to install.
  564. **This section is filled by the operator.**
  565. items:
  566. type: object
  567. properties:
  568. name:
  569. type: string
  570. description: The name of the extension to install.
  571. publisher:
  572. type: string
  573. description: The id of the publisher of the extension to install.
  574. version:
  575. type: string
  576. description: The version of the extension to install.
  577. repository:
  578. type: string
  579. description: The repository base URL from where the extension will be installed from.
  580. postgresVersion:
  581. type: string
  582. description: The postgres major version of the extension to install.
  583. build:
  584. type: string
  585. description: The build version of the extension to install.
  586. extraMounts:
  587. type: array
  588. description: The extra mounts of the extension to install.
  589. items:
  590. type: string
  591. description: The extra mount of the installed extension.
  592. required: ["name", "publisher", "version", "repository", "postgresVersion"]
  593. restart:
  594. type: object
  595. description: |
  596. Configuration of restart
  597. properties:
  598. method:
  599. type: string
  600. description: |
  601. The method used to perform the restart operation. Available methods are:
  602. * `InPlace`: the in-place method does not require more resources than those that are available.
  603. In case only an instance of the StackGres cluster is present this mean the service disruption will
  604. last longer so we encourage use the reduced impact restart and especially for a production environment.
  605. * `ReducedImpact`: this procedure is the same as the in-place method but require additional
  606. resources in order to spawn a new updated replica that will be removed when the procedure completes.
  607. onlyPendingRestart:
  608. type: boolean
  609. description: |
  610. By default all Pods are restarted. Setting this option to `true` allow to restart only those Pods which
  611. are in pending restart state as detected by the operation. Defaults to: `false`.
  612. minorVersionUpgrade:
  613. type: object
  614. description: |
  615. Configuration of minor version upgrade
  616. properties:
  617. postgresVersion:
  618. type: string
  619. description: |
  620. The target postgres version that must have the same major version of the target SGCluster.
  621. method:
  622. type: string
  623. description: |
  624. The method used to perform the minor version upgrade operation. Available methods are:
  625. * `InPlace`: the in-place method does not require more resources than those that are available.
  626. In case only an instance of the StackGres cluster is present this mean the service disruption will
  627. last longer so we encourage use the reduced impact restart and especially for a production environment.
  628. * `ReducedImpact`: this procedure is the same as the in-place method but require additional
  629. resources in order to spawn a new updated replica that will be removed when the procedure completes.
  630. securityUpgrade:
  631. type: object
  632. description: |
  633. Configuration of security upgrade
  634. properties:
  635. method:
  636. type: string
  637. description: |
  638. The method used to perform the security upgrade operation. Available methods are:
  639. * `InPlace`: the in-place method does not require more resources than those that are available.
  640. In case only an instance of the StackGres cluster is present this mean the service disruption will
  641. last longer so we encourage use the reduced impact restart and especially for a production environment.
  642. * `ReducedImpact`: this procedure is the same as the in-place method but require additional
  643. resources in order to spawn a new updated replica that will be removed when the procedure completes.
  644. required: ["sgCluster", "op"]
  645. status:
  646. type: object
  647. properties:
  648. conditions:
  649. type: array
  650. description: |
  651. Possible conditions are:
  652. * Running: to indicate when the operation is actually running
  653. * Completed: to indicate when the operation has completed successfully
  654. * Failed: to indicate when the operation has failed
  655. items:
  656. type: object
  657. properties:
  658. lastTransitionTime:
  659. description: Last time the condition transitioned from one status to another.
  660. type: string
  661. message:
  662. description: A human-readable message indicating details about the transition.
  663. type: string
  664. reason:
  665. description: The reason for the condition last transition.
  666. type: string
  667. status:
  668. description: Status of the condition, one of `True`, `False` or `Unknown`.
  669. type: string
  670. type:
  671. description: Type of deployment condition.
  672. type: string
  673. opRetries:
  674. type: integer
  675. description: |
  676. The number of retries performed by the operation
  677. opStarted:
  678. type: string
  679. description: |
  680. The ISO 8601 timestamp of when the operation started running
  681. benchmark:
  682. type: object
  683. description: |
  684. The results of the benchmark
  685. properties:
  686. sampling:
  687. type: object
  688. description: The results of the sampling benchmark
  689. properties:
  690. topQueries:
  691. type: array
  692. description: The top queries sampled with the stats from pg_stat_statements. If is omitted if `omitTopQueriesInStatus` is set to `true`.
  693. items:
  694. type: object
  695. properties:
  696. id:
  697. type: string
  698. description: The query id of the representative statement calculated by Postgres
  699. stats:
  700. type: object
  701. description: stats collected by the top queries query
  702. additionalProperties:
  703. type: string
  704. queries:
  705. type: array
  706. description: The queries sampled.
  707. items:
  708. type: object
  709. properties:
  710. id:
  711. type: string
  712. description: The query id of the representative statement calculated by Postgres
  713. query:
  714. type: string
  715. description: A sampled SQL query
  716. timestamp:
  717. type: string
  718. description: The sampled query timestamp
  719. pgbench:
  720. type: object
  721. description: The results of the pgbench benchmark
  722. properties:
  723. scaleFactor:
  724. type: number
  725. nullable: true
  726. description: |
  727. The scale factor used to run pgbench (`--scale`).
  728. transactionsProcessed:
  729. type: integer
  730. nullable: true
  731. description: |
  732. The number of transactions processed.
  733. latency:
  734. type: object
  735. description: |
  736. The latency results of the pgbench benchmark
  737. properties:
  738. average:
  739. type: object
  740. description: |
  741. Average latency of transactions
  742. properties:
  743. value:
  744. type: number
  745. nullable: true
  746. description: |
  747. The latency average value
  748. unit:
  749. type: string
  750. nullable: false
  751. description: |
  752. The latency measure unit
  753. standardDeviation:
  754. type: object
  755. description: |
  756. The latency standard deviation of transactions.
  757. properties:
  758. value:
  759. type: number
  760. nullable: true
  761. description: |
  762. The latency standard deviation value
  763. unit:
  764. type: string
  765. nullable: false
  766. description: |
  767. The latency measure unit
  768. transactionsPerSecond:
  769. type: object
  770. description: |
  771. All the transactions per second results of the pgbench benchmark
  772. properties:
  773. includingConnectionsEstablishing:
  774. type: object
  775. description: |
  776. Number of Transactions Per Second (tps) including connection establishing.
  777. properties:
  778. value:
  779. type: number
  780. description: |
  781. The Transactions Per Second (tps) including connections establishing value
  782. unit:
  783. type: string
  784. description: |
  785. Transactions Per Second (tps) measure unit
  786. excludingConnectionsEstablishing:
  787. type: object
  788. description: |
  789. Number of Transactions Per Second (tps) excluding connection establishing.
  790. properties:
  791. value:
  792. type: number
  793. nullable: true
  794. description: |
  795. The Transactions Per Second (tps) excluding connections establishing value
  796. unit:
  797. type: string
  798. nullable: false
  799. description: |
  800. Transactions Per Second (tps) measure unit
  801. overTime:
  802. type: object
  803. description: The Transactions Per Second (tps) values aggregated over unit of time
  804. properties:
  805. valuesUnit:
  806. type: string
  807. description: The Transactions Per Second (tps) measures unit
  808. values:
  809. type: array
  810. description: The Transactions Per Second (tps) values aggregated over unit of time
  811. items:
  812. type: number
  813. intervalDurationUnit:
  814. type: string
  815. description: The interval duration measure unit
  816. intervalDuration:
  817. type: number
  818. description: The interval duration used to aggregate the transactions per second.
  819. statements:
  820. type: array
  821. description: Average per-statement latency (execution time from the perspective of the client) of each command after the benchmark finishes
  822. items:
  823. type: object
  824. description: Average per-statement latency (execution time from the perspective of the client) of a command after the benchmark finishes
  825. properties:
  826. script:
  827. type: integer
  828. description: The script index (`0` if no custom scripts have been defined)
  829. command:
  830. type: string
  831. description: The command
  832. latency:
  833. type: number
  834. description: Average latency of the command
  835. unit:
  836. type: string
  837. description: The average latency measure unit
  838. hdrHistogram:
  839. type: string
  840. description: Compressed and base 64 encoded HdrHistogram
  841. majorVersionUpgrade:
  842. type: object
  843. description: |
  844. The results of a major version upgrade
  845. properties:
  846. sourcePostgresVersion:
  847. type: string
  848. description: |
  849. The postgres version currently used by the primary instance
  850. targetPostgresVersion:
  851. type: string
  852. description: |
  853. The postgres version that the cluster will be upgraded to
  854. primaryInstance:
  855. type: string
  856. description: |
  857. The primary instance when the operation started
  858. initialInstances:
  859. type: array
  860. description: |
  861. The instances present when the operation started
  862. items:
  863. type: string
  864. pendingToRestartInstances:
  865. type: array
  866. description: |
  867. The instances that are pending to be restarted
  868. items:
  869. type: string
  870. restartedInstances:
  871. type: array
  872. description: |
  873. The instances that have been restarted
  874. items:
  875. type: string
  876. phase:
  877. type: string
  878. description: |
  879. The phase the operation is or was executing)
  880. failure:
  881. type: string
  882. description: |
  883. A failure message (when available)
  884. restart:
  885. type: object
  886. description: |
  887. The results of a restart
  888. properties:
  889. primaryInstance:
  890. type: string
  891. description: |
  892. The primary instance when the operation started
  893. initialInstances:
  894. type: array
  895. description: |
  896. The instances present when the operation started
  897. items:
  898. type: string
  899. pendingToRestartInstances:
  900. type: array
  901. description: |
  902. The instances that are pending to be restarted
  903. items:
  904. type: string
  905. restartedInstances:
  906. type: array
  907. description: |
  908. The instances that have been restarted
  909. items:
  910. type: string
  911. switchoverInitiated:
  912. type: string
  913. description: |
  914. An ISO 8601 date indicating if and when the switchover initiated
  915. switchoverFinalized:
  916. type: string
  917. description: |
  918. An ISO 8601 date indicating if and when the switchover finalized
  919. failure:
  920. type: string
  921. description: |
  922. A failure message (when available)
  923. minorVersionUpgrade:
  924. type: object
  925. description: |
  926. The results of a minor version upgrade
  927. properties:
  928. sourcePostgresVersion:
  929. type: string
  930. description: |
  931. The postgres version currently used by the primary instance
  932. targetPostgresVersion:
  933. type: string
  934. description: |
  935. The postgres version that the cluster will be upgraded (or downgraded) to
  936. primaryInstance:
  937. type: string
  938. description: |
  939. The primary instance when the operation started
  940. initialInstances:
  941. type: array
  942. description: |
  943. The instances present when the operation started
  944. items:
  945. type: string
  946. pendingToRestartInstances:
  947. type: array
  948. description: |
  949. The instances that are pending to be restarted
  950. items:
  951. type: string
  952. restartedInstances:
  953. type: array
  954. description: |
  955. The instances that have been restarted
  956. items:
  957. type: string
  958. switchoverInitiated:
  959. type: string
  960. description: |
  961. An ISO 8601 date indicating if and when the switchover initiated
  962. switchoverFinalized:
  963. type: string
  964. description: |
  965. An ISO 8601 date indicating if and when the switchover finalized
  966. failure:
  967. type: string
  968. description: |
  969. A failure message (when available)
  970. securityUpgrade:
  971. type: object
  972. description: |
  973. The results of a security upgrade
  974. properties:
  975. primaryInstance:
  976. type: string
  977. description: |
  978. The primary instance when the operation started
  979. initialInstances:
  980. type: array
  981. description: |
  982. The instances present when the operation started
  983. items:
  984. type: string
  985. pendingToRestartInstances:
  986. type: array
  987. description: |
  988. The instances that are pending to be restarted
  989. items:
  990. type: string
  991. restartedInstances:
  992. type: array
  993. description: |
  994. The instances that have been restarted
  995. items:
  996. type: string
  997. switchoverInitiated:
  998. type: string
  999. description: |
  1000. An ISO 8601 date indicating if and when the switchover initiated
  1001. switchoverFinalized:
  1002. type: string
  1003. description: |
  1004. An ISO 8601 date indicating if and when the switchover finalized
  1005. failure:
  1006. type: string
  1007. description: |
  1008. A failure message (when available)