I'm trying to run the following command:
npx sequelize-cli db:migrate
sequelize-cli
uses a ./config/config.js
file that contains the following:
module.exports = {
username: process.env.PGUSER,
host: process.env.PGHOST,
database: process.env.PGDATABASE,
password: process.env.PGPASSWORD,
port: process.env.PGPORT,
};
If you console.log()
all of thee process.env.<var>
, it all comes back undefined
.
However, if go into the index.js
where the Express app resides and console.log
the same thing, it comes back with the expected values.
I have Kubernete running with skaffold.yaml
and minikube
during all of this.
Is there a way to get this working without creating a .env
just to run these commands?
server-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: server-deployment
spec:
replicas: 3
selector:
matchLabels:
component: server
template:
metadata:
labels:
component: server
spec:
containers:
- name: server
image: sockpuppet/server
ports:
- containerPort: 5000
env:
- name: PGUSER
value: postgres
- name: PGHOST
value: postgres-cluster-ip-service
- name: PGPORT
value: '5432'
- name: PGDATABASE
value: postgres
- name: PGPASSWORD
value: ''