Skip to content

Commit

Permalink
feat: update codecov
Browse files Browse the repository at this point in the history
  • Loading branch information
thphuong committed Jun 7, 2024
1 parent e49030e commit 63801a6
Show file tree
Hide file tree
Showing 16 changed files with 262 additions and 256 deletions.
24 changes: 12 additions & 12 deletions charts/codecov/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
dependencies:
- name: common
repository: https://sun-asterisk-research.github.io/helm-charts
version: 1.0.0
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 17.0.11
repository: oci://registry-1.docker.io/bitnamicharts
version: 2.19.2
- name: minio
repository: oci://registry-1.docker.io/bitnamicharts
version: 14.4.1
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 12.1.2
repository: oci://registry-1.docker.io/bitnamicharts
version: 15.3.1
- name: redis
repository: oci://registry-1.docker.io/bitnamicharts
version: 19.3.1
- name: timescaledb-single
repository: https://charts.timescale.com/
version: 0.33.1
- name: minio
repository: https://charts.bitnami.com/bitnami
version: 11.8.1
digest: sha256:af0d5e8aa30a7fd831e24b42039064ba9bded00edf3d5927abe374220b46d8fa
generated: "2023-10-03T15:58:01.950639816+07:00"
digest: sha256:bd170985de837a005277ab0f8ad7f25f997ddbb8f5386bed089bf800be4ebe7a
generated: "2024-05-14T13:12:55.068978043+07:00"
28 changes: 14 additions & 14 deletions charts/codecov/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ apiVersion: v2
name: codecov
description: A Helm chart for Codecov
type: application
version: 0.1.5
appVersion: "v5.0.1"
version: 1.0.0
appVersion: "24.5.1"
dependencies:
- name: common
version: 1.0.0
repository: https://sun-asterisk-research.github.io/helm-charts
- name: redis
version: 17.0.11
repository: https://charts.bitnami.com/bitnami
condition: redis.enabled
version: 2.19.2
repository: oci://registry-1.docker.io/bitnamicharts
- name: minio
version: 14.4.1
repository: oci://registry-1.docker.io/bitnamicharts
condition: minio.enabled
- name: postgresql
version: 12.1.2
repository: https://charts.bitnami.com/bitnami
version: 15.3.1
repository: oci://registry-1.docker.io/bitnamicharts
condition: postgresql.enabled
- name: redis
version: 19.3.1
repository: oci://registry-1.docker.io/bitnamicharts
condition: redis.enabled
- name: timescaledb-single
alias: timescaledb
version: 0.33.*
repository: https://charts.timescale.com/
condition: timescaledb.enabled
- name: minio
version: 11.8.1
repository: https://charts.bitnami.com/bitnami
condition: minio.enabled
1 change: 0 additions & 1 deletion charts/codecov/templates/_db.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{/* vim: set filetype=mustache: */}}
{{- define "codecov.db.host" -}}
{{- if eq .Values.postgresql.enabled true -}}
{{- printf "%s-%s" .Release.Name "postgresql" | trunc 63 | trimSuffix "-" -}}
Expand Down
62 changes: 61 additions & 1 deletion charts/codecov/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,64 @@
{{/* vim: set filetype=mustache: */}}
{{- define "codecov.images.api" -}}
{{ include "codecov.renderImage" (dict "imageRoot" .Values.api.image "context" .) }}
{{- end -}}

{{- define "codecov.images.worker" -}}
{{ include "codecov.renderImage" (dict "imageRoot" .Values.worker.image "context" .) }}
{{- end -}}

{{- define "codecov.images.frontend" -}}
{{ include "codecov.renderImage" (dict "imageRoot" .Values.frontend.image "context" .) }}
{{- end -}}

{{- define "codecov.images.gateway" -}}
{{ include "codecov.renderImage" (dict "imageRoot" .Values.gateway.image "context" .) }}
{{- end -}}

