-
Bug
-
Resolution: Done
-
Blocker
-
Pipelines 1.11.0
-
False
-
None
-
False
-
-
Description of problem:
I cannot deploy Results because DB fails to start
Prerequisites (if any, like setup, operators/versions):
OpenShift 4.13.2
Pipelines 1.11.0 - index image 514449
Steps to Reproduce
Follow steps in https://github.com/tektoncd/operator/blob/main/docs/TektonResult.md
export NAMESPACE="openshift-pipelines" oc create secret generic tekton-results-postgres -n ${NAMESPACE} --from-literal=POSTGRES_USER=postgres --from-literal=POSTGRES_PASSWORD=$(openssl rand -base64 20) openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365 -nodes \ -subj "/CN=tekton-results-api-service.${NAMESPACE}.svc.cluster.local" \ -addext "subjectAltName = DNS:tekton-results-api-service.${NAMESPACE}.svc.cluster.local" oc create secret tls -n ${NAMESPACE} tekton-results-tls --cert=cert.pem --key=key.pem cat <<EOF | oc apply -f - apiVersion: operator.tekton.dev/v1alpha1 kind: TektonResult metadata: name: result spec: targetNamespace: openshift-pipelines EOF oc get tektonresults.operator.tekton.dev
Actual results:
For general container run, you must either specify the following environment
variables:
POSTGRESQL_USER POSTGRESQL_PASSWORD POSTGRESQL_DATABASE
Or the following environment variable:
POSTGRESQL_ADMIN_PASSWORD
Or both.
To migrate data from different PostgreSQL container:
POSTGRESQL_MIGRATION_REMOTE_HOST (hostname or IP address)
POSTGRESQL_MIGRATION_ADMIN_PASSWORD (password of remote 'postgres' user)
And optionally:
POSTGRESQL_MIGRATION_IGNORE_ERRORS=yes (default is 'no')
Optional settings:
POSTGRESQL_MAX_CONNECTIONS (default: 100)
POSTGRESQL_MAX_PREPARED_TRANSACTIONS (default: 0)
POSTGRESQL_SHARED_BUFFERS (default: 32MB)
For more information see /usr/share/container-scripts/postgresql/README.md
within the container or visit https://github.com/sclorg/postgresql-container.
Expected results:
Pod runs
Reproducibility (Always/Intermittent/Only Once):
Always
Notes
Even when I update variable names, the pods crash-loops with a different error
initdb: warning: enabling "trust" authentication for local connections You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb. Success. You can now start the database server using: pg_ctl -D /var/lib/pgsql/data/userdata -l logfile start waiting for server to start....2023-06-12 11:20:25.536 UTC [37] LOG: redirecting log output to logging collector process 2023-06-12 11:20:25.536 UTC [37] HINT: Future log output will appear in directory "log". done server started /var/run/postgresql:5432 - accepting connections createuser: error: creation of new role failed: ERROR: role "postgres" already exists