-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from vshn/psql/migrate_comp_functions
Migrate PostgreSQL from P&T to comp-functions
- Loading branch information
Showing
30 changed files
with
3,426 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// SGInstanceProfile is the API for creating instance profiles for SgClusters. | ||
type SGInstanceProfile struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
// Spec contains the custom configurations for the SgInstanceProfile. | ||
Spec SGInstanceProfileSpec `json:"spec"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
type SGPInstanceProfileList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
|
||
Items []SGInstanceProfile `json:"items"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
openapi: "3.0.2" | ||
paths: | ||
"/spec": | ||
get: | ||
responses: | ||
"200": | ||
content: | ||
"application/json": | ||
schema: | ||
"$ref": "#/components/schemas/SGInstanceProfileSpec" | ||
components: | ||
schemas: | ||
SGInstanceProfileSpec: | ||
type: object | ||
properties: | ||
cpu: | ||
type: string | ||
pattern: '^[1-9][0-9]*[m]?$' | ||
description: | | ||
CPU(s) (cores) used for every instance of a SGCluster. The suffix `m` | ||
specifies millicpus (where 1000m is equals to 1). | ||
The number of cores set is assigned to the patroni container (that runs both Patroni and PostgreSQL). | ||
A minimum of 2 cores is recommended. | ||
memory: | ||
type: string | ||
pattern: '^[0-9]+(\.[0-9]+)?(Mi|Gi)$' | ||
description: | | ||
RAM allocated to every instance of a SGCluster. The suffix `Mi` or `Gi` | ||
specifies Mebibytes or Gibibytes, respectively. | ||
The amount of RAM set is assigned to the patroni container (that runs both Patroni and PostgreSQL). | ||
A minimum of 2-4Gi is recommended. | ||
hugePages: | ||
type: object | ||
description: | | ||
RAM allocated for huge pages | ||
properties: | ||
hugepages-2Mi: | ||
type: string | ||
pattern: '^[0-9]+(\.[0-9]+)?(Mi|Gi)$' | ||
description: | | ||
RAM allocated for huge pages with a size of 2Mi. The suffix `Mi` or `Gi` | ||
specifies Mebibytes or Gibibytes, respectively. | ||
By default the amount of RAM set is assigned to patroni container | ||
(that runs both Patroni and PostgreSQL). | ||
hugepages-1Gi: | ||
type: string | ||
pattern: '^[0-9]+(\.[0-9]+)?(Mi|Gi)$' | ||
description: | | ||
RAM allocated for huge pages with a size of 1Gi. The suffix `Mi` or `Gi` | ||
specifies Mebibytes or Gibibytes, respectively. | ||
By default the amount of RAM set is assigned to patroni container | ||
(that runs both Patroni and PostgreSQL). | ||
containers: | ||
type: object | ||
description: | | ||
The CPU(s) (cores) and RAM assigned to containers other than patroni container. | ||
This section, if left empty, will be filled automatically by the operator with | ||
some defaults that can be proportional to the resources assigned to patroni | ||
container (except for the huge pages that are always left empty). | ||
additionalProperties: | ||
type: object | ||
properties: | ||
cpu: | ||
type: string | ||
pattern: '^[1-9][0-9]*[m]?$' | ||
description: | | ||
CPU(s) (cores) used for the specified Pod container. The suffix `m` | ||
specifies millicpus (where 1000m is equals to 1). | ||
memory: | ||
type: string | ||
pattern: '^[0-9]+(\.[0-9]+)?(Mi|Gi)$' | ||
description: | | ||
RAM allocated to the specified Pod container. The suffix `Mi` or `Gi` | ||
specifies Mebibytes or Gibibytes, respectively. | ||
hugePages: | ||
type: object | ||
description: | | ||
RAM allocated for huge pages | ||
properties: | ||
hugepages-2Mi: | ||
type: string | ||
pattern: '^[0-9]+(\.[0-9]+)?(Mi|Gi)$' | ||
description: | | ||
RAM allocated for huge pages with a size of 2Mi. The suffix `Mi` | ||
or `Gi` specifies Mebibytes or Gibibytes, respectively. | ||
The amount of RAM is assigned to the specified container. | ||
hugepages-1Gi: | ||
type: string | ||
pattern: '^[0-9]+(\.[0-9]+)?(Mi|Gi)$' | ||
description: | | ||
RAM allocated for huge pages with a size of 1Gi. The suffix `Mi` | ||
or `Gi` specifies Mebibytes or Gibibytes, respectively. | ||
The amount of RAM is assigned to the specified container. | ||
required: ["cpu", "memory"] | ||
initContainers: | ||
type: object | ||
description: The CPU(s) (cores) and RAM assigned to init containers. | ||
additionalProperties: | ||
type: object | ||
properties: | ||
cpu: | ||
type: string | ||
pattern: '^[1-9][0-9]*[m]?$' | ||
description: | | ||
CPU(s) (cores) used for the specified Pod init container. The suffix | ||
`m` specifies millicpus (where 1000m is equals to 1). | ||
memory: | ||
type: string | ||
pattern: '^[0-9]+(\.[0-9]+)?(Mi|Gi)$' | ||
description: | | ||
RAM allocated to the specified Pod init container. The suffix `Mi` | ||
or `Gi` specifies Mebibytes or Gibibytes, respectively. | ||
hugePages: | ||
type: object | ||
description: | | ||
RAM allocated for huge pages | ||
properties: | ||
hugepages-2Mi: | ||
type: string | ||
pattern: '^[0-9]+(\.[0-9]+)?(Mi|Gi)$' | ||
description: | | ||
RAM allocated for huge pages with a size of 2Mi. The suffix `Mi` | ||
or `Gi` specifies Mebibytes or Gibibytes, respectively. | ||
The amount of RAM is assigned to the specified init container. | ||
hugepages-1Gi: | ||
type: string | ||
pattern: '^[0-9]+(\.[0-9]+)?(Mi|Gi)$' | ||
description: | | ||
RAM allocated for huge pages with a size of 1Gi. The suffix `Mi` or `Gi` | ||
specifies Mebibytes or Gibibytes, respectively. | ||
The amount of RAM is assigned to the specified init container. | ||
required: ["cpu", "memory"] | ||
requests: | ||
type: object | ||
description: | | ||
On containerized environments, when running production workloads, enforcing container's resources requirements request to be equals to the limits allow to achieve the highest level of performance. Doing so, reduces the chances of leaving | ||
the workload with less resources than it requires. It also allow to set [static CPU management policy](https://kubernetes.io/docs/tasks/administer-cluster/cpu-management-policies/#static-policy) that allows to guarantee a pod the usage exclusive CPUs on the node. | ||
There are cases where you may need to set resource requirement request to a different value than limit. This section allow to do so but requires to enable such feature in the `SGCluster` and `SGDistributedLogs` (see `.spec.nonProductionOptions` section for each of those custom resources). | ||
properties: | ||
cpu: | ||
type: string | ||
pattern: '^[1-9][0-9]*[m]?$' | ||
description: | | ||
CPU(s) (cores) used for every instance of a SGCluster. The suffix `m` | ||
specifies millicpus (where 1000m is equals to 1). | ||
The number of cores set is assigned to the patroni container (that runs both Patroni and PostgreSQL). | ||
memory: | ||
type: string | ||
pattern: '^[0-9]+(\.[0-9]+)?(Mi|Gi)$' | ||
description: | | ||
RAM allocated to every instance of a SGCluster. The suffix `Mi` or `Gi` | ||
specifies Mebibytes or Gibibytes, respectively. | ||
The amount of RAM set is assigned to the patroni container (that runs both Patroni and PostgreSQL). | ||
containers: | ||
type: object | ||
description: | | ||
The CPU(s) (cores) and RAM assigned to containers other than patroni container. | ||
additionalProperties: | ||
type: object | ||
properties: | ||
cpu: | ||
type: string | ||
pattern: '^[1-9][0-9]*[m]?$' | ||
description: | | ||
CPU(s) (cores) used for the specified Pod container. The suffix `m` | ||
specifies millicpus (where 1000m is equals to 1). | ||
memory: | ||
type: string | ||
pattern: '^[0-9]+(\.[0-9]+)?(Mi|Gi)$' | ||
description: | | ||
RAM allocated to the specified Pod container. The suffix `Mi` or `Gi` | ||
specifies Mebibytes or Gibibytes, respectively. | ||
initContainers: | ||
type: object | ||
description: The CPU(s) (cores) and RAM assigned to init containers. | ||
additionalProperties: | ||
type: object | ||
properties: | ||
cpu: | ||
type: string | ||
pattern: '^[1-9][0-9]*[m]?$' | ||
description: | | ||
CPU(s) (cores) used for the specified Pod init container. The suffix | ||
`m` specifies millicpus (where 1000m is equals to 1). | ||
memory: | ||
type: string | ||
pattern: '^[0-9]+(\.[0-9]+)?(Mi|Gi)$' | ||
description: | | ||
RAM allocated to the specified Pod init container. The suffix `Mi` | ||
or `Gi` specifies Mebibytes or Gibibytes, respectively. | ||
required: ["cpu", "memory"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.