{{- define "codecov.renderImage" -}}
{{- $ := .context -}}
{{- $image := empty .imageRoot.tag | ternary (merge (dict) .imageRoot (dict "tag" $.Chart.AppVersion)) .imageRoot -}}
{{ include "common.images.image" (dict "imageRoot" $image "global" $.Values.global) }}
{{- end -}}

{{- define "codecov.imagePullSecrets" -}}
{{- include "common.images.renderPullSecrets" (dict "images" (list .Values.api.image .Values.worker.image .Values.frontend.image .Values.gateway.image) "context" $) -}}
{{- end -}}

{{- define "codecov.config.scheme" -}}
{{- ternary "https" "http" (and .Values.ingress.enabled .Values.ingress.tls) -}}
{{- end -}}

{{- define "codecov.config.hostname" -}}
{{- ternary .Values.ingress.hostname (printf "%s-api.%s.svc.%s" (include "common.names.fullname" .) .Release.Namespace .Values.clusterDomain) .Values.ingress.enabled -}}
{{- end -}}

{{- define "codecov.config.port" -}}
{{- ternary "" (printf ":%d" .Values.frontend.service.port) .Values.ingress.enabled -}}
{{- end -}}

{{- define "codecov.config.host" -}}
{{- printf "%s%s" (include "codecov.config.hostname" .) (include "codecov.config.port" .) -}}
{{- end -}}

{{- define "codecov.config.url" -}}
{{- printf "%s://%s" (include "codecov.config.scheme" .) (include "codecov.config.host" .) -}}
{{- end -}}

{{- define "codecov.config.apiHostname" -}}
{{- ternary .Values.ingress.hostname (printf "%s-frontend.%s.svc.%s" (include "common.names.fullname" .) .Release.Namespace .Values.clusterDomain) .Values.ingress.enabled -}}
{{- end -}}

{{- define "codecov.config.apiPort" -}}
{{- ternary "" (printf ":%d" .Values.api.service.port) .Values.ingress.enabled -}}
{{- end -}}

{{- define "codecov.config.apiHost" -}}
{{- printf "%s%s" (include "codecov.config.apiHostname" .) (include "codecov.config.apiPort" .) -}}
{{- end -}}

{{- define "codecov.config.apiUrl" -}}
{{- printf "%s://%s" (include "codecov.config.scheme" .) (include "codecov.config.apiHost" .) -}}
{{- end -}}

{{- define "codecov.checksums.appConfig" -}}
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
Expand Down
12 changes: 0 additions & 12 deletions charts/codecov/templates/_images.tpl

This file was deleted.

