Skip to content
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

i3 Replace sockets with ports #29

Merged
merged 22 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ CLIENT_BROWSER_API_CABLE_URL=http://127.0.0.1:4000/cable
SSL_ENABLED=false

API_PORT=3020
API_SOCKET=/manifold_sockets/manifold-api
API_CABLE_SOCKET=/manifold_sockets/manifold-cable
API_CABLE_PORT=3021
CLIENT_SERVER_PORT=3010
API_HOST=api_rails
API_CABLE_HOST=api_cable
CLIENT_SERVER_HOST=client

CLIENT_SERVER_SOCKET=/manifold_sockets/manifold-client
CLIENT_SERVER_API_URL=http://api_rails:3020
NODE_ENV=production

Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ FROM nginx:1.25 as manifold-nginx
RUN apt-get -o Acquire::Check-Valid-Until=false update
RUN apt-get install -y openssl

COPY nginx/config/default.conf /etc/nginx/conf.d/default.conf
COPY nginx/config/default.conf.template /etc/nginx/templates/default.conf.template

COPY nginx/includes/manifold-client-local /etc/nginx/includes/manifold-client-local
COPY nginx/includes/manifold-server-local /etc/nginx/includes/manifold-server-local
Expand All @@ -70,4 +70,6 @@ COPY nginx/scripts/start-nginx /usr/local/bin/start-nginx

VOLUME ["/manifold_sockets","/manifold_data"]

CMD [ "start-nginx" ]

EXPOSE 80 443
8 changes: 4 additions & 4 deletions chart/princeton-manifold/templates/configmap-env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
API_CABLE_HOST: princeton-manifold-production-api-cable
API_CABLE_PORT: "3021"
API_CABLE_SOCKET: /manifold_sockets/manifold-cable
API_HOST: princeton-manifold-production-api-rails
API_PORT: "3020"
API_SOCKET: /manifold_sockets/manifold-api
CLIENT_BROWSER_API_CABLE_URL: https://openpublishing.princeton.edu/cable
CLIENT_BROWSER_API_URL: https://openpublishing.princeton.edu
CLIENT_SERVER_API_URL: http://princeton-manifold-production-api:3020
CLIENT_SERVER_API_URL: http://princeton-manifold-production-api-rails:3020
CLIENT_SERVER_HOST: princeton-manifold-production-client
CLIENT_SERVER_PORT: "3010"
CLIENT_SERVER_PROXIES: "true"
CLIENT_SERVER_SOCKET: /manifold_sockets/manifold-client
DOMAIN: openpublishing.princeton.edu
ELASTICSEARCH_URL: http://princeton-manifold-production-es:9200
NODE_ENV: production
Expand Down
52 changes: 52 additions & 0 deletions chart/princeton-manifold/templates/deployment-api-cable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "princeton-manifold.fullname" . }}-api-cable
labels:
{{- include "princeton-manifold.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: cable
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/name: cable
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "princeton-manifold.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: cable
command:
- bin/cable
ports:
- containerPort: 3021
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.api.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ include "princeton-manifold.fullname" . }}-env
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
51 changes: 51 additions & 0 deletions chart/princeton-manifold/templates/deployment-api-clockwork.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "princeton-manifold.fullname" . }}-api-clockwork
labels:
{{- include "princeton-manifold.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: clockwork
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/name: clockwork
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "princeton-manifold.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: clockwork
command:
- bin/zhong
- zhong.rb
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.api.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ include "princeton-manifold.fullname" . }}-env
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
54 changes: 54 additions & 0 deletions chart/princeton-manifold/templates/deployment-api-rails.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "princeton-manifold.fullname" . }}-api-rails
labels:
{{- include "princeton-manifold.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: rails
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/name: rails
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "princeton-manifold.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: rails
command:
- bin/puma
- -C
- config/puma.rb
ports:
- containerPort: 3020
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.api.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ include "princeton-manifold.fullname" . }}-env
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
50 changes: 50 additions & 0 deletions chart/princeton-manifold/templates/deployment-api-sidekiq.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "princeton-manifold.fullname" . }}-api-sidekiq
labels:
{{- include "princeton-manifold.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: sidekiq
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/name: sidekiq
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "princeton-manifold.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: sidekiq
command:
- bin/sidekiq
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.api.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ include "princeton-manifold.fullname" . }}-env
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}
Loading
Loading