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
20 changes: 20 additions & 0 deletions docs/public/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,26 @@ This sections describes all possible deploy parameters to run Integration Tests
| tests.runTestScenarios | string | no | basic | Specifies tests level runs. One of 'full', 'basic' or one of testScenarios. |
| tests.testScenarios | map[string][]string | no | n/a | Specifies list of test tags to run. |

## 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. |


## consulRegistration

Postgres Operator allows register of PostgreSQL connection properties in Consul. By default, registration disabled.
Expand Down
34 changes: 25 additions & 9 deletions operator/api/apps/v1/postgresservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,31 @@ type CustomQueries struct {
}

type IntegrationTests struct {
Resources *v1.ResourceRequirements `json:"resources,omitempty"`
DockerImage string `json:"image,omitempty"`
RunTestScenarios string `json:"runTestScenarios,omitempty"`
TestList []string `json:"testList,omitempty"`
Replicas int `json:"replicas,omitempty"`
PgNodeQty int `json:"pgNodeQty,omitempty"`
PodLabels map[string]string `json:"podLabels,omitempty"`
Affinity v1.Affinity `json:"affinity,omitempty"`
MonitoredImages string `json:"monitoredImages,omitempty"`
Resources *v1.ResourceRequirements `json:"resources,omitempty"`
DockerImage string `json:"image,omitempty"`
RunTestScenarios string `json:"runTestScenarios,omitempty"`
TestList []string `json:"testList,omitempty"`
Replicas int `json:"replicas,omitempty"`
PgNodeQty int `json:"pgNodeQty,omitempty"`
PodLabels map[string]string `json:"podLabels,omitempty"`
Affinity v1.Affinity `json:"affinity,omitempty"`
MonitoredImages string `json:"monitoredImages,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.

34 changes: 25 additions & 9 deletions operator/api/patroni/v1/patronicore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,31 @@ type Dcs struct {
}

type IntegrationTests struct {
Resources *v1.ResourceRequirements `json:"resources,omitempty"`
DockerImage string `json:"image,omitempty"`
RunTestScenarios string `json:"runTestScenarios,omitempty"`
TestList []string `json:"testList,omitempty"`
Replicas int `json:"replicas,omitempty"`
PgNodeQty int `json:"pgNodeQty,omitempty"`
PodLabels map[string]string `json:"podLabels,omitempty"`
Affinity v1.Affinity `json:"affinity,omitempty"`
MonitoredImages string `json:"monitoredImages,omitempty"`
Resources *v1.ResourceRequirements `json:"resources,omitempty"`
DockerImage string `json:"image,omitempty"`
RunTestScenarios string `json:"runTestScenarios,omitempty"`
TestList []string `json:"testList,omitempty"`
Replicas int `json:"replicas,omitempty"`
PgNodeQty int `json:"pgNodeQty,omitempty"`
PodLabels map[string]string `json:"podLabels,omitempty"`
Affinity v1.Affinity `json:"affinity,omitempty"`
MonitoredImages string `json:"monitoredImages,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.

22 changes: 22 additions & 0 deletions operator/charts/patroni-core/crds/netcracker.com_patronicores.yaml
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
monitoredImages:
Expand Down
25 changes: 25 additions & 0 deletions operator/charts/patroni-core/templates/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,31 @@ spec:
{{- end }}
{{- end }}
pgNodeQty: {{ ( include "postgres.replicasCount" . ) }}

{{- if or .Values.tests.environmentName .Values.tests.atpReport.enabled .Values.tests.atpReportViewUiUrl }}
{{- if .Values.tests.environmentName }}
environmentName: {{ .Values.tests.environmentName | quote }}
{{- end }}
atpReport:
enabled: {{ .Values.tests.atpReport.enabled | default false }}
{{- if .Values.tests.atpReport.enabled }}
atpStorage:
provider: {{ .Values.tests.atpReport.atpStorage.provider | quote }}
region: {{ .Values.tests.atpReport.atpStorage.region | quote }}
{{- if .Values.tests.atpReport.atpStorage.serverUrl }}
serverUrl: {{ .Values.tests.atpReport.atpStorage.serverUrl | quote }}
{{- end }}
{{- if .Values.tests.atpReport.atpStorage.serverUiUrl }}
serverUiUrl: {{ .Values.tests.atpReport.atpStorage.serverUiUrl | quote }}
{{- end }}
{{- if .Values.tests.atpReport.atpStorage.bucket }}
bucket: {{ .Values.tests.atpReport.atpStorage.bucket | quote }}
{{- end }}
{{- end }}
{{- if .Values.tests.atpReportViewUiUrl }}
atpReportViewUiUrl: {{ .Values.tests.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.tests.atpReport.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: patroni-core-atp-storage-secret
labels:
{{- include "kubernetes.labels" . | nindent 4 }}
type: Opaque
stringData:
atp-storage-username: {{ .Values.tests.atpReport.atpStorage.username | quote }}
atp-storage-password: {{ .Values.tests.atpReport.atpStorage.password | quote }}
{{- end }}
12 changes: 12 additions & 0 deletions operator/charts/patroni-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,18 @@ tests:
- check_scale_down_master
- check_delete_master
- check_manual_switchover
atpReport:
enabled: false
atpStorage:
provider: "aws"
serverUrl: "https://s3.amazonaws.com"
serverUiUrl: ""
bucket: ""
region: "us-east-1"
username: ""
password: ""
atpReportViewUiUrl: ""
environmentName: "pgskipper-operator"

runTestsOnly: false

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
monitoredImages:
Expand Down
26 changes: 26 additions & 0 deletions operator/charts/patroni-services/templates/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,32 @@ spec:
{{- end }}
{{- end }}
pgNodeQty: {{ default "1" .Values.patroni.replicas }}
{{- if or .Values.tests.environmentName .Values.tests.atpReport.enabled .Values.tests.atpReportViewUiUrl }}
{{- if .Values.tests.environmentName }}
environmentName: {{ .Values.tests.environmentName | quote }}
{{- end }}
atpReport:
enabled: {{ .Values.tests.atpReport.enabled | default false }}
{{- if .Values.tests.atpReport.enabled }}
atpStorage:
provider: {{ .Values.tests.atpReport.atpStorage.provider | quote }}
{{- if .Values.tests.atpReport.atpStorage.serverUrl }}
serverUrl: {{ .Values.tests.atpReport.atpStorage.serverUrl | quote }}
{{- end }}
{{- if .Values.tests.atpReport.atpStorage.serverUiUrl }}
serverUiUrl: {{ .Values.tests.atpReport.atpStorage.serverUiUrl | quote }}
{{- end }}
{{- if .Values.tests.atpReport.atpStorage.bucket }}
bucket: {{ .Values.tests.atpReport.atpStorage.bucket | quote }}
{{- end }}
{{- if .Values.tests.atpReport.atpStorage.region }}
region: {{ .Values.tests.atpReport.atpStorage.region | quote }}
{{- end }}
{{- end }}
{{- if .Values.tests.atpReportViewUiUrl }}
atpReportViewUiUrl: {{ .Values.tests.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.tests.atpReport.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "helm-chart.fullname" . }}-atp-storage-secret
labels:
{{- include "kubernetes.labels" . | nindent 4 }}
type: Opaque
stringData:
atp-storage-username: {{ .Values.tests.atpReport.atpStorage.username | quote }}
atp-storage-password: {{ .Values.tests.atpReport.atpStorage.password | quote }}
{{- end }}
Loading
Loading