Skip to content
Closed
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
41 changes: 20 additions & 21 deletions api/apps/v1/postgresservice_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,26 @@ import (
// PatroniServicesSpec defines the desired state of PatroniServices
// +k8s:openapi-gen=true
type PatroniServicesSpec struct {
Patroni *Patroni `json:"patroni,omitempty"`
BackupDaemon *types.BackupDaemon `json:"backupDaemon,omitempty"`
MetricCollector *types.MetricCollector `json:"metricCollector,omitempty"`
AuthSecret string `json:"authSecret,omitempty"`
IntegrationTests *IntegrationTests `json:"integrationTests,omitempty"`
VaultRegistration *types.VaultRegistration `json:"vaultRegistration,omitempty"`
Policies *Policies `json:"policies,omitempty"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`
CloudSql *types.CloudSql `json:"cloudSql,omitempty"`
SiteManager *SiteManager `json:"siteManager,omitempty"`
PowaUI PowaUI `json:"powaUI,omitempty"`
ReplicationController ReplicationController `json:"replicationController,omitempty"`
Pooler Pooler `json:"connectionPooler,omitempty"`
Tracing *Tracing `json:"tracing,omitempty"`
ExternalDataBase *ExternalDataBase `json:"externalDataBase,omitempty"`
PostgresExporter *PostgresExporter `json:"postgresExporter,omitempty"`
QueryExporter QueryExporter `json:"queryExporter,omitempty"`
Tls *Tls `json:"tls,omitempty"`
PgBackRest *PgBackRest `json:"pgBackRest,omitempty"`
InstallationTimestamp string `json:"installationTimestamp,omitempty"`
PrivateRegistry PrivateRegistry `json:"privateRegistry,omitempty"`
Patroni *Patroni `json:"patroni,omitempty"`
BackupDaemon *types.BackupDaemon `json:"backupDaemon,omitempty"`
MetricCollector *types.MetricCollector `json:"metricCollector,omitempty"`
AuthSecret string `json:"authSecret,omitempty"`
IntegrationTests *IntegrationTests `json:"integrationTests,omitempty"`
Policies *Policies `json:"policies,omitempty"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`
CloudSql *types.CloudSql `json:"cloudSql,omitempty"`
SiteManager *SiteManager `json:"siteManager,omitempty"`
PowaUI PowaUI `json:"powaUI,omitempty"`
ReplicationController ReplicationController `json:"replicationController,omitempty"`
Pooler Pooler `json:"connectionPooler,omitempty"`
Tracing *Tracing `json:"tracing,omitempty"`
ExternalDataBase *ExternalDataBase `json:"externalDataBase,omitempty"`
PostgresExporter *PostgresExporter `json:"postgresExporter,omitempty"`
QueryExporter QueryExporter `json:"queryExporter,omitempty"`
Tls *Tls `json:"tls,omitempty"`
PgBackRest *PgBackRest `json:"pgBackRest,omitempty"`
InstallationTimestamp string `json:"installationTimestamp,omitempty"`
PrivateRegistry PrivateRegistry `json:"privateRegistry,omitempty"`
}

type PrivateRegistry struct {
Expand Down
5 changes: 0 additions & 5 deletions api/apps/v1/zz_generated.deepcopy.go

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

26 changes: 12 additions & 14 deletions api/patroni/v1/patronicore_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@ import (
// PatroniCoreSpec defines the desired state of PatroniCore
// +k8s:openapi-gen=true
type PatroniCoreSpec struct {
Patroni *Patroni `json:"patroni,omitempty"`
AuthSecret string `json:"authSecret,omitempty"`
IntegrationTests *IntegrationTests `json:"integrationTests,omitempty"`
ConsulRegistration *ConsulRegistration `json:"consulRegistration,omitempty"`
VaultRegistration *types.VaultRegistration `json:"vaultRegistration,omitempty"`
Policies *Policies `json:"policies,omitempty"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`
CloudSql *types.CloudSql `json:"cloudSql,omitempty"`
Tls *Tls `json:"tls,omitempty"`
PgBackRest *PgBackRest `json:"pgBackRest,omitempty"`
Ldap *LdapConfig `json:"ldap,omitempty"`
InstallationTimestamp string `json:"installationTimestamp,omitempty"`
PrivateRegistry PrivateRegistry `json:"privateRegistry,omitempty"`
Patroni *Patroni `json:"patroni,omitempty"`
AuthSecret string `json:"authSecret,omitempty"`
IntegrationTests *IntegrationTests `json:"integrationTests,omitempty"`
ConsulRegistration *ConsulRegistration `json:"consulRegistration,omitempty"`
Policies *Policies `json:"policies,omitempty"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`
CloudSql *types.CloudSql `json:"cloudSql,omitempty"`
Tls *Tls `json:"tls,omitempty"`
PgBackRest *PgBackRest `json:"pgBackRest,omitempty"`
Ldap *LdapConfig `json:"ldap,omitempty"`
InstallationTimestamp string `json:"installationTimestamp,omitempty"`
PrivateRegistry PrivateRegistry `json:"privateRegistry,omitempty"`
}

type PrivateRegistry struct {
Expand Down Expand Up @@ -99,7 +98,6 @@ type Patroni struct {
PodLabels map[string]string `json:"podLabels,omitempty"`
PgHba []string `json:"pgHba,omitempty"`
Powa Powa `json:"powa,omitempty"`
VaultRegistration *types.VaultRegistration `json:"vaultRegistration,omitempty"`
SecurityContext *v1.PodSecurityContext `json:"securityContext,omitempty"`
Unlimited bool `json:"unlimited,omitempty"`
PgWalStorageAutoManage bool `json:"pgWalStorageAutoManage,omitempty"`
Expand Down
10 changes: 0 additions & 10 deletions api/patroni/v1/zz_generated.deepcopy.go

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

62 changes: 0 additions & 62 deletions charts/patroni-core/crds/qubership.org_patronicores.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2458,37 +2458,6 @@ spec:
type: object
unlimited:
type: boolean
vaultRegistration:
properties:
dbEngine:
description: Vault DbEngine configuration
properties:
enabled:
type: boolean
maxConnectionLifetime:
type: string
maxIdleConnections:
type: integer
maxOpenConnections:
type: integer
name:
type: string
type: object
dockerImage:
type: string
enabled:
type: boolean
method:
type: string
path:
type: string
role:
type: string
token:
type: string
url:
type: string
type: object
type: object
pgBackRest:
properties:
Expand Down Expand Up @@ -2672,37 +2641,6 @@ spec:
enabled:
type: boolean
type: object
vaultRegistration:
properties:
dbEngine:
description: Vault DbEngine configuration
properties:
enabled:
type: boolean
maxConnectionLifetime:
type: string
maxIdleConnections:
type: integer
maxOpenConnections:
type: integer
name:
type: string
type: object
dockerImage:
type: string
enabled:
type: boolean
method:
type: string
path:
type: string
role:
type: string
token:
type: string
url:
type: string
type: object
type: object
status:
properties:
Expand Down
32 changes: 2 additions & 30 deletions charts/patroni-core/templates/_helpers.tpl
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{{- define "patroni-core-operator.vaultEnvs" }} , please check where is this definition used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are no usages of this definition.

Original file line number Diff line number Diff line change
Expand Up @@ -92,38 +92,10 @@ capabilities:
{{- end }}
{{- end -}}

{{- define "patroni-core-operator.vaultEnvs" }}
{{- if or .Values.vaultRegistration.enabled .Values.vaultRegistration.dbEngine.enabled }}
- name: VAULT_ADDR
value: {{ default "http://vault-service.vault:8200" .Values.vaultRegistration.url }}
- name: VAULT_TOKEN
valueFrom:
secretKeyRef:
name: vault-secret
key: token
- name: PAAS_PLATFORM
value: {{ default "kubernetes" .Values.vaultRegistration.paasPlatform }}
- name: PAAS_VERSION
value: {{ default "1.14" .Values.vaultRegistration.paasVersion | quote }}
- name: OPENSHIFT_SERVER
{{- if and .Values.CLOUD_PROTOCOL .Values.CLOUD_API_HOST .Values.CLOUD_API_PORT }}
value: {{ printf "%s://%s:%v" .Values.CLOUD_PROTOCOL .Values.CLOUD_API_HOST .Values.CLOUD_API_PORT }}
{{- else }}
value: "https://kubernetes.default:443"
{{- end }}
{{- else }}
- name: PAAS_PLATFORM
value: "kubernetes"
- name: PAAS_VERSION
value: "1.14"
- name: OPENSHIFT_SERVER
value: "https://kubernetes.default:443"
{{- end }}
{{- end }}

{{- define "find_image" -}}
{{- $image := .default -}}

{{ printf "%s" $image }}
{{- end -}}

Expand Down Expand Up @@ -189,4 +161,4 @@ Init container section for postgres-operator
{{- end }}

{{- define "patroni-tests.monitoredImages" -}}
{{- end -}}
{{- end -}}
22 changes: 3 additions & 19 deletions charts/patroni-core/templates/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ spec:
enabled: true
names:
{{- range $i, $v := .Values.privateRegistry.secrets }}
- {{ $v.name }}
{{- end }}
- {{ $v.name }}
{{- end }}
{{- end }}
installationTimestamp: {{ now | unixEpoch | quote }}
{{ if .Values.serviceAccount.create }}
Expand Down Expand Up @@ -175,22 +175,6 @@ spec:
{{ if .Values.consulRegistration }}
consulRegistration:
{{ toYaml .Values.consulRegistration | indent 4 }}
{{ end }}
{{ if .Values.vaultRegistration }}
vaultRegistration:
dockerImage: {{ template "find_image" (dict "deployName" "vault_env" "SERVICE_NAME" "vault_env" "vals" .Values "default" .Values.vaultRegistration.dockerImage) }}
enabled: {{ .Values.vaultRegistration.enabled }}
path: {{ .Values.vaultRegistration.path | default .Release.Namespace }}
{{- if .Values.vaultRegistration.url }}
url: {{ .Values.vaultRegistration.url }}
{{- end }}
dbEngine:
enabled: {{ .Values.vaultRegistration.dbEngine.enabled }}
name: {{ .Values.vaultRegistration.dbEngine.name | default (printf "%s_%s_postgresql" .Values.CLOUD_PUBLIC_HOST .Release.Namespace) }}
maxOpenConnections: {{ .Values.vaultRegistration.dbEngine.maxOpenConnections | default 5 }}
maxIdleConnections: {{ .Values.vaultRegistration.dbEngine.maxIdleConnections | default 5 }}
maxConnectionLifetime: {{ .Values.vaultRegistration.dbEngine.maxConnectionLifetime | default "5s" }}

{{ end }}
{{ if .Values.pgBackRest }}
pgBackRest:
Expand Down Expand Up @@ -286,4 +270,4 @@ majorUpgrade:
initDbParams: {{ .Values.patroni.majorUpgrade.initDbParams }}
{{- end }}
dockerUpgradeImage: {{ template "find_image" (dict "deployName" "pg_upgrade" "SERVICE_NAME" "pg_upgrade" "vals" .Values "default" .Values.patroni.majorUpgrade.dockerUpgradeImage) }}
{{- end }}
{{- end }}
17 changes: 0 additions & 17 deletions charts/patroni-core/templates/secrets/vault-secret.yaml

This file was deleted.

17 changes: 3 additions & 14 deletions charts/patroni-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ privateRegistry:
create: false
# registry: ghcr.io/netcracker
# username:
# password:
# email:
# password:
# email:

global:
cloudIntegrationEnabled: true
Expand All @@ -35,7 +35,7 @@ operatorInit:
memory: 128Mi
requests:
cpu: 50m
memory: 128Mi
memory: 128Mi

## This section describes values for postgres-operator deployment
operator:
Expand All @@ -55,17 +55,6 @@ operator:
# Field for priority of the pod
# priorityClassName: "high-priority"

vaultRegistration:
dockerImage: banzaicloud/vault-env:1.5.0
enabled: false
# path: /postgres
# url: http://localhost:8200
# token: s.0il9o9kHeVmzgEhkBP6KqZBq
# paasPlatform: "kubernetes"
# paasVersion: "1.14"
dbEngine:
enabled: false
# name: "postgresql"

policies:
tolerations:
Expand Down
31 changes: 0 additions & 31 deletions charts/patroni-services/crds/qubership.org_patroniservices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8645,37 +8645,6 @@ spec:
host:
type: string
type: object
vaultRegistration:
properties:
dbEngine:
description: Vault DbEngine configuration
properties:
enabled:
type: boolean
maxConnectionLifetime:
type: string
maxIdleConnections:
type: integer
maxOpenConnections:
type: integer
name:
type: string
type: object
dockerImage:
type: string
enabled:
type: boolean
method:
type: string
path:
type: string
role:
type: string
token:
type: string
url:
type: string
type: object
type: object
status:
description: PatroniServicesStatus defines the observed state of PatroniServices
Expand Down
Loading