Skip to content
Permalink
Browse files

Basic working helm chart implementation

* Add option to disable SSL redirection
* Not yet working with google auth
  • Loading branch information
crswty committed Oct 26, 2019
1 parent a98ff9a commit 51c49f137ec0ee7a015be7fa0c37a7d503fe7006
@@ -10,7 +10,7 @@ FROM ruby:2.6.3
RUN gem install bundler:2.0.1

COPY ./api /postfacto
COPY --from=front-end /web/build /postfacto/public/
COPY --from=front-end /web/build /postfacto/client/

WORKDIR /postfacto

@@ -24,7 +24,7 @@ ENV RAILS_SERVE_STATIC_FILES true

EXPOSE 4000

CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0", "-p", "4000"]
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0", "-p", "3000"]



@@ -32,7 +32,7 @@

require_relative 'config/environment'

if ENV['RAILS_ENV'] == 'production'
if ENV['RAILS_ENV'] == 'production' && ENV['DISABLE_SSL_REDIRECT'].nil?
require 'rack/ssl'

use Rack::SSL,
@@ -0,0 +1 @@
charts/
@@ -2,5 +2,8 @@ dependencies:
- name: postgresql
repository: https://kubernetes-charts.storage.googleapis.com
version: 6.5.0
digest: sha256:2feb68581db4ecb4c752191d777ffb4823b2e879854fe07c4af09b160085256a
generated: "2019-10-23T19:12:42.739627+01:00"
- name: redis
repository: https://kubernetes-charts.storage.googleapis.com
version: 9.4.3
digest: sha256:63b5c2d6fa6dbceb477ec60d94c9d4f3f14e0ee85738b32880213282ab9a7f0e
generated: "2019-10-26T07:44:45.177984+01:00"
Binary file not shown.
@@ -2,3 +2,6 @@ dependencies:
- name: postgresql
version: 6.5.0
repository: "@stable"
- name: redis
version: 9.4.3
repository: "@stable"
@@ -33,22 +33,31 @@ spec:
value: "postgres://{{ .Values.postgresql.postgresqlUsername }}:$(POSTGRESQL_PASSWORD)@{{ .Release.Name }}-postgresql"
- name: SECRET_KEY_BASE
value: "{{ .Values.secretKeyBase }}"
- name: DISABLE_SSL_REDIRECT
value: "true"
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: "{{ .Release.Name }}-redis"
key: redis-password
- name: REDIS_URL
value: "redis://:$(REDIS_PASSWORD)@{{ .Release.Name }}-redis-master"
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 4000
containerPort: 3000
protocol: TCP
livenessProbe:
# httpGet:
# path: /
# port: http
# readinessProbe:
# httpGet:
# path: /
# port: http
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
@@ -1,6 +1,3 @@
# Default values for postfacto.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

replicaCount: 1

@@ -15,54 +12,33 @@ fullnameOverride: ""
secretKeyBase: todo

serviceAccount:
# Specifies whether a service account should be created
create: true
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name:

podSecurityContext: {}
# fsGroup: 2000

securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000

service:
type: ClusterIP
# type: ClusterIP
type: NodePort
port: 80

ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local

resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

nodeSelector: {}

redis:
cluster:
enabled: false

tolerations: []

affinity: {}
@@ -8,4 +8,4 @@ docker run -it \
-p 4000:4000 \
-v "$(pwd)":/postfacto \
-v "$(pwd)/docker_node_modules:/postfacto/web/node_modules" \
postfacto/dev:2.6.3-12.6.0
postfacto-dev:latest

0 comments on commit 51c49f1

Please sign in to comment.
You can’t perform that action at this time.