Skip to content

Commit

Permalink
add configmap
Browse files Browse the repository at this point in the history
  • Loading branch information
bkiahstroud committed Jun 3, 2024
1 parent 05e9c00 commit e404387
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
16 changes: 16 additions & 0 deletions chart/princeton-manifold/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,19 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Create default fully qualified service names.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "princeton-manifold.redis.fullname" -}}
{{- printf "%s-%s" .Release.Name "redis" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{- define "princeton-manifold.redis.host" -}}
{{- printf "%s-master" (include "princeton-manifold.redis.fullname" .) -}}
{{- end -}}

{{- define "princeton-manifold.redis.url" -}}
{{- printf "redis://:%s@%s:%s" .Values.redis.auth.password (include "princeton-manifold.redis.host" .) "6379/0" -}}
{{- end -}}
4 changes: 4 additions & 0 deletions chart/princeton-manifold/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ spec:
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
checksum/princeton-manifold-production-env: {{ include (print $.Template.BasePath "/configmap-env.yaml") . | sha256sum }}
labels:
{{- include "princeton-manifold.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
Expand All @@ -36,6 +37,9 @@ spec:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
envFrom:
- configMapRef:
name: {{ include "princeton-manifold.fullname" . }}-env
ports:
- name: http
containerPort: {{ .Values.service.port }}
Expand Down
9 changes: 9 additions & 0 deletions chart/princeton-manifold/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,3 +105,12 @@ 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

0 comments on commit e404387

Please sign in to comment.