Skip to content

Use correct path for initdb and pg_ctl #478

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 23, 2022
Merged

Conversation

mzwennes
Copy link
Contributor

@mzwennes mzwennes commented Aug 2, 2022

Fixes #465

Motivation

initdb and pg_ctl are no longer available in the v0.3.0 image. Most likely this is due to a switch from alpine or to a newer version of PostgreSQL (13).

This change fixes the not found issues for both of these.

Verifying this change

  • Tested it locally by building the image and running it
  • Tested it on Kubernetes on a clean environment

Copy link

@thijs-felyx thijs-felyx left a comment

Choose a reason for hiding this comment

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

:octocat:

@yuvalgut
Copy link

Better add the binaries to the PATH in the dockerfile

ENV PATH="/usr/lib/postgresql/13/bin/:$PATH"

WDYT?

@Raptorbob
Copy link

Better add the binaries to the PATH in the dockerfile

ENV PATH="/usr/lib/postgresql/13/bin/:$PATH"

WDYT?

Tried to make this work by modifying PATH in the deployment, but since entrypoint user is root and the postgresql commands run as user "pulsar", the PATH var wasn't correct for that user and they failed. Better imo to use full path.

@nodece nodece merged commit 7c5fd10 into apache:master Nov 23, 2022
@vfauth vfauth mentioned this pull request Dec 12, 2022
@saurabh21316
Copy link

Hello Martin,

I am new to pulsar, since the v0.4.0 is not released yet, could you please help with deploying it local with this fix or something you can point me out to. I would really appreciate.

Here is an example of deployment

kind: Deployment
apiVersion: apps/v1
metadata:
name: pulsar-pulsar-manager
namespace: colony-events
labels:
app: pulsar
cluster: pulsar
component: pulsar-manager
release: pulsar
spec:
replicas: 1
selector:
matchLabels:
app: pulsar
component: pulsar-manager
release: pulsar
template:
metadata:
labels:
app: pulsar
cluster: pulsar
component: pulsar-manager
release: pulsar
spec:
volumes:
- name: pulsar-manager-data
emptyDir: {}
containers:
- name: pulsar-pulsar-manager
image: streamnative/pulsar-manager:v0.3.1-rc2
# image: apachepulsar/pulsar-manager:v0.3.0
ports:
- containerPort: 9527
protocol: TCP
- containerPort: 7750
protocol: TCP
envFrom:
- configMapRef:
name: pulsar-pulsar-manager
env:
- name: PULSAR_CLUSTER
value: pulsar
- name: USERNAME
valueFrom:
secretKeyRef:
name: pulsar-pulsar-manager-secret
key: PULSAR_MANAGER_ADMIN_USER
- name: PASSWORD
valueFrom:
secretKeyRef:
name: pulsar-pulsar-manager-secret
key: PULSAR_MANAGER_ADMIN_PASSWORD
- name: PULSAR_MANAGER_OPTS
value: $(PULSAR_MANAGER_OPTS) -Dlog4j2.formatMsgNoLookups=true
- name: SPRING_CONFIGURATION_FILE
value: "/pulsar-manager/pulsar-manager/application.properties"
resources:
limits:
cpu: 100m
memory: 250Mi
requests:
cpu: 100m
memory: 250Mi
volumeMounts:
- name: pulsar-manager-data
mountPath: /data
imagePullPolicy: IfNotPresent
restartPolicy: Always
terminationGracePeriodSeconds: 30
nodeSelector:
persistent-type: persistent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docker Failed to Initialize Postgresql Database
6 participants