Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

Hello, I’m trying to get the CTFd deployed on my kubernetes cluster, and I can get it locally but I can’t get it to my external IP Address, I keep getting this error:
Traceback (most recent call last):
File "/opt/CTFd/ping.py", line 23, in <module>
engine = create_engine(url)
^^^^^^^^^^^^^^^^^^
File "<string>", line 2, in create_engine
File "/opt/venv/lib/python3.11/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 544, in create_engine
dbapi = dialect_cls.dbapi(**dbapi_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/venv/lib/python3.11/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 811, in dbapi
import psycopg2
ModuleNotFoundError: No module named 'psycopg2'
But I’m not sure how to fix it, I have a .yaml file and a docker file that is supposed to force an install of “psycopg2” but I keep running into the error.
The docker file is this:
******# Use CTFd as base image
FROM ctfd/ctfd:3.5.0
# Switch to root user to install dependencies
USER root
# Fix potential missing files and allow changes in package releases
RUN apt-get clean && \
apt-get update --allow-releaseinfo-change && \
apt-get install -y libpq-dev gcc
# Switch back to the original user for security
USER ctfd
# Install psycopg2 for PostgreSQL connection
RUN pip install psycopg2
# Start CTFd
CMD ["python", "serve.py"]**
The .yaml is this:
apiVersion: apps/v1
kind: Deployment
metadata:
name: ctfd
spec:
replicas: 1
selector:
matchLabels:
app: ctfd
template:
metadata:
labels:
app: ctfd
spec:
containers:
- name: ctfd
image: nathanw898/my-ctfd:latest
imagePullPolicy: Always
ports:
- containerPort: 8000
env:
-
name: DATABASE_URL
value: "postgresql://postgres:TestPassword@ctfd-db-postgresql.default.svc.cluster.local:5432/postgres"
---
apiVersion: v1
kind: Service
metadata:
name: ctfd-service
spec:
type: LoadBalancer
selector:
app: ctfd
ports:
- protocol: TCP
port: 80
targetPort: 8000
JetForMe
sgotting21
Jan Misker
Chris Taylor
jeff
Sheen Ismhael Lim
d7abec53c19a47d9b0688f32882e83
catbyte-io
sergeypodgornyy
DennisWashington
Dylan192345
soduno