Skip to content

Commit

Permalink
Add Helm chart templates for OneUptime docs deployment, service, and …
Browse files Browse the repository at this point in the history
…autoscaler
  • Loading branch information
simlarsen committed Sep 18, 2024
1 parent 26e3bb2 commit fe16146
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions HelmChart/Public/oneuptime/templates/docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# OneUptime docs Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ printf "%s-%s" $.Release.Name "docs" }}
namespace: {{ $.Release.Namespace }}
labels:
app: {{ printf "%s-%s" $.Release.Name "docs" }}
app.kubernetes.io/part-of: oneuptime
app.kubernetes.io/managed-by: Helm
appname: oneuptime
date: "{{ now | unixEpoch }}"
spec:
selector:
matchLabels:
app: {{ printf "%s-%s" $.Release.Name "docs" }}
replicas: {{ $.Values.deployment.replicaCount }}
template:
metadata:
labels:
app: {{ printf "%s-%s" $.Release.Name "docs" }}
date: "{{ now | unixEpoch }}"
appname: oneuptime
spec:
{{- if $.Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml $.Values.imagePullSecrets | nindent 8 }}
{{- end }}
{{- if $.Values.podSecurityContext }}
securityContext: {{- $.Values.podSecurityContext | toYaml | nindent 8 }}
{{- end }}
{{- if $.Values.affinity }}
affinity: {{- $.Values.affinity | toYaml | nindent 8 }}
{{- end }}
{{- if $.Values.tolerations }}
tolerations: {{- $.Values.tolerations | toYaml | nindent 8 }}
{{- end }}
{{- if $.Values.nodeSelector }}
nodeSelector: {{- $.Values.nodeSelector | toYaml | nindent 8 }}
{{- end }}
containers:
- image: {{ printf "%s/%s/%s:%s" $.Values.image.registry $.Values.image.repository "docs" $.Values.image.tag }}
name: {{ printf "%s-%s" $.Release.Name "docs" }}
# Liveness probe
livenessProbe:
httpGet:
path: /status/live
port: {{ $.Values.port.docs }}
initialDelaySeconds: 300
periodSeconds: 10
timeoutSeconds: 30
# Readyness Probe
readinessProbe:
httpGet:
path: /status/ready
port: {{ $.Values.port.docs }}
initialDelaySeconds: 300
periodSeconds: 10
timeoutSeconds: 30
{{- if $.Values.containerSecurityContext }}
securityContext: {{- $.Values.containerSecurityContext | toYaml | nindent 12 }}
{{- end }}
imagePullPolicy: {{ $.Values.image.pullPolicy }}
env:
{{- include "oneuptime.env.common" . | nindent 12 }}
{{- include "oneuptime.env.commonServer" . | nindent 12 }}
{{- include "oneuptime.env.oneuptimeSecret" . | nindent 12 }}
- name: PORT
value: {{ $.Values.port.docs | quote }}
ports:
- containerPort: {{ $.Values.port.docs }}
protocol: TCP
name: http
restartPolicy: {{ $.Values.image.restartPolicy }}

---

# OneUptime app Service
{{- $docsPorts := dict "port" $.Values.port.docs -}}
{{- $docsServiceArgs := dict "ServiceName" "docs" "Ports" $docsPorts "Release" $.Release "Values" $.Values -}}
{{- include "oneuptime.service" $docsServiceArgs }}
---

# OneUptime app autoscaler
{{- $docsAutoScalerArgs := dict "ServiceName" "docs" "Release" $.Release "Values" $.Values -}}
{{- include "oneuptime.autoscaler" $docsAutoScalerArgs }}
---

0 comments on commit fe16146

Please sign in to comment.