Open sgrzemski-ias opened 3 years ago
Looks duplicate to #1206
Have you updated your K8s version recently? Try to apply the latest version of the CRD and check that the x-kubernetes-preserve-unknown-fields
properties are set wherever we allow full specs. Otherwise they will get pruned.
Yep, applied latest CRD and it works. x-kubernetes-preserve-unknown-fields
is present in my current crd:
items:
type: string
nullable: true
type: array
volumeSource:
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- name
- mountPath
- volumeSource
type: object
type: array
--
type: boolean
enableShmVolume:
type: boolean
init_containers:
items:
type: object
x-kubernetes-preserve-unknown-fields: true
nullable: true
type: array
initContainers:
items:
type: object
x-kubernetes-preserve-unknown-fields: true
nullable: true
type: array
logicalBackupSchedule:
pattern: ^(\d+|\*)(/\d+)?(\s+(\d+|\*)(/\d+)?){4}$
type: string
maintenanceWindows:
--
additionalProperties:
type: string
type: object
sidecars:
items:
type: object
x-kubernetes-preserve-unknown-fields: true
nullable: true
type: array
spiloFSGroup:
type: integer
spiloRunAsGroup:
type: integer
@sgrzemski-ias have you checked customized environment variable for sidecar, i found i already used the latest CRD
No, I have to take my words back. I've just deployed a new cluster with 1.16.15-gke.4300 version and I cannot get it working.
Installed with:
- git clone https://github.com/zalando/postgres-operator.git
- cd postgres-operator
- helm install postgres-operator ./charts/postgres-operator -f ./charts/postgres-operator/values-crd.yaml --namespace databases --create-namespace
Then applied this:
---
# Source: metadata-databases/templates/ranger.yml
apiVersion: "acid.zalan.do/v1"
kind: postgresql
metadata:
name: gid-ranger-metadata
namespace: databases
labels:
app.kubernetes.io/name: metadata-databases
helm.sh/chart: metadata-databases-0.1.0
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/instance: gidp-database
spec:
teamId: gid
volume:
size: 5Gi
numberOfInstances: 1
users:
ranger:
- superuser
- createdb
databases:
ranger: ranger
postgresql:
version: "11"
enableLogicalBackup: false
logicalBackupSchedule: "30 00 * * *"
sidecars:
- name: "pg-exporter"
image: "wrouesnel/postgres_exporter"
ports:
- name: pg-exporter
containerPort: 9187
protocol: TCP
resources:
limits:
cpu: 500m
memory: 256M
requests:
cpu: 100m
memory: 200M
env:
- name: "DATA_SOURCE_URI"
value: "postgresql://localhost:5432/ranger?sslmode=disable"
- name: "DATA_SOURCE_USER"
value: $POSTGRES_USER
- name: "DATA_SOURCE_PASS"
value: $POSTGRES_PASSWORD
but no luck, fields are empty
@sgrzemski-ias have you changed the operator version in helm's values-crd.yaml
to use the latest version?
Hi, I am trying to deploy my first database using your postgres-operator. I am creating a simple postgresql object with postgres_exporter as a sidecar for monitoring purposes.
It comes from minimal example that can be found here: https://postgres-operator.readthedocs.io/en/refactoring-sidecars/user/ After applying this resource, a statefulset is created, but it has some values missing:
Same happens with variables, they are created as empty entries
- {}
and I cannot get my sidecar working. As a result, the statefulset is failing to create pods:Warning FailedCreate 38s (x17 over 6m6s) statefulset-controller create Pod acid-minimal-cluster-0 in StatefulSet acid-minimal-cluster failed error: Pod "acid-minimal-cluster-0" is invalid: spec.containers[1].ports[0].containerPort: Required value