@leverege/build-tools 2.96.8 → 2.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/.vscode/launch.json +21 -1
  2. package/package.json +10 -10
  3. package/src/Utils.mjs +6 -1
  4. package/src/artifacts/Utils.mjs +5 -2
  5. package/src/build-cnpg-image.mjs +0 -1
  6. package/src/chart-compass.yaml +1 -1
  7. package/src/chart-to-registry.mjs +10 -1
  8. package/src/helm-charts/api-server/values-local.yaml +3 -0
  9. package/src/helm-charts/cnpg-db-psql-stack/cluster.yaml.ovh +37 -32
  10. package/src/helm-charts/cnpg-db-psql-stack/pooler.yaml +2 -0
  11. package/src/helm-charts/cnpg-db-recovery/cluster.yaml.ovh +1 -1
  12. package/src/helm-charts/cnpg-db-tsdb-basic/cluster.yaml.ovh +50 -46
  13. package/src/helm-charts/cnpg-db-tsdb-basic/pooler.yaml +2 -0
  14. package/src/helm-charts/cnpg-db-tsdb-dense/cluster.yaml.ovh +55 -47
  15. package/src/helm-charts/cnpg-db-tsdb-dense/pooler.yaml +2 -0
  16. package/src/helm-charts/cnpg-operator/helmup.bootstrap +8 -0
  17. package/src/helm-charts/cnpg-operator/helmup.plugin +29 -4
  18. package/src/helm-charts/db-curator/values-local.yaml +9 -1
  19. package/src/helm-charts/elasticsearch8/elasticsearch-local.yaml +54 -51
  20. package/src/helm-charts/emailer/values-local.yaml +4 -1
  21. package/src/helm-charts/messenger/values-local.yaml +1 -5
  22. package/src/helm-charts/pgbouncer/values-local.yaml +8 -3
  23. package/src/helm-charts/prom-operator/helmup.bootstrap +8 -5
  24. package/src/helm-charts/prom-operator/helmup.plugin +1 -1
  25. package/src/helm-charts/prom-operator/prometheus-stack.yaml.ovh +51 -11
  26. package/src/helm-charts/prom-operator/rules/elasticsearch-rules.yaml +1 -1
  27. package/src/helm-charts/prom-operator/rules/kubestate-rules.yaml +1 -1
  28. package/src/helm-charts/push-notifier/values-local.yaml +8 -0
  29. package/src/helm-charts/redis/values-local.yaml +2 -1
  30. package/src/helm-charts/traefik/values-local.yaml +1 -1
  31. package/src/helm-charts/transponder-dh/values-local.yaml +1 -0
  32. package/src/helm-charts/transponder-tsdb/values-local.yaml +1 -0
  33. package/src/helm-charts/velero/helmup.plugin +2 -2
  34. package/src/helm-charts/velero/values-local.yaml +17 -15
  35. package/src/helmdn.sh +1 -1
  36. package/src/helmup.sh +3 -3
  37. package/src/init-my-chart/Chartwright.mjs +69 -0
  38. package/src/init-my-chart/init-my-chart-v1.mjs +124 -0
  39. package/src/init-my-chart/init-my-chart.mjs +80 -0
  40. package/src/init-my-chart/leaf-chart-templates/Chart.yaml.hbs +10 -0
  41. package/src/init-my-chart/leaf-chart-templates/templates/configmap.yaml +1 -0
  42. package/src/init-my-chart/leaf-chart-templates/templates/deployment.yaml +1 -0
  43. package/src/init-my-chart/leaf-chart-templates/templates/hpa.yaml +1 -0
  44. package/src/init-my-chart/leaf-chart-templates/templates/pdb.yaml +1 -0
  45. package/src/init-my-chart/leaf-chart-templates/templates/service.yaml +1 -0
  46. package/src/init-my-chart/leaf-chart-templates/templates/serviceaccount.yaml +1 -0
  47. package/src/init-my-chart/leaf-chart-templates/templates/servicemonitor.yaml +1 -0
  48. package/src/init-my-chart/leaf-chart-templates/values.schema.json +623 -0
  49. package/src/init-my-chart/leaf-chart-templates/values.yaml.hbs +135 -0
  50. package/src/init-my-chart/legacy-helm-template/Chart.yaml +5 -0
  51. package/src/init-my-chart/legacy-helm-template/templates/NOTES.txt +5 -0
  52. package/src/init-my-chart/legacy-helm-template/templates/_helpers.tpl +135 -0
  53. package/src/init-my-chart/legacy-helm-template/templates/configmap.yaml +10 -0
  54. package/src/init-my-chart/legacy-helm-template/templates/deployment.yaml +125 -0
  55. package/src/init-my-chart/legacy-helm-template/templates/hpa.yaml +26 -0
  56. package/src/init-my-chart/legacy-helm-template/templates/ingressroute.yaml +18 -0
  57. package/src/init-my-chart/legacy-helm-template/templates/pdb.yaml +22 -0
  58. package/src/init-my-chart/legacy-helm-template/templates/service.yaml +15 -0
  59. package/src/init-my-chart/legacy-helm-template/templates/serviceaccount.yaml +13 -0
  60. package/src/init-my-chart/legacy-helm-template/templates/servicemonitor.yaml +23 -0
  61. package/src/init-my-chart/legacy-helm-template/values.yaml +152 -0
  62. package/src/testOauthLogic.mjs +12 -0
  63. package/leverege-build-tools-2.21.13.tgz +0 -0
  64. package/lib/server/build-tools.js +0 -138
  65. package/lib/server/firebaseDeploy.js +0 -195
  66. package/lib/server/firebaseServe.js +0 -116
  67. package/lib/server/getfbcfg.js +0 -25
  68. package/lib/server/getjson.js +0 -70
  69. package/lib/server/overwhelm.js +0 -447
  70. package/lib/server/push-my-chart.js +0 -18
  71. package/lib/server/refresh-npm-token.js +0 -135
  72. package/lib/server/tag-release.js +0 -681
  73. package/lib/server/unleash.js +0 -50
  74. package/lib/web/build-tools.js +0 -138
  75. package/lib/web/firebaseDeploy.js +0 -195
  76. package/lib/web/firebaseServe.js +0 -116
  77. package/lib/web/getfbcfg.js +0 -25
  78. package/lib/web/getjson.js +0 -70
  79. package/lib/web/overwhelm.js +0 -447
  80. package/lib/web/push-my-chart.js +0 -18
  81. package/lib/web/refresh-npm-token.js +0 -135
  82. package/lib/web/tag-release.js +0 -681
  83. package/lib/web/unleash.js +0 -50
  84. package/src/helm-charts/prom-operator/rules/awesome-base/elasticsearch-rules.yaml +0 -219
  85. package/src/helm-charts/prom-operator/rules/awesome-base/google-cadvisor.yaml +0 -108
  86. package/src/helm-charts/prom-operator/rules/awesome-base/kubestate-exporter.yaml +0 -394
  87. package/src/helm-charts/prom-operator/rules/awesome-base/prometheus-rules.yaml +0 -318
  88. package/src/helm-charts/prom-operator/rules/awesome-base/redis-rules.yaml +0 -142
  89. package/src/helm-charts/prom-operator/rules/awesome-base/traefik-rules.yaml +0 -43
  90. package/src/init-my-chart.mjs +0 -18
