Skip to content

Commit

Permalink
deployment troubleshooting pt 1
Browse files Browse the repository at this point in the history
Co-authored-by: Rob Kaufman <[email protected]>
  • Loading branch information
bkiahstroud and orangewolf committed Jun 5, 2024
1 parent b490415 commit 0de1c11
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 40 deletions.
2 changes: 1 addition & 1 deletion api/db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ $_$;

SET default_tablespace = '';

SET default_table_access_method = heap;
-- SET default_table_access_method = heap;

--
-- Name: action_callouts; Type: TABLE; Schema: public; Owner: -
Expand Down
2 changes: 1 addition & 1 deletion bin/helm_deploy
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace="${2:-princeton-manifold-production}"
tag=$(git rev-parse --short=8 HEAD)

DEPLOY_TAG="${DEPLOY_TAG:-$tag}"
echo $DEPLOY_TAG

helm repo update

Expand All @@ -14,6 +13,7 @@ helm upgrade \
--atomic \
--timeout 15m0s \
--set image.tag="$DEPLOY_TAG" \
--set nginx.image.tag="$DEPLOY_TAG" \
$HELM_EXTRA_ARGS \
--namespace="$namespace" \
--create-namespace \
Expand Down
40 changes: 20 additions & 20 deletions chart/princeton-manifold/templates/configmap-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
API_CABLE_SOCKET=/manifold_sockets/manifold-cable
API_PORT=3020
API_SOCKET=/manifold_sockets/manifold-api
CLIENT_BROWSER_API_CABLE_URL=https://princeton-manifold-production.softserv.cloud/cable
CLIENT_BROWSER_API_URL=https://princeton-manifold-production.softserv.cloud
CLIENT_SERVER_API_URL=http://princeton-manifold-production-api:3020
CLIENT_SERVER_PROXIES=false
CLIENT_SERVER_SOCKET=/manifold_sockets/manifold-client
DOMAIN=princeton-manifold-production.softserv.cloud
ELASTICSEARCH_URL=http://princeton-manifold-production-elasticsearch:9200
NODE_ENV=production
RAILS_DB_HOST={{ .Values.externalPostgresql.host }}
RAILS_DB_NAME={{ .Values.externalPostgresql.database }}
RAILS_DB_PASS={{ .Values.externalPostgresql.password }}
RAILS_DB_PORT=5432
RAILS_DB_USER={{ .Values.externalPostgresql.username }}
RAILS_ENV=production
RAILS_REDIS_URL={{ template "princeton-manifold.redis.url" . }}
RAILS_SECRET_KEY={{ .Values.env.rails_secret_key }}
SSL_ENABLED=true
API_CABLE_SOCKET: /manifold_sockets/manifold-cable
API_PORT: "3020"
API_SOCKET: /manifold_sockets/manifold-api
CLIENT_BROWSER_API_CABLE_URL: https://princeton-manifold-production.softserv.cloud/cable
CLIENT_BROWSER_API_URL: https://princeton-manifold-production.softserv.cloud
CLIENT_SERVER_API_URL: http://princeton-manifold-production-api:3020
CLIENT_SERVER_PROXIES: "false"
CLIENT_SERVER_SOCKET: /manifold_sockets/manifold-client
DOMAIN: princeton-manifold-production.softserv.cloud
ELASTICSEARCH_URL: http://princeton-manifold-production-elasticsearch:9200
NODE_ENV: production
RAILS_DB_HOST: {{ .Values.externalPostgresql.host }}
RAILS_DB_NAME: {{ .Values.externalPostgresql.database }}
RAILS_DB_PASS: {{ .Values.externalPostgresql.password }}
RAILS_DB_PORT: "5432"
RAILS_DB_USER: {{ .Values.externalPostgresql.username }}
RAILS_ENV: production
RAILS_REDIS_URL: {{ template "princeton-manifold.redis.url" . }}
RAILS_SECRET_KEY: {{ .Values.env.rails_secret_key }}
SSL_ENABLED: "true"
2 changes: 1 addition & 1 deletion chart/princeton-manifold/templates/deployment-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-client
command: ["yarn", "run", "build", "&&", "yarn", "run", "start"]
command: ["bash", "-l", "-c", "yarn", "run", "build", "&&", "yarn", "run", "start"]
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.client.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand Down
13 changes: 2 additions & 11 deletions chart/princeton-manifold/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,12 @@ volumeMounts:
- mountPath: /opt/manifold/api/public
name: shared-storage
subPath: api
- mountPath: /opt/manifold/client
- mountPath: /opt/manifold/api/data
name: shared-storage
subPath: client
subPath: data

nodeSelector: {}

tolerations: []

affinity: {}

env:
rails_secret_key: $RAILS_SECRET_KEY

externalPostgresql:
host: acid-postgres-cluster-delta.postgres.svc.cluster.local
username: princeton-manifold
password: $DB_PASSWORD
database: princeton_manifold_production
20 changes: 14 additions & 6 deletions ops/production-deploy.tmpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ replicaCount: 1
imagePullSecrets:
- name: github

volumes:
- name: shared-storage
persistentVolumeClaim:
claimName: princeton-manifold-production-shared-pvc

resources:
limits:
memory: "4Gi"
Expand Down Expand Up @@ -32,18 +37,21 @@ ingress:
- princeton-manifold-production.softserv.cloud
secretName: production-princeton-manifold-tls

podSecurityContext:
runAsUser: 1001
runAsGroup: 101
fsGroup: 101
fsGroupChangePolicy: "OnRootMismatch"

redis:
enabled: true
architecture: standalone
auth:
password: $REDIS_PASSWORD # FIXME need to set

env:
rails_secret_key: $RAILS_SECRET_KEY

externalPostgresql:
host: acid-postgres-cluster-delta.postgres.svc.cluster.local
username: princeton_manifold
password: $DB_PASSWORD
database: princeton_manifold_production

nginx:
enabled: true
service:
Expand Down

0 comments on commit 0de1c11

Please sign in to comment.