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
7 changes: 6 additions & 1 deletion sre/charts/backend/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ The backend service has been deployed.
To check the service:
kubectl get pods -l app.kubernetes.io/instance={{ .Release.Name }}

To access locally:
To access locally with port forwarding:
kubectl port-forward svc/{{ include "backend.fullname" . }} 8080:{{ .Values.service.port }}
curl http://localhost:8080/api/welcome
curl http://localhost:8080/actuator/health

To access through nginx Ingress object and service
(Requires host file be updated)
curl http://interview-backend.local/api/welcome
curl http://interview-backend.local/actuator/health
10 changes: 10 additions & 0 deletions sre/charts/backend/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "backend.fullname" . }}
labels:
{{- include "backend.labels" . | nindent 4 }}
data:
{{- range $key, $val := .Values.config }}
{{ $key }}: {{ $val | quote }}
{{- end }}
5 changes: 3 additions & 2 deletions sre/charts/backend/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ spec:
volumeMounts:
- name: tmp
mountPath: /tmp
env:
{{- toYaml .Values.env | nindent 12 }}
envFrom:
- configMapRef:
name: {{ include "backend.fullname" . }}
livenessProbe:
httpGet:
path: {{ .Values.livenessProbe.path }}
Expand Down
13 changes: 13 additions & 0 deletions sre/charts/backend/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if .Values.pdb.enabled -}}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "backend.fullname" . }}
labels:
{{- include "backend.labels" . | nindent 4 }}
spec:
minAvailable: {{ .Values.pdb.minAvailable }}
selector:
matchLabels:
{{- include "backend.selectorLabels" . | nindent 6 }}
{{- end }}
9 changes: 6 additions & 3 deletions sre/charts/backend/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ service:
port: 80
containerPort: 8080

env:
- name: H2_CONSOLE_ENABLED
value: "false"
config:
H2_CONSOLE_ENABLED: "false"

resources:
requests:
Expand Down Expand Up @@ -75,3 +74,7 @@ autoscaling:
minReplicas: 1
maxReplicas: 3
targetCPUUtilizationPercentage: 80

pdb:
enabled: true
minAvailable: 1