roland
(Roland (Telekom))
March 10, 2020, 12:05pm
1
Hi all,
having the most strange of problems when setting up prodigy inside a docker container inside of openshift/k8s.
The demo setup is most simply:
{
"host": "0.0.0.0",
"port": 8080,
"db_settings": {"sqlite": {"name": ":memory:"}}
}
with the container exposing 8080.
And it all results in this error:
So, my question is: How does prodigy set the port and may I override this?
It's a weird interaction and confusing me.
Best,
Roland
roland
(Roland (Telekom))
March 10, 2020, 2:27pm
2
I think the problem is related to this one here: Deploy prodigy with Kubernetes and SQLite
I'm trying to remove the host/port config no completely as implied by @honnibal 's comment.
roland
(Roland (Telekom))
March 10, 2020, 2:34pm
3
Nope, wasn't the solution. It now inserts 'localhost' ahead of the tcp
string:
roland
(Roland (Telekom))
March 10, 2020, 2:34pm
4
@ines , @honnibal - you have any idea what's going on here?
roland
(Roland (Telekom))
March 10, 2020, 3:05pm
5
One step forward towards a solution:
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
annotations:
openshift.io/generated-by: OpenShiftWebConsole
creationTimestamp: '2020-03-10T11:51:31Z'
generation: 12
labels:
app: prodigy-container
name: prodigy-container
namespace: themachine
resourceVersion: '54275345'
selfLink: >-
/apis/apps.openshift.io/v1/namespaces/themachine/deploymentconfigs/prodigy-container
uid: 7be9e271-62c5-11ea-9822-fa163efb6a9e
spec:
replicas: 1
selector:
app: prodigy-container
deploymentconfig: prodigy-container
strategy:
activeDeadlineSeconds: 21600
resources: {}
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
annotations:
openshift.io/generated-by: OpenShiftWebConsole
creationTimestamp: null
labels:
app: prodigy-container
deploymentconfig: prodigy-container
spec:
containers:
- env:
- name: PRODIGY_PORT
value: '8080'
imagePullPolicy: Always
name: prodigy-container
ports:
- containerPort: 8080
name: prodigyport
protocol: TCP
added the PRODIGY_PORT
as env-var to the Deploymentconfig.
roland
(Roland (Telekom))
March 10, 2020, 3:11pm
6
Together with the initial prodigy.json
the above code is the solution. It feels like a workaround, as I still don't understand how k8s/openshift is passing the port, but it works.
ines
(Ines Montani)
March 11, 2020, 8:58am
7
Glad you got it working!
Just caught up on the thread. Also not sure I fully understand what happens here exactly on the container side of things – Prodigy will read the port from the prodigy.json
or the PRODIGY_PORT
env var. There should be very little magic otherwise