Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 6 additions & 2 deletions templates/default/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app: diffgram-default
name: diffgram-default
namespace: default
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ .Values.defaultService.numReplicas }}
selector:
Expand All @@ -15,6 +15,10 @@ spec:
labels:
app: diffgram-default
spec:
{{ if .Values.nodeGroupLabel }}
nodeSelector:
poolName: {{ .Values.nodeGroupLabel }}
{{ end }}
{{ if eq .Values.diffgramEdition "enterprise"}}
imagePullSecrets:
- name: diffgramsecret
Expand All @@ -30,7 +34,7 @@ spec:
{{ end }}
initContainers:
- name: check-db-ready
image: postgres:9.6.5
image: postgres:11
{{ if eq .Values.dbSettings.dbProvider "local"}}
command: ['sh', '-c',
'until pg_isready -h diffgram-postgres -p 5432;
Expand Down
2 changes: 1 addition & 1 deletion templates/default/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app: diffgram-default
name: diffgram-default
namespace: default
namespace: {{ .Release.Namespace }}
spec:
ports:
- port: 8080
Expand Down
7 changes: 6 additions & 1 deletion templates/frontend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ metadata:
labels:
app: frontend
name: frontend
namespace: default
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ .Values.frontendService.numReplicas }}

selector:
matchLabels:
app: frontend
Expand All @@ -15,6 +16,10 @@ spec:
labels:
app: frontend
spec:
{{ if .Values.nodeGroupLabel }}
nodeSelector:
poolName: {{ .Values.nodeGroupLabel }}
{{ end }}
{{ if eq .Values.diffgramEdition "enterprise"}}
imagePullSecrets:
- name: diffgramsecret
Expand Down
2 changes: 1 addition & 1 deletion templates/frontend/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app: frontend
name: frontend
namespace: default
namespace: {{ .Release.Namespace }}
spec:
ports:
- port: 8080
Expand Down
8 changes: 7 additions & 1 deletion templates/hooks/database_pre_install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name | quote }}
helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
{{ if .Values.nodeGroupLabel }}
nodeSelector:
poolName: {{ .Values.nodeGroupLabel }}
{{ end }}
restartPolicy: Never
{{ if eq .Values.diffgramEdition "enterprise"}}
imagePullSecrets:
Expand All @@ -36,9 +40,11 @@ spec:
- key: sa_json
path: sa_credentials.json
{{ end }}
{{ if eq .Values.dbSettings.dbProvider "local"}}
- name: postgres-storage
persistentVolumeClaim:
claimName: postgres-pv-claim
{{ end }}
containers:
{{ if eq .Values.diffgramEdition "enterprise"}}
- image: gcr.io/diffgram-enterprise/default:{{ .Values.diffgramVersion }}
Expand All @@ -50,7 +56,7 @@ spec:
name: pre-upgrade-alembic-hook
{{ if eq .Values.diffgramSettings.DIFFGRAM_STATIC_STORAGE_PROVIDER "gcp"}}
volumeMounts:
- name: service-account-credentials-volume
- name: service-account-credentials-volume-hook
mountPath: /etc/gcp
readOnly: true
{{ end }}
Expand Down
11 changes: 10 additions & 1 deletion templates/hooks/database_pre_upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ spec:
imagePullSecrets:
- name: diffgramsecret
{{ end }}
{{ if eq .Values.diffgramSettings.DIFFGRAM_STATIC_STORAGE_PROVIDER "gcp"}}
volumes:
- name: service-account-credentials-volume-hook
secret:
secretName: gcp-service-account-credentials-hook
items:
- key: sa_json
path: sa_credentials.json
{{ end }}
containers:
{{ if eq .Values.diffgramEdition "enterprise"}}
- image: gcr.io/diffgram-enterprise/default:{{ .Values.diffgramVersion }}
Expand All @@ -43,14 +45,21 @@ spec:
{{ end }}
imagePullPolicy: Always
name: pre-upgrade-alembic-hook
{{ if eq .Values.diffgramSettings.DIFFGRAM_STATIC_STORAGE_PROVIDER "gcp"}}
volumeMounts:
- name: service-account-credentials-volume-hook
mountPath: /etc/gcp
readOnly: true
{{ end }}
envFrom:
- configMapRef:
name: db-migrations-configmap
- secretRef:
name: db-migrations-secret
# The actual migrations command
command: ["sh","-c", "cd shared; export PYTHONPATH=/app; pip install sqlalchemy-utils==0.36.6;python /app/play_and_scripts/scripts/create_database.py;"]
command: ["sh","-c", "cd shared; export PYTHONPATH=/app; pip install sqlalchemy-utils==0.36.6;python /app/play_and_scripts/scripts/create_database.py;"]