@@ -0,0 +1,135 @@
1
+ # Default values for the Chart.
2
+ # This is a YAML-formatted file.
3
+ # Declare variables to be passed into your templates.
4
+ image:
5
+ pullPolicy: IfNotPresent
6
+ registry: {{artifactRegistry}}
7
+ # Overrides the image tag whose default is the chart appVersion.
8
+ tag: ""
9
+
10
+ # define all config values as quoted strings
11
+ config:
12
+
13
+ # node options see nodejs docs section on Command-line options
14
+ # example => "--max-old-space-size=400"
15
+ NODE_OPTIONS: ""
16
+
17
+ # mS delay between heartbeats
18
+ pulseDelay: "2000"
19
+
20
+ # server configs
21
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
22
+ HTTP_SERVER_PORT: "8989"
23
+ METRICS_PORT: "5111"
24
+
25
+ # imagine configs - this should be set to the external api-server URL
26
+ IMAGINE_API_URL : "set-in-values-local.yaml"
27
+ logExpressRequests: "false"
28
+
29
+ nameOverride: ""
30
+ fullnameOverride: ""
31
+
32
+ # When multiple charts or pieces of software are used together to make one
33
+ # application. For example, application software and a database to produce
34
+ # a website. This can be set to the top level application being supported.
35
+ partOf: "{{partOf}}"
36
+
37
+ # overwhelm will auto inject project_id, host and ingress into service
38
+ service:
39
+ project_id: set-in-values-yaml
40
+ preemptible: false
41
+ type: ClusterIP
42
+
43
+ serviceAccount:
44
+ # Specifies whether a service account should be created
45
+ create: true
46
+ # Annotations to add to the service account
47
+ annotations: {}
48
+ # The name of the service account to use.
49
+ # If not set and create is true, a name is generated using the fullname template
50
+ name: ""
51
+
52
+ # enable the service monitor for providing metrics to the prometheus operator
53
+ serviceMonitor:
54
+ enabled: false
55
+ interval: "60s"
56
+ namespace: "default" # namespace where service to scrape resides
57
+
58
+ # can be used to set load balancer to registered static IP
59
+ loadbalancer:
60
+ ip: ""
61
+
62
+ udploadbalancer:
63
+ ip: ""
64
+
65
+ # liveness and readiness probe to prove k8s health
66
+ probes:
67
+ enabled: true
68
+ livenessProbe:
69
+ httpGet:
70
+ path: /livenessProbe
71
+ port: http
72
+ initialDelaySeconds: 30
73
+ periodSeconds: 60
74
+ readinessProbe:
75
+ httpGet:
76
+ path: /healthz
77
+ port: http
78
+ initialDelaySeconds: 30
79
+ periodSeconds: 10
80
+
81
+ # this tells calico that redis access is needed
82
+ redis:
83
+ enabled: {{redisEnabled}}
84
+
85
+ # setting to false will allow pod disk to mount read/write
86
+ # setting this to false should only be done for debugging
87
+ securityContext:
88
+ readOnlyRootFs: true
89
+
90
+ resources:
91
+ # We usually recommend not to specify default resources and to leave this as a conscious
92
+ # choice for the user. This also increases chances charts run on environments with little
93
+ # resources, such as Minikube. If you do want to specify resources, uncomment the following
94
+ # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
95
+ limits:
96
+ cpu: 300m
97
+ memory: 256Mi
98
+ requests:
99
+ cpu: 150m
100
+ memory: 128Mi
101
+
102
+ # use auto scaling for dynamically sized workloads
103
+ autoscaling:
104
+ enabled: false # set to false for static scaling
105
+ minReplicas: 2
106
+ maxReplicas: 8
107
+ averageCPU: 75
108
+
109
+ # use static scaling for fixed size workloads
110
+ staticscaling:
111
+ replicas: 1 # only relevant when autoscaling is disabled
112
+
113
+ pdb:
114
+ # Specifies whether a PodDisruptionBudget should be created
115
+ enabled: true
116
+ # Min number of pods that must still be available after the eviction
117
+ # minAvailable: 1
118
+ # Max number of pods that can be unavailable after the eviction
119
+ maxUnavailable: 1
120
+
121
+ affinity: {}
122
+
123
+ # typically handled by traefik, but not always
124
+ ingressRoute:
125
+ host: ""
126
+
127
+ nodeSelector: {}
128
+
129
+ podAnnotations: {}
130
+
131
+ tolerations: []
132
+
133
+ workloadIdentity: {}
134
+
135
+ canary: {}
@@ -0,0 +1,5 @@
1
+ name: {{appChartName}}
2
+ version: 0.1.0
3
+ appVersion: v0.1.0
4
+ apiVersion: v2
5
+ icon: https://raw.githubusercontent.com/kubernetes/kubernetes/master/logo/logo.svg
@@ -0,0 +1,5 @@
1
+ -------------------------------------------------------------------------------
2
+
3
+ Deploying => {{ .Chart.Name }}
4
+
5
+ -------------------------------------------------------------------------------
@@ -0,0 +1,135 @@
1
+ {{/*
2
+ Expand the name of the chart.
3
+ */}}
4
+ {{- define "leverege.name" -}}
5
+ {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6
+ {{- end }}
7
+
8
+ {{/*
9
+ Create a default fully qualified app name.
10
+ We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11
+ If release name contains chart name it will be used as a full name.
12
+ */}}
13
+ {{- define "leverege.fullname" -}}
14
+ {{- if .Values.fullnameOverride }}
15
+ {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16
+ {{- else }}
17
+ {{- $name := default .Chart.Name .Values.nameOverride }}
18
+ {{- if contains $name .Release.Name }}
19
+ {{- .Release.Name | trunc 63 | trimSuffix "-" }}
20
+ {{- else }}
21
+ {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22
+ {{- end }}
23
+ {{- end }}
24
+ {{- end }}
25
+
26
+ {{/*
27
+ Create chart name and version as used by the chart label.
28
+ */}}
29
+ {{- define "leverege.chart" -}}
30
+ {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31
+ {{- end }}
32
+
33
+ {{/*
34
+ Common labels
35
+ */}}
36
+ {{- define "leverege.labels" -}}
37
+ helm.sh/chart: {{ include "leverege.chart" . }}
38
+ {{ include "leverege.selectorLabels" . }}
39
+ {{- if .Chart.AppVersion }}
40
+ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41
+ {{- end }}
42
+ app.kubernetes.io/managed-by: {{ .Release.Service }}
43
+ {{- if .Values.partOf }}
44
+ app.kubernetes.io/part-of: {{ .Values.partOf }}
45
+ {{- end }}
46
+ {{- end }}
47
+
48
+ {{/*
49
+ Selector labels
50
+ */}}
51
+ {{- define "leverege.selectorLabels" -}}
52
+ app.kubernetes.io/name: {{ include "leverege.name" . }}
53
+ app.kubernetes.io/instance: {{ .Release.Name }}
54
+ {{- end }}
55
+
56
+ {{/*
57
+ Create the name of the service account to use
58
+ */}}
59
+ {{- define "leverege.serviceAccountName" -}}
60
+ {{- if .Values.serviceAccount.create }}
61
+ {{- default (include "leverege.fullname" .) .Values.serviceAccount.name }}
62
+ {{- else }}
63
+ {{- default "default" .Values.serviceAccount.name }}
64
+ {{- end }}
65
+ {{- end }}
66
+
67
+ {{/*
68
+ Define reusable container ports configuration for deployments.
69
+ */}}
70
+ {{- define "leverege.deploymentPorts" -}}
71
+ - name: http
72
+ containerPort: {{ .Values.config.HTTP_SERVER_PORT }}
73
+ protocol: TCP
74
+ - name: node-metrics
75
+ containerPort: {{ .Values.config.METRICS_PORT }}
76
+ protocol: TCP
77
+ {{- end }}
78
+
79
+ {{/*
80
+ Define reusable service ports configuration for services.
81
+ */}}
82
+ {{- define "leverege.servicePorts" -}}
83
+ - name: http
84
+ port: {{ .Values.config.HTTP_SERVER_PORT }}
85
+ targetPort: http
86
+ protocol: TCP
87
+ - name: node-metrics
88
+ port: {{ .Values.config.METRICS_PORT }}
89
+ targetPort: node-metrics
90
+ protocol: TCP
91
+ {{- end }}
92
+
93
+ {{/*
94
+ Define reusable service monitors for the prometheus operator.
95
+ */}}
96
+ {{- define "leverege.serviceMonitorEndpoints" -}}
97
+ - port: node-metrics
98
+ interval: {{ default "60s" .Values.serviceMonitor.interval }}
99
+ honorLabels: true # prom-operator config setting
100
+ relabelings:
101
+ - action: labelmap
102
+ regex: __meta_kubernetes_pod_label_(.+)
103
+ - action: labelmap
104
+ regex: __meta_kubernetes_service_label_(.+)
105
+ {{- end }}
106
+
107
+ {{/*
108
+ Reusable initContainers block, currently supports modelInit pattern.
109
+ */}}
110
+ {{- define "leverege.initContainers" -}}
111
+ {{- if .Values.modelInit.enabled }}
112
+ - name: {{ .Values.modelInit.name | default "fetch-models" }}
113
+ image: {{ .Values.modelInit.image }}
114
+ securityContext:
115
+ runAsUser: {{ .Values.modelInit.runAsUser }}
116
+ runAsGroup: {{ .Values.modelInit.runAsGroup }}
117
+ command: ["/bin/bash", "-c"]
118
+ args:
119
+ {{- if .Values.modelInit.args }}
120
+ {{- toYaml .Values.modelInit.args | nindent 4 }}
121
+ {{- else }}
122
+ - >-
123
+ exec > /proc/1/fd/1 2>&1; set -ex;
124
+ {{- range $name, $uri := .Values.modelInit.sources }}
125
+ echo "Syncing {{$name}} from {{$uri}}...";
126
+ mkdir -p {{ $.Values.modelInit.targetDir }}/{{$name}};
127
+ gsutil -m rsync -r {{$uri}} {{ $.Values.modelInit.targetDir }}/{{$name}};
128
+ {{- end }}
129
+ {{- end }}
130
+ volumeMounts:
131
+ - name: model-volume
132
+ mountPath: {{ .Values.modelInit.targetDir }}
133
+ {{- end }}
134
+ {{- end }}
135
+
@@ -0,0 +1,10 @@
1
+ apiVersion: v1
2
+ kind: ConfigMap
3
+ metadata:
4
+ name: {{ include "leverege.fullname" . }}-configs
5
+ labels:
6
+ {{- include "leverege.labels" . | nindent 4 }}
7
+ data:
8
+ {{- with .Values.config }}
9
+ {{- toYaml . | nindent 2 }}
10
+ {{- end }}
@@ -0,0 +1,125 @@
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: {{ include "leverege.fullname" . }}
5
+ labels:
6
+ {{- include "leverege.labels" . | nindent 4 }}
7
+ app: {{ include "leverege.fullname" . }}
8
+ redis-client: {{ .Values.redis.enabled | quote }}
9
+ spec:
10
+ replicas: {{ default 1 .Values.staticscaling.replicas }}
11
+ selector:
12
+ matchLabels:
13
+ {{- include "leverege.selectorLabels" . | nindent 6 }}
14
+ template:
15
+ metadata:
16
+ labels:
17
+ {{- include "leverege.selectorLabels" . | nindent 8 }}
18
+ app: {{ include "leverege.fullname" . }}
19
+ redis-client: {{ .Values.redis.enabled | quote }}
20
+ annotations:
21
+ checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
22
+ prometheus.io/port: '{{ default "5111" .Values.config.METRICS_PORT }}'
23
+ prometheus.io/scrape: "true"
24
+ configmap.reloader.stakater.com/reload: "default-configs"
25
+ {{- if .Values.service.preemptible }}
26
+ cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
27
+ {{- end }}
28
+ spec:
29
+ serviceAccountName: {{ include "leverege.fullname" . }}
30
+ volumes:
31
+ - name: tmpfs
32
+ emptyDir: {}
33
+ {{- if .Values.workloadIdentity.disabled }}
34
+ - name: google-cloud-key
35
+ secret:
36
+ secretName: {{ .Chart.Name }}-sa-key
37
+ {{- end }}
38
+ affinity:
39
+ podAntiAffinity:
40
+ preferredDuringSchedulingIgnoredDuringExecution:
41
+ - weight: 100
42
+ podAffinityTerm:
43
+ labelSelector:
44
+ matchExpressions:
45
+ - key: app.kubernetes.io/name
46
+ operator: In
47
+ values:
48
+ - {{ include "leverege.fullname" . }}
49
+ topologyKey: "kubernetes.io/hostname"
50
+ {{- if .Values.service.preemptible }}
51
+ nodeAffinity:
52
+ requiredDuringSchedulingIgnoredDuringExecution:
53
+ nodeSelectorTerms:
54
+ - matchExpressions:
55
+ - key: target-env
56
+ operator: In
57
+ values:
58
+ - preemptible
59
+ tolerations:
60
+ - key: "preemptible"
61
+ operator: "Equal"
62
+ value: "true"
63
+ effect: "NoSchedule"
64
+ {{- end }}
65
+ {{- if .Values.modelInit.enabled }}
66
+ initContainers:
67
+ - name: {{ default "fetch-models" .Values.modelInit.name }}
68
+ image: {{ .Values.modelInit.image }}
69
+ securityContext:
70
+ runAsUser: {{ .Values.modelInit.runAsUser }}
71
+ runAsGroup: {{ .Values.modelInit.runAsGroup }}
72
+ command: ["/bin/sh","-c"]
73
+ args:
74
+ {{- if .Values.modelInit.args }}
75
+ {{- toYaml .Values.modelInit.args | nindent 6 }}
76
+ {{- else }}
77
+ - |
78
+ exec > /proc/1/fd/1 2>&1 # Send both stdout and stderr to container's stdout
79
+ set -ex
80
+ {{- range $name, $uri := .Values.modelInit.sources }}
81
+ echo "Syncing {{$name}} from {{$uri}}..."
82
+ mkdir -p {{ $.Values.modelInit.targetDir }}/{{$name}}
83
+ gsutil -m rsync -r {{$uri}} {{ $.Values.modelInit.targetDir }}/{{$name}}
84
+ {{- end }}
85
+ {{- end }}
86
+ volumeMounts:
87
+ - name: model-volume
88
+ mountPath: {{ .Values.modelInit.targetDir }}
89
+ {{- end }}
90
+ containers:
91
+ - name: {{ include "leverege.fullname" . }}
92
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
93
+ image: {{ .Values.image.registry }}/{{ .Chart.Name }}:{{ default .Chart.AppVersion .Values.image.tag }}
94
+ securityContext:
95
+ readOnlyRootFilesystem: {{ .Values.securityContext.readOnlyRootFs }}
96
+ runAsNonRoot: true
97
+ runAsUser: 1000
98
+ allowPrivilegeEscalation: false
99
+ {{ if .Values.probes.enabled }}
100
+ livenessProbe:
101
+ {{- toYaml .Values.probes.livenessProbe | nindent 10 }}
102
+ readinessProbe:
103
+ {{- toYaml .Values.probes.readinessProbe | nindent 10 }}
104
+ {{- end }}
105
+ resources:
106
+ {{- toYaml .Values.resources | nindent 10 }}
107
+ ports:
108
+ {{- include "leverege.deploymentPorts" . | nindent 8 }}
109
+ volumeMounts:
110
+ - name: tmpfs
111
+ mountPath: "/tmp"
112
+ {{- if .Values.workloadIdentity.disabled }}
113
+ - name: google-cloud-key
114
+ mountPath: /var/secrets/google
115
+ {{- end }}
116
+ envFrom:
117
+ - configMapRef:
118
+ name: default-configs
119
+ - configMapRef:
120
+ name: {{ include "leverege.fullname" . }}-configs
121
+ env:
122
+ {{- if .Values.workloadIdentity.disabled }}
123
+ - name: GOOGLE_APPLICATION_CREDENTIALS
124
+ value: /var/secrets/google/key.json
125
+ {{- end }}
@@ -0,0 +1,26 @@
1
+ {{- if .Values.autoscaling.enabled }}
2
+ {{ if lt .Capabilities.KubeVersion.Minor "23" }}
3
+ apiVersion: autoscaling/v2beta2
4
+ {{ else }}
5
+ apiVersion: autoscaling/v2
6
+ {{ end }}
7
+ kind: HorizontalPodAutoscaler
8
+ metadata:
9
+ name: {{ include "leverege.fullname" . }}
10
+ labels:
11
+ {{- include "leverege.labels" . | nindent 4 }}
12
+ spec:
13
+ scaleTargetRef:
14
+ apiVersion: apps/v1
15
+ kind: Deployment
16
+ name: {{ include "leverege.fullname" . }}
17
+ minReplicas: {{ .Values.autoscaling.minReplicas }}
18
+ maxReplicas: {{ .Values.autoscaling.maxReplicas }}
19
+ metrics: # https://cloud.google.com/kubernetes-engine/docs/how-to/horizontal-pod-autoscaling#multiple-metrics
20
+ - type: Resource
21
+ resource:
22
+ name: cpu
23
+ target:
24
+ type: Utilization
25
+ averageUtilization: {{ .Values.autoscaling.averageCPU }}
26
+ {{- end }}
@@ -0,0 +1,18 @@
1
+ {{- if .Values.ingressRoute.host }}
2
+ {{- $fullName := include "leverege.fullname" . -}}
3
+ {{- $svcPort := .Values.config.HTTP_SERVER_PORT -}}
4
+ apiVersion: traefik.io/v1alpha1
5
+ kind: IngressRoute
6
+ metadata:
7
+ name: {{ $fullName }}
8
+ namespace: default
9
+ spec:
10
+ entryPoints:
11
+ - websecure
12
+ routes:
13
+ - match: Host(`{{ .Values.ingressRoute.host }}`)
14
+ kind: Rule
15
+ services:
16
+ - name: {{ $fullName }}
17
+ port: {{ $svcPort }}
18
+ {{- end }}
@@ -0,0 +1,22 @@
1
+ {{- if .Values.pdb.create }}
2
+ {{ if lt .Capabilities.KubeVersion.Minor "21" }}
3
+ apiVersion: policy/v1beta1
4
+ {{ else }}
5
+ apiVersion: policy/v1
6
+ {{ end }}
7
+ kind: PodDisruptionBudget
8
+ metadata:
9
+ name: {{ include "leverege.fullname" . }}
10
+ labels:
11
+ {{- include "leverege.labels" . | nindent 4 }}
12
+ spec:
13
+ {{- if .Values.pdb.minAvailable }}
14
+ minAvailable: {{ .Values.pdb.minAvailable }}
15
+ {{- end }}
16
+ {{- if .Values.pdb.maxUnavailable }}
17
+ maxUnavailable: {{ .Values.pdb.maxUnavailable }}
18
+ {{- end }}
19
+ selector:
20
+ matchLabels:
21
+ {{ include "leverege.selectorLabels" . | nindent 6 }}
22
+ {{- end }}
@@ -0,0 +1,15 @@
1
+ apiVersion: v1
2
+ kind: Service
3
+ metadata:
4
+ name: {{ include "leverege.fullname" . }}
5
+ labels:
6
+ {{- include "leverege.labels" . | nindent 4 }}
7
+ spec:
8
+ type: {{ .Values.service.type }}
9
+ {{- if .Values.loadbalancer.ip }}
10
+ loadBalancerIP: {{ .Values.loadbalancer.ip }}
11
+ {{- end }}
12
+ ports:
13
+ {{- include "leverege.servicePorts" . | nindent 6 }}
14
+ selector:
15
+ {{- include "leverege.selectorLabels" . | nindent 4 }}
@@ -0,0 +1,13 @@
1
+ {{- if .Values.serviceAccount.create -}}
2
+ apiVersion: v1
3
+ kind: ServiceAccount
4
+ metadata:
5
+ name: {{ include "leverege.serviceAccountName" . }}
6
+ labels:
7
+ {{- include "leverege.labels" . | nindent 4 }}
8
+ annotations:
9
+ iam.gke.io/gcp-service-account: {{ .Chart.Name }}@{{ .Values.service.project_id }}.iam.gserviceaccount.com
10
+ {{- with .Values.serviceAccount.annotations }}
11
+ {{- toYaml . | nindent 4 }}
12
+ {{- end }}
13
+ {{- end }}
@@ -0,0 +1,23 @@
1
+ # plugs us into the prometheus operator
2
+ {{- if .Values.serviceMonitor.enabled }}
3
+ apiVersion: monitoring.coreos.com/v1
4
+ kind: ServiceMonitor
5
+ metadata:
6
+ {{- if .Values.partOf }}
7
+ name: {{ .Values.partOf }}-{{ include "leverege.fullname" . }}
8
+ {{ else }}
9
+ name: {{ include "leverege.fullname" . }}
10
+ {{- end }}
11
+ labels:
12
+ {{- include "leverege.labels" . | nindent 4 }}
13
+ namespace: prometheus
14
+ spec:
15
+ selector:
16
+ matchLabels:
17
+ {{ include "leverege.selectorLabels" . | nindent 6 }}
18
+ namespaceSelector:
19
+ matchNames:
20
+ - {{ default "default" .Values.serviceMonitor.namespace }}
21
+ endpoints:
22
+ {{- include "leverege.serviceMonitorEndpoints" . | nindent 4 }}
23
+ {{- end }}
@@ -0,0 +1,152 @@
1
+ # Default values for the Chart.
2
+ # This is a YAML-formatted file.
3
+ # Declare variables to be passed into your templates.
4
+ image:
5
+ pullPolicy: IfNotPresent
6
+ # Replace <FOLDER> with the artifact-registry folder for this image
7
+ registry: us-docker.pkg.dev/leverege-registry/<FOLDER>/images
8
+ # Overrides the image tag whose default is the chart appVersion.
9
+ tag: ""
10
+
11
+ # define all config values as quoted strings
12
+ config:
13
+
14
+ # node options see nodejs docs section on Command-line options
15
+ # example => "--max-old-space-size=400"
16
+ NODE_OPTIONS: ""
17
+
18
+ # server configs
19
+ LOG_CONFIG: '{"type":"pino","level":"warn"}'
20
+ HTTP_SERVER_PORT: "8080"
21
+ METRICS_PORT: "5111"
22
+
23
+ # imagine configs
24
+ IMAGINE_API_URL : "http://api-server:8181"
25
+
26
+ # INTERNAL_PORT: '8998'
27
+ # INTERNAL_CORS_ORIGIN: '*'
28
+
29
+ nameOverride: ""
30
+ fullnameOverride: ""
31
+
32
+ # When multiple charts or pieces of software are used together to make one
33
+ # application. For example, application software and a database to produce
34
+ # a website. This can be set to the top level application being supported.
35
+ partOf: # leverege-stack or project-x - OPTIONAL
36
+
37
+ # The project_id, host and ingress will be auto injected by overwhelm. The
38
+ # service port definition will use config.HTTP_SERVER_PORT for listening to
39
+ # health checks and any other routes associated with the default setup.
40
+ service:
41
+ # port: see config.HTTP_SERVER_PORT
42
+ preemptible: true
43
+ type: ClusterIP
44
+
45
+ serviceAccount:
46
+ # Specifies whether a service account should be created
47
+ create: true
48
+ # Annotations to add to the service account
49
+ annotations: {}
50
+ # The name of the service account to use.
51
+ # If not set and create is true, a name is generated using the fullname template
52
+ name: ""
53
+
54
+ # enable the service monitor for providing metrics to the prometheus operator
55
+ serviceMonitor:
56
+ enabled: false
57
+ interval: "60s"
58
+ namespace: "default"
59
+
60
+ # typically handled by traefik, but not always
61
+ ingressRoute:
62
+ host: "" # set-me-in-values-local
63
+
64
+ # can be used to set load balancer to registered static IP
65
+ loadbalancer:
66
+ ip: {}
67
+
68
+ # liveness and readiness probe to prove k8s health
69
+ probes:
70
+ enabled: true
71
+ livenessProbe:
72
+ httpGet:
73
+ path: /livenessProbe
74
+ port: http
75
+ initialDelaySeconds: 30
76
+ periodSeconds: 60
77
+ readinessProbe:
78
+ httpGet:
79
+ path: /healthz
80
+ port: http
81
+ initialDelaySeconds: 30
82
+ periodSeconds: 10
83
+
84
+ # this tells calico that redis access is needed
85
+ redis:
86
+ enabled: true
87
+
88
+ # setting to false will allow pod disk to mount read/write
89
+ # setting this to false should only be done for debugging
90
+ securityContext:
91
+ readOnlyRootFs: true
92
+
93
+ resources:
94
+ # We usually recommend not to specify default resources and to leave this as a conscious
95
+ # choice for the user. This also increases chances charts run on environments with little
96
+ # resources, such as Minikube. If you do want to specify resources, uncomment the following
97
+ # lines, adjust them as necessary, and remove the curly braces after 'resources:'.
98
+ # limits:
99
+ # cpu: 100m
100
+ # memory: 512Mi
101
+ requests:
102
+ cpu: 150m
103
+ memory: 256Mi
104
+
105
+ # use auto scaling for dynamically sized workloads
106
+ autoscaling:
107
+ enabled: true # set to false for static scaling
108
+ minReplicas: 2
109
+ maxReplicas: 8
110
+ averageCPU: 75
111
+
112
+ # use static scaling for fixed size workloads
113
+ staticscaling:
114
+ replicas: 1 # only relevant when autoscaling is disabled
115
+
116
+ pdb:
117
+ # Specifies whether a PodDisruptionBudget should be created
118
+ create: true
119
+ # Min number of pods that must still be available after the eviction
120
+ minAvailable: 1
121
+ # Max number of pods that can be unavailable after the eviction
122
+ maxUnavailable: ""
123
+
124
+ # Uses an initContainer to build models volume from GCS (tailorable)
125
+ modelInit:
126
+ enabled: true
127
+ # If 'args' is omitted, a default block that loops over 'sources' is used
128
+ # args:
129
+ # - |
130
+ # set -ex
131
+ # echo "Custom model fetch logic here..."
132
+
133
+ # Default model sync behavior (only used if args is omitted)
134
+ sources:
135
+ sam: gs://leverege-registry-ml-models/sam
136
+ yolo: gs://leverege-registry-ml-models/yolo
137
+ targetDir: /usr/src/app/models
138
+
139
+ # Optional defaults for the initContainer specification
140
+ image: gcr.io/google.com/cloudsdktool/cloud-sdk:slim
141
+ runAsUser: 1000
142
+ runAsGroup: 1000
143
+
144
+ affinity: {}
145
+
146
+ nodeSelector: {}
147
+
148
+ podAnnotations: {}
149
+
150
+ tolerations: []
151
+
152
+ workloadIdentity: {}