mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 14:49:07 +00:00
Add new configurations for 'ingestor' in HelmChart/Public/oneuptime/values.yaml and Nginx/Index.ts
This commit is contained in:
parent
f601e93101
commit
0f86812258
@ -1,8 +1,81 @@
|
||||
# OneUptime ingestor Deployment
|
||||
{{- $ingestorPorts := dict "port" $.Values.port.ingestor -}}
|
||||
{{- $ingestorEnv := dict "PORT" $.Values.port.ingestor -}}
|
||||
{{- $ingestorDeploymentArgs :=dict "IsServer" true "ServiceName" "ingestor" "Ports" $ingestorPorts "Release" $.Release "Values" $.Values "Env" $ingestorEnv -}}
|
||||
{{- include "oneuptime.deployment" $ingestorDeploymentArgs }}
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ printf "%s-%s" $.Release.Name "ingestor" }}
|
||||
namespace: {{ $.Release.Namespace }}
|
||||
labels:
|
||||
app: {{ printf "%s-%s" $.Release.Name "ingestor" }}
|
||||
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 "ingestor" }}
|
||||
replicas: {{ $.Values.deployment.replicaCount }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ printf "%s-%s" $.Release.Name "ingestor" }}
|
||||
date: "{{ now | unixEpoch }}"
|
||||
appname: oneuptime
|
||||
spec:
|
||||
volumes:
|
||||
- name: greenlockrc
|
||||
emptyDir:
|
||||
sizeLimit: "1Gi"
|
||||
{{- 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 "ingestor" $.Values.image.tag }}
|
||||
name: {{ printf "%s-%s" $.Release.Name "ingestor" }}
|
||||
# Liveness probe
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /status/live
|
||||
port: {{ $.Values.port.ingestor }}
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 30
|
||||
# Readyness Probe
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /status/ready
|
||||
port: {{ $.Values.port.ingestor }}
|
||||
initialDelaySeconds: 30
|
||||
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: OPENTELEMETRY_EXPORTER_OTLP_HEADERS
|
||||
value: {{ $.Values.openTelemetryExporter.headers.ingestor }}
|
||||
- name: PORT
|
||||
value: {{ $.Values.port.ingestor | quote }}
|
||||
ports:
|
||||
- containerPort: {{ $.Values.port.ingestor }}
|
||||
protocol: TCP
|
||||
name: http
|
||||
restartPolicy: {{ $.Values.image.restartPolicy }}
|
||||
|
||||
---
|
||||
|
||||
# OneUptime ingestor Service
|
||||
|
@ -1,13 +1,102 @@
|
||||
|
||||
# OneUptime nginx Deployment
|
||||
{{- $runDir := dict "SizeLimit" "1Gi" "MountPath" "/var/run" -}}
|
||||
{{- $confDir := dict "SizeLimit" "1Gi" "MountPath" "/etc/nginx/conf.d" -}}
|
||||
{{- $cacheDir := dict "SizeLimit" "1Gi" "MountPath" "/var/cache/nginx" -}}
|
||||
{{- $statusPageCertsDir := dict "SizeLimit" "1Gi" "MountPath" "/etc/nginx/certs/StatusPageCerts" -}}
|
||||
{{- $nginxVolumes := dict "status-page-certs" $statusPageCertsDir "cache" $cacheDir "conf" $confDir "run" $runDir -}}
|
||||
{{- $nginxPorts := dict "http" "7849" "https" "7850" -}}
|
||||
{{- $nginxDeploymentArgs :=dict "IsServer" true "Ports" $nginxPorts "ServiceName" "nginx" "Release" $.Release "Values" $.Values "Volumes" $nginxVolumes -}}
|
||||
{{- include "oneuptime.deployment" $nginxDeploymentArgs }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ printf "%s-%s" $.Release.Name "nginx" }}
|
||||
namespace: {{ $.Release.Namespace }}
|
||||
labels:
|
||||
app: {{ printf "%s-%s" $.Release.Name "nginx" }}
|
||||
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 "nginx" }}
|
||||
replicas: {{ $.Values.deployment.replicaCount }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ printf "%s-%s" $.Release.Name "nginx" }}
|
||||
date: "{{ now | unixEpoch }}"
|
||||
appname: oneuptime
|
||||
spec:
|
||||
volumes:
|
||||
- name: status-page-certs
|
||||
emptyDir:
|
||||
sizeLimit: "1Gi"
|
||||
- name: cache
|
||||
emptyDir:
|
||||
sizeLimit: "1Gi"
|
||||
- name: conf
|
||||
emptyDir:
|
||||
sizeLimit: "1Gi"
|
||||
- name: run
|
||||
emptyDir:
|
||||
sizeLimit: "1Gi"
|
||||
{{- 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 "nginx" $.Values.image.tag }}
|
||||
name: {{ printf "%s-%s" $.Release.Name "nginx" }}
|
||||
# Liveness probe
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /status/live
|
||||
port: 7851
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 30
|
||||
# Readyness Probe
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /status/ready
|
||||
port: 7851
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 30
|
||||
volumeMounts:
|
||||
- name: status-page-certs
|
||||
mountPath: /etc/nginx/certs/StatusPageCerts
|
||||
- name: cache
|
||||
mountPath: /var/cache/nginx
|
||||
- name: conf
|
||||
mountPath: /etc/nginx/conf.d
|
||||
- name: run
|
||||
mountPath: /var/run
|
||||
{{- 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: OPENTELEMETRY_EXPORTER_OTLP_HEADERS
|
||||
value: {{ $.Values.openTelemetryExporter.headers.ingress }}
|
||||
- name: PORT
|
||||
value: "7851" # Port for the nodejs server for live and ready status
|
||||
ports:
|
||||
- containerPort: 7849
|
||||
protocol: TCP
|
||||
name: http
|
||||
- containerPort: 7850
|
||||
protocol: TCP
|
||||
name: https
|
||||
restartPolicy: {{ $.Values.image.restartPolicy }}
|
||||
|
||||
---
|
||||
|
||||
apiVersion: v1
|
||||
|
@ -178,6 +178,8 @@ openTelemetryExporter:
|
||||
statusPage:
|
||||
probe:
|
||||
adminDashboard:
|
||||
ingestor:
|
||||
ingress:
|
||||
|
||||
containerSecurityContext:
|
||||
podSecurityContext:
|
||||
|
@ -1,21 +1,33 @@
|
||||
process.env['SERVICE_NAME'] = 'ingress';
|
||||
|
||||
import logger from 'CommonServer/Utils/Logger';
|
||||
import App from 'CommonServer/Utils/StartServer';
|
||||
import { PostgresAppInstance } from 'CommonServer/Infrastructure/PostgresDatabase';
|
||||
import FetchCertificateJobs from './Jobs/FetchCertificates';
|
||||
import { PromiseVoidFunction } from 'Common/Types/FunctionTypes';
|
||||
import InfrastructureStatus from 'CommonServer/Infrastructure/Status';
|
||||
|
||||
const APP_NAME: string = 'ingress';
|
||||
const APP_NAME: string = process.env['SERVICE_NAME'];
|
||||
|
||||
const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
try {
|
||||
|
||||
const statusCheck: PromiseVoidFunction = async (): Promise<void> => {
|
||||
return await InfrastructureStatus.checkStatus({
|
||||
checkClickhouseStatus: false,
|
||||
checkPostgresStatus: true,
|
||||
checkRedisStatus: false,
|
||||
});
|
||||
};
|
||||
|
||||
// init the app
|
||||
await App.init({
|
||||
appName: APP_NAME,
|
||||
port: undefined,
|
||||
isFrontendApp: false,
|
||||
statusOptions: {
|
||||
liveCheck: async () => {},
|
||||
readyCheck: async () => {},
|
||||
liveCheck: statusCheck,
|
||||
readyCheck: statusCheck,
|
||||
},
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user