Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,25 @@ Postgres-Operator provides PostgreSQL as a service on Kubernetes and OpenShift.

Please refer to the [Quick Start Guide](/docs/public/quickstart.md)

### Integration tests and ATP storage

Integration test settings live under `tests` in the Helm values for **patroni-core** and **patroni-services** (see [`operator/charts/patroni-core/values.yaml`](operator/charts/patroni-core/values.yaml) and [`operator/charts/patroni-services/values.yaml`](operator/charts/patroni-services/values.yaml)). The test image is based on [qubership-docker-integration-tests](https://github.com/Netcracker/qubership-docker-integration-tests).

ATP-related Helm values are `atpReport` (with nested `atpReport.atpStorage`), `atpReportViewUiUrl`, and `environmentName`. The chart maps them into the Custom Resource and the operator sets the usual `ATP_*` and `ENVIRONMENT_NAME` environment variables on the integration test pod.

| Value (Helm) | Description |
|------------------------------------|-------------|
| `atpReport.enabled` | Opt-in for ATP report upload; when `false`, S3-related env vars are not applied as in other product charts. |
| `atpReport.atpStorage.provider` | S3 provider (for example `aws`, `minio`, `s3`). |
| `atpReport.atpStorage.serverUrl` | S3 API endpoint URL. |
| `atpReport.atpStorage.serverUiUrl` | Optional storage UI URL. |
| `atpReport.atpStorage.bucket` | Bucket name; empty usually means no S3 upload in the base image flow. |
| `atpReport.atpStorage.region` | Region (for example for AWS). |
| `atpReport.atpStorage.username` | Access key (sensitive; stored in Kubernetes Secret when `atpReport.enabled=true`). |
| `atpReport.atpStorage.password` | Secret key (same as username; stored in Kubernetes Secret when `atpReport.enabled=true`). |
| `atpReportViewUiUrl` | Optional Allure report UI base URL. |
| `environmentName` | Optional logical name for paths or labels. |

### Smoke tests

There is no smoke tests.
Expand Down
3 changes: 3 additions & 0 deletions docs/public/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Architecture

## Postgres operator
6 changes: 3 additions & 3 deletions docs/public/features/query-exporter.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ However for managed databases these extensions must be enabled for database inst

## Migration from postgres-exporter

Please check [new queries format](/charts/patroni-services/query-exporter/query-exporter-queries.yaml) for query-exporter.
Please check [new queries format](/operator/charts/patroni-services/query-exporter/query-exporter-queries.yaml) for query-exporter.
For custom queries two sections must be used in config: `metrics` and `queries`.

Queries section includes map of queries. Each query now include next mandatory fields:
Expand Down Expand Up @@ -174,7 +174,7 @@ In this case query `pg_example` will be executed for all databases matching at l

In postgres-operator new watchers are created for namespaces, listed in deployment parameters.
These watchers react to Create, Update, Delete events for config maps with labels from `queryExporter.customQueries.labels` parameter and mandatory label
```query-exporter: custom-queries```. Config maps should contain metrics with custom queries for Query Exporter. Metrics must correspond to the [query exporter format](/charts/patroni-services/query-exporter/query-exporter-queries.yaml) and must meet [metric naming rules](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels)).
```query-exporter: custom-queries```. Config maps should contain metrics with custom queries for Query Exporter. Metrics must correspond to the [query exporter format](/operator/charts/patroni-services/query-exporter/query-exporter-queries.yaml) and must meet [metric naming rules](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels)).
After the Create event, changes from created config map will be appended to `query-exporter-queries` config map.
After the Modify event, changes from config map will be replaced in `query-exporter-queries` config map.
After the Delete event, changes from config map will be deleted from `query-exporter-queries` config map.
Expand Down Expand Up @@ -202,7 +202,7 @@ queryExporter:
- "pg_lock_tree_query"
- "connection_by_role_with_limit_query"
```
Names of the queries can be found in [query-exporter-queries](/charts/patroni-services/query-exporter/query-exporter-queries.yaml) configmap. All metrics for excluded query will be automatically excluded.
Names of the queries can be found in [query-exporter-queries](/operator/charts/patroni-services/query-exporter/query-exporter-queries.yaml) configmap. All metrics for excluded query will be automatically excluded.


# Self monitoring
Expand Down
120 changes: 60 additions & 60 deletions docs/public/installation.md

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions operator/api/apps/v1/postgresservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,22 @@ type IntegrationTests struct {
PgNodeQty int `json:"pgNodeQty,omitempty"`
PodLabels map[string]string `json:"podLabels,omitempty"`
Affinity v1.Affinity `json:"affinity,omitempty"`
AtpStorage *AtpStorage `json:"atpStorage,omitempty"`
AtpReport *AtpReport `json:"atpReport,omitempty"`
AtpReportViewUiUrl string `json:"atpReportViewUiUrl,omitempty"`
EnvironmentName string `json:"environmentName,omitempty"`
}

type AtpStorage struct {
Provider string `json:"provider,omitempty"`
ServerUrl string `json:"serverUrl,omitempty"`
ServerUiUrl string `json:"serverUiUrl,omitempty"`
Bucket string `json:"bucket,omitempty"`
Region string `json:"region,omitempty"`
}

type AtpReport struct {
Enabled bool `json:"enabled,omitempty"`
}

// ExternalDataBase defines the desired state of ExternalDataBase
Expand Down
40 changes: 40 additions & 0 deletions operator/api/apps/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions operator/api/common/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions operator/api/patroni/v1/patronicore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,22 @@ type IntegrationTests struct {
PgNodeQty int `json:"pgNodeQty,omitempty"`
PodLabels map[string]string `json:"podLabels,omitempty"`
Affinity v1.Affinity `json:"affinity,omitempty"`
AtpStorage *AtpStorage `json:"atpStorage,omitempty"`
AtpReport *AtpReport `json:"atpReport,omitempty"`
AtpReportViewUiUrl string `json:"atpReportViewUiUrl,omitempty"`
EnvironmentName string `json:"environmentName,omitempty"`
}

type AtpStorage struct {
Provider string `json:"provider,omitempty"`
ServerUrl string `json:"serverUrl,omitempty"`
ServerUiUrl string `json:"serverUiUrl,omitempty"`
Bucket string `json:"bucket,omitempty"`
Region string `json:"region,omitempty"`
}

type AtpReport struct {
Enabled bool `json:"enabled,omitempty"`
}

type Policies struct {
Expand Down
40 changes: 40 additions & 0 deletions operator/api/patroni/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,28 @@ spec:
x-kubernetes-list-type: atomic
type: object
type: object
atpReport:
properties:
enabled:
type: boolean
type: object
atpReportViewUiUrl:
type: string
atpStorage:
properties:
bucket:
type: string
provider:
type: string
region:
type: string
serverUiUrl:
type: string
serverUrl:
type: string
type: object
environmentName:
type: string
image:
type: string
pgNodeQty:
Expand Down Expand Up @@ -2636,9 +2658,10 @@ spec:
operator:
description: |-
Operator represents a key's relationship to the value.
Valid operators are Exists and Equal. Defaults to Equal.
Valid operators are Exists, Equal, Lt, and Gt. Defaults to Equal.
Exists is equivalent to wildcard for value, so that a pod can
tolerate all taints of a particular category.
Lt and Gt perform numeric comparisons (requires feature gate TaintTolerationComparisonOperators).
type: string
tolerationSeconds:
description: |-
Expand Down
24 changes: 24 additions & 0 deletions operator/charts/patroni-core/templates/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,30 @@ spec:
{{- end }}
{{ end }}
pgNodeQty: {{ ( include "postgres.replicasCount" . ) }}
{{- if or .Values.environmentName .Values.atpReport.enabled .Values.atpReportViewUiUrl }}
{{- if .Values.environmentName }}
environmentName: {{ .Values.environmentName | quote }}
{{- end }}
atpReport:
enabled: {{ .Values.atpReport.enabled | default false }}
{{- if .Values.atpReport.enabled }}
atpStorage:
provider: {{ .Values.atpReport.atpStorage.provider | quote }}
region: {{ .Values.atpReport.atpStorage.region | quote }}
{{- if .Values.atpReport.atpStorage.serverUrl }}
serverUrl: {{ .Values.atpReport.atpStorage.serverUrl | quote }}
{{- end }}
{{- if .Values.atpReport.atpStorage.serverUiUrl }}
serverUiUrl: {{ .Values.atpReport.atpStorage.serverUiUrl | quote }}
{{- end }}
{{- if .Values.atpReport.atpStorage.bucket }}
bucket: {{ .Values.atpReport.atpStorage.bucket | quote }}
{{- end }}
{{- end }}
{{- if .Values.atpReportViewUiUrl }}
atpReportViewUiUrl: {{ .Values.atpReportViewUiUrl | quote }}
{{- end }}
{{- end }}
{{ end }}
{{ if .Values.runTestsOnly }}
runTestsTime: {{ now | unixEpoch | quote }}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if and .Values.tests.install .Values.atpReport.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "patroni-core.fullname" . }}-tests-atp-storage-secret
labels:
{{- include "kubernetes.labels" . | nindent 4 }}
type: Opaque
stringData:
atp-storage-username: {{ .Values.atpReport.atpStorage.username }}
atp-storage-password: {{ .Values.atpReport.atpStorage.password }}
{{- end }}
24 changes: 24 additions & 0 deletions operator/charts/patroni-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,30 @@ tests:

runTestsOnly: false

# ATP report upload (S3 under atpReport.atpStorage). CR and Secret only when atpReport.enabled.
atpReport:
enabled: false
atpStorage:
# S3 provider type: aws (AWS S3), minio, s3 (S3-compatible with custom endpoint)
provider: "aws"
# S3 API server URL (e.g., https://s3.amazonaws.com or https://minio.example.com)
serverUrl: "https://s3.amazonaws.com"
# Optional S3 UI URL for browsing results
serverUiUrl: ""
# S3 bucket name. If empty - S3 integration is disabled and results stay local
bucket: ""
# S3 region (required for AWS S3)
region: "us-east-1"
# S3 credentials (tests-atp-storage-secret when atpReport.enabled)
username: ""
password: ""

# URL for viewing Allure reports (e.g., https://reports.example.com)
atpReportViewUiUrl: ""

# Environment name for organizing test results path in S3
environmentName: "pgskipper-operator"


INTERNAL_TLS_ENABLED: false
GLOBAL_SECURITY_CONTEXT: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3553,6 +3553,28 @@ spec:
x-kubernetes-list-type: atomic
type: object
type: object
atpReport:
properties:
enabled:
type: boolean
type: object
atpReportViewUiUrl:
type: string
atpStorage:
properties:
bucket:
type: string
provider:
type: string
region:
type: string
serverUiUrl:
type: string
serverUrl:
type: string
type: object
environmentName:
type: string
image:
type: string
pgNodeQty:
Expand Down Expand Up @@ -6139,9 +6161,10 @@ spec:
operator:
description: |-
Operator represents a key's relationship to the value.
Valid operators are Exists and Equal. Defaults to Equal.
Valid operators are Exists, Equal, Lt, and Gt. Defaults to Equal.
Exists is equivalent to wildcard for value, so that a pod can
tolerate all taints of a particular category.
Lt and Gt perform numeric comparisons (requires feature gate TaintTolerationComparisonOperators).
type: string
tolerationSeconds:
description: |-
Expand Down
Loading
Loading