Skip to content
Open
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
77 changes: 77 additions & 0 deletions helm/chart/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{{- if and (.Values.enabled) (.Values.ingress.enabled) -}}
{{- $fullName := include "ts-server-boilerplate.fullname" . -}}
{{- $serviceName := $fullName -}}
{{- $servicePort := .Values.env.port -}}
{{- $ingressPath := .Values.ingress.path -}}
{{- $ingressPathType := default "Prefix" .Values.ingress.pathType -}}
{{- $extraPaths := .Values.ingress.extraPaths -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ $fullName }}-ingress
namespace: {{ .Release.Namespace }}
labels:
{{- include "ts-server-boilerplate.labels" . | nindent 4 }}
{{- with .Values.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.ingress.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ tpl ($value | toString) $ | quote }}
{{- end }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- with .Values.ingress.tls }}
tls:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
rules:
{{- if .Values.ingress.hosts }}
{{- range .Values.ingress.hosts }}
- host: {{ tpl . $ | quote }}
http:
paths:
{{- with $extraPaths }}
{{- tpl (toYaml .) $ | nindent 10 }}
{{- end }}
- path: {{ $ingressPath }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
{{- end }}
{{- else if .Values.ingress.host }}
- host: {{ tpl .Values.ingress.host $ | quote }}
http:
paths:
{{- with $extraPaths }}
{{- tpl (toYaml .) $ | nindent 10 }}
{{- end }}
- path: {{ $ingressPath }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
{{- else }}
- http:
paths:
{{- with $extraPaths }}
{{- tpl (toYaml .) $ | nindent 10 }}
{{- end }}
- path: {{ $ingressPath }}
pathType: {{ $ingressPathType }}
backend:
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
{{- end -}}
{{- end }}
File renamed without changes.
File renamed without changes.
41 changes: 14 additions & 27 deletions helm/values.yaml → helm/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ global:
tracing: {}
metrics: {}

mclabels:
component: backend
partOf: boilerplates
owner: common
prometheus:
enabled: true

enabled: true
replicaCount: 1
revisionHistoryLimit: 5 # Amount of revisions we keep
Expand Down Expand Up @@ -54,12 +47,6 @@ args: []

sidecars: []

cloudProvider:
dockerRegistryUrl: ''
imagePullSecretName: ''
flavor: openshift

caSecretName: ''
caPath: '/usr/local/share/ca-certificates'
caKey: 'ca.crt'

Expand All @@ -73,8 +60,7 @@ env:
port: 8080
targetPort: 8080
protocol: TCP
logLevel: info
logPrettyPrintEnabled: false

responseCompressionEnabled: true
requestPayloadLimit: 1mb
tracing:
Expand All @@ -84,15 +70,6 @@ env:
enabled: false
url: http://localhost:55681/v1/metrics

resources:
enabled: true
value:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi

route:
enabled: true
Expand All @@ -113,8 +90,18 @@ route:

ingress:
enabled: false
className: ""
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
labels: {}
path: /
pathType: Prefix
extraPaths: []
hosts: []
# - "chart-example.local"
host: 'localhost'
cors:
enabled: true
origin: '*'
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
31 changes: 31 additions & 0 deletions helm/environments/base.yaml.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
cloudProvider:
dockerRegistryUrl: ''
imagePullSecretName: ''
flavor: openshift

# Dynamically pull the component name from the release labels defined in helmfile.yaml
mclabels:
component: backend
partOf: boilerplates
owner: common
prometheus:
enabled: true

caSecretName: ''

env:
{{- if eq .Environment.Name "prod" }}
logLevel: info
logPrettyPrintEnabled: false
{{- else }}
logLevel: debug
logPrettyPrintEnabled: true
{{- end }}

route:
enabled: true
{{- if eq .Environment.Name "prod" }}
host: {{ .Release.Name }}.mapcolonies.net
{{- else }}
host: {{ .Release.Name }}-{{ .Environment.Name }}.mapcolonies.net
{{- end }}
9 changes: 9 additions & 0 deletions helm/environments/dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resources:
enabled: true
value:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
9 changes: 9 additions & 0 deletions helm/environments/prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resources:
enabled: true
value:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
9 changes: 9 additions & 0 deletions helm/environments/stage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
resources:
enabled: true
value:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
17 changes: 17 additions & 0 deletions helm/helmfile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# helmfile.yaml
environments:
dev:
stage:
prod:

---

releases:
- name: ts-server-boilerplate
namespace: my-app-{{ .Environment.Name }}
chart: ./chart
labels:
component: backend
values:
- ./environments/base.yaml.gotmpl
- ./environments/{{ .Environment.Name }}.yaml
34 changes: 0 additions & 34 deletions helm/templates/ingress.yaml

This file was deleted.

Loading