{{ if .Values.nodeGroupLabel }}
nodeSelector:
poolName: {{ .Values.nodeGroupLabel }}
{{ end }}
2 changes: 1 addition & 1 deletion templates/hooks/secret_gcr_db_migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ metadata:
manager: kubectl
operation: Update
name: db-migrations-pull-secret
namespace: default
namespace: {{ .Release.Namespace }}
type: kubernetes.io/dockerconfigjson
{{ end }}
2 changes: 2 additions & 0 deletions templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: diffgram-ingress
namespace: {{ .Release.Namespace }}
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/use-regex: "true"
nginx.ingress.kubernetes.io/enable-cors: "true"
cert-manager.io/issuer: "letsencrypt-prod"
watch-namespace: {{ .Release.Namespace }}
# nginx.ingress.kubernetes.io/ssl-redirect: "false"
# nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
# Limit uploads to 8TB
Expand Down
8 changes: 6 additions & 2 deletions templates/postgres/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apiVersion: "apps/v1"
kind: "Deployment"
metadata:
name: "postgres"
namespace: "default"
namespace: {{ .Release.Namespace }}"
labels:
app: "postgres"
annotations:
Expand All @@ -26,7 +26,7 @@ spec:
spec:
containers:
- name: "postgres"
image: "postgres:9.6.2"
image: "postgres:11"
env:
- name: "POSTGRES_DB"
value: {{ .Values.dbSettings.dbName }}
Expand All @@ -44,5 +44,9 @@ spec:
- name: postgres-storage
persistentVolumeClaim:
claimName: postgres-pv-claim
{{ if eq .Values.nodeGroupLabel }}
nodeSelector:
poolName: {{ .Values.nodeGroupLabel }}
{{ end }}
{{ end }}
{{ end }}
1 change: 1 addition & 0 deletions templates/postgres/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ apiVersion: v1
kind: Service
metadata:
name: diffgram-postgres
namespace: {{ .Release.Namespace }}
spec:
ports:
- port: 5432
Expand Down
2 changes: 1 addition & 1 deletion templates/secret-gcr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ metadata:
manager: kubectl
operation: Update
name: diffgramsecret
namespace: default
namespace: {{ .Release.Namespace }}
type: kubernetes.io/dockerconfigjson
{{ end }}
8 changes: 6 additions & 2 deletions templates/walrus/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app: diffgram-walrus
name: diffgram-walrus
namespace: default
namespace:
spec:
replicas: {{ .Values.walrusService.numReplicas }}
selector:
Expand All @@ -15,6 +15,10 @@ spec:
labels:
app: diffgram-walrus
spec:
{{ if .Values.nodeGroupLabel }}
nodeSelector:
poolName: {{ .Values.nodeGroupLabel }}
{{ end }}
{{ if eq .Values.diffgramEdition "enterprise"}}
imagePullSecrets:
- name: diffgramsecret
Expand All @@ -32,7 +36,7 @@ spec:
emptyDir: {}
initContainers:
- name: check-db-ready
image: postgres:9.6.5
image: postgres:11
{{ if eq .Values.dbSettings.dbProvider "local"}}
command: ['sh', '-c',
'until pg_isready -h diffgram-postgres -p 5432;
Expand Down
2 changes: 1 addition & 1 deletion templates/walrus/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
labels:
app: diffgram-walrus
name: diffgram-walrus
namespace: default
namespace: {{ .Release.Namespace }}
spec:
ports:
- port: 8080
Expand Down
20 changes: 11 additions & 9 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,33 +71,35 @@ imagePullCredentials:
# The service account with permissions to pull from the GCR Repository. [Should be Provided by Diffgram Team.]
gcrCredentials: provided_by_diffgram_team

nodeGroupLabel: null

# The service for API calls.
# This are minimal defaults. Please feel free to change them as you start having more usage
defaultService:
numReplicas: 1
numReplicas: 2
requests:
cpu: "2.0"
memory: "2G"
memory: "4G"
limits:
cpu: "2.0"
memory: "2G"
memory: "4G"
# The service for the UI frontend.
# This are minimal defaults. Please feel free to change them as you start having more usage
frontendService:
numReplicas: 1
requests:
cpu: "1.0"
cpu: "2.0"
memory: "2G"
limits:
cpu: "1.0"
cpu: "2.0"
memory: "2G"
# The service for video processing. This is where the heavy processing takes place.
# This are minimal defaults. Please feel free to change them as you start having more usage
walrusService:
numReplicas: 1
numReplicas: 2
requests:
cpu: "4.0"
memory: "16G"
memory: "14G"
limits:
cpu: "4.0"
memory: "16G"
cpu: "8.0"
memory: "32G"