1 change: 0 additions & 1 deletion charts/codecov/templates/_redis.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{{/* vim: set filetype=mustache: */}}
{{- define "codecov.redis.host" -}}
{{- if eq .Values.redis.enabled true -}}
{{- printf "%s-%s" .Release.Name "redis" | trunc 63 | trimSuffix "-" -}}-master
Expand Down
8 changes: 3 additions & 5 deletions charts/codecov/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ metadata:
name: {{ template "common.names.fullname" . }}
labels: {{ include "common.labels.standard" . | nindent 4 }}
data:
SETUP__LOGLVL: DEBUG
SETUP__CODECOV_HOST: {{ .Values.config.setup.codecovHost }}
SETUP__CODECOV_SCHEME: {{ .Values.config.setup.codecovScheme }}
SETUP__CODECOV_URL: {{ .Values.config.setup.codecovUrl }}
SETUP__CODECOV_API_URL: {{ .Values.config.setup.codecovApiUrl }}
SETUP__LOGLVL: {{ .Values.config.setup.loglvl | quote }}
SETUP__CODECOV_URL: {{ .Values.config.setup.codecovUrl | default (include "codecov.config.url" .) | quote }}
SETUP__CODECOV_API_URL: {{ .Values.config.setup.codecovApiUrl | default (include "codecov.config.apiUrl" .) | quote }}
SETUP__TIMESERIES__ENABLED: {{ .Values.config.setup.timeseries.enabled | quote }}
SITE__COMMENT__LAYOUT: {{ .Values.config.site.comment.layout | quote }}
32 changes: 14 additions & 18 deletions charts/codecov/templates/deployment-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,31 +19,25 @@ spec:
app.kubernetes.io/component: api
spec:
serviceAccountName: {{ include "codecov.serviceAccountName" . }}
{{- with .Values.api.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "codecov.imagePullSecrets" . | nindent 6 }}
containers:
- name: api
image: "{{ .Values.api.image.repository }}:{{ .Values.api.image.tag | default .Chart.AppVersion }}"
- name: codecov-api
image: {{ template "codecov.images.api" . }}
imagePullPolicy: {{ .Values.api.image.pullPolicy }}
env:
{{- with .Values.extraEnvs }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.extraEnvs }}
{{- toYaml . | nindent 8 }}
{{- end }}
envFrom:
{{- include "codecov.env" . | nindent 8 }}
volumeMounts:
- name: codecov-config
mountPath: "/config"
{{- include "codecov.volumeMounts" . | nindent 8 }}
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.api.containerPort }}
protocol: TCP
- name: http
containerPort: 8000
protocol: TCP
livenessProbe:
httpGet:
path: /
Expand All @@ -52,8 +46,9 @@ spec:
httpGet:
path: /
port: http
securityContext:
{{- toYaml .Values.api.securityContext | nindent 12 }}
{{- if .Values.api.containerSecurityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.api.containerSecurityContext "context" $) | nindent 10 }}
{{- end }}
resources:
{{- toYaml .Values.api.resources | nindent 12 }}
volumes:
Expand All @@ -79,5 +74,6 @@ spec:
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.api.topologySpreadConstraints "context" .) | nindent 8 }}
{{- end }}
{{- if .Values.api.podSecurityContext.enabled }}
securityContext: {{- omit .Values.api.podSecurityContext "enabled" | toYaml | nindent 8 }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.api.podSecurityContext "context" $) | nindent 8 }}
{{- end }}
enableServiceLinks: false
36 changes: 16 additions & 20 deletions charts/codecov/templates/deployment-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,29 @@ spec:
app.kubernetes.io/component: frontend
spec:
serviceAccountName: {{ include "codecov.serviceAccountName" . }}
{{- with .Values.frontend.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "codecov.imagePullSecrets" . | nindent 6 }}
containers:
- name: frontend
image: "{{ .Values.frontend.image.repository }}:{{ .Values.frontend.image.tag | default .Chart.AppVersion }}"
- name: codecov-frontend
image: {{ template "codecov.images.frontend" . }}
imagePullPolicy: {{ .Values.api.image.pullPolicy }}
env:
- name: CODECOV_BASE_HOST
value: {{ .Values.config.setup.codecovHost }}
value: {{ include "codecov.config.host" . }}
- name: CODECOV_API_HOST
value: {{ .Values.config.setup.codecovHost }}
value: {{ include "codecov.config.apiHost" . }}
- name: CODECOV_IA_HOST
value: {{ .Values.config.setup.codecovHost }}
value: {{ include "codecov.config.host" . }}
- name: CODECOV_SCHEME
value: {{ .Values.config.setup.codecovScheme }}
value: {{ include "codecov.config.scheme" . }}
{{- with .Values.extraEnvs }}
{{- toYaml . | nindent 10 }}
{{- end }}
envFrom:
{{- include "codecov.env" . | nindent 8 }}
ports:
- name: http
containerPort: {{ .Values.frontend.containerPort }}
protocol: TCP
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /frontend_health
Expand All @@ -55,11 +52,9 @@ spec:
port: http
volumeMounts:
{{- include "codecov.volumeMounts" . | nindent 8 }}
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
securityContext:
{{- toYaml .Values.frontend.securityContext | nindent 12 }}
{{- if .Values.frontend.containerSecurityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.frontend.containerSecurityContext "context" $) | nindent 10 }}
{{- end }}
resources:
{{- toYaml .Values.frontend.resources | nindent 12 }}
volumes:
Expand All @@ -81,6 +76,7 @@ spec:
{{- if .Values.frontend.topologySpreadConstraints }}
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.frontend.topologySpreadConstraints "context" .) | nindent 8 }}
{{- end }}
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- if .Values.frontend.podSecurityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.frontend.podSecurityContext "context" $) | nindent 8 }}
{{- end }}
enableServiceLinks: false
43 changes: 25 additions & 18 deletions charts/codecov/templates/deployment-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,34 @@ spec:
app.kubernetes.io/component: gateway
spec:
serviceAccountName: {{ include "codecov.serviceAccountName" . }}
{{- with .Values.gateway.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "codecov.imagePullSecrets" . | nindent 6 }}
containers:
- name: gateway
image: "{{ .Values.gateway.image.repository }}:{{ .Values.gateway.image.tag | default .Chart.AppVersion }}"
- name: codecov-gateway
image: {{ template "codecov.images.gateway" . }}
imagePullPolicy: {{ .Values.api.image.pullPolicy }}
env:
- name: CODECOV_GATEWAY_MINIO_ENABLED
value: "false"
- name: CODECOV_API_HOST
value: {{ include "common.names.fullname" . }}-api-svc
value: {{ include "common.names.fullname" . }}-api
- name: CODECOV_API_PORT
value: {{ .Values.api.service.port | quote }}
- name: CODECOV_API_SCHEME
value: http
- name: CODECOV_IA_HOST
value: {{ include "common.names.fullname" . }}-api-svc
value: {{ include "common.names.fullname" . }}-api
- name: CODECOV_IA_PORT
value: {{ .Values.api.service.port | quote }}
- name: CODECOV_FRONTEND_HOST
value: {{ include "common.names.fullname" . }}-frontend-svc
- name: CODECOV_FRONTEND_PORT
- name: CODECOV_IA_SCHEME
value: http
- name: CODECOV_DEFAULT_HOST
value: {{ include "common.names.fullname" . }}-frontend
- name: CODECOV_DEFAULT_PORT
value: {{ .Values.frontend.service.port | quote }}
- name: CODECOV_DEFAULT_SCHEME
value: http
- name: CODECOV_GATEWAY_HTTP_PORT
value: "8080"
{{- if .Values.minio.enabled }}
- name: CODECOV_MINIO_HOST
value: {{ include "common.names.fullname" . }}-minio
Expand All @@ -52,9 +57,9 @@ spec:
envFrom:
{{- include "codecov.env" . | nindent 8 }}
ports:
- name: http
containerPort: {{ .Values.gateway.containerPort }}
protocol: TCP
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /gateway_health
Expand All @@ -63,8 +68,9 @@ spec:
httpGet:
path: /gateway_health
port: http
securityContext:
{{- toYaml .Values.gateway.securityContext | nindent 12 }}
{{- if .Values.gateway.containerSecurityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.gateway.containerSecurityContext "context" $) | nindent 10 }}
{{- end }}
resources:
{{- toYaml .Values.gateway.resources | nindent 12 }}
volumes:
Expand All @@ -86,6 +92,7 @@ spec:
{{- if .Values.gateway.topologySpreadConstraints }}
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.gateway.topologySpreadConstraints "context" .) | nindent 8 }}
{{- end }}
{{- if .Values.podSecurityContext.enabled }}
securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- if .Values.gateway.podSecurityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.gateway.podSecurityContext "context" $) | nindent 8 }}
{{- end }}
enableServiceLinks: false
Loading

0 comments on commit 63801a6

Please sign in to